• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // ---------------------------------------------------------------------------
31 //
32 // This file was generated by the CEF translator tool and should not edited
33 // by hand. See the translator.README.txt file in the tools directory for
34 // more information.
35 //
36 // $hash=9ae10b92eed7495112c94825521ac46fb9327ef7$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_
40 #define CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_browser_capi.h"
44 #include "include/capi/views/cef_browser_view_delegate_capi.h"
45 #include "include/capi/views/cef_view_capi.h"
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 ///
52 // A View hosting a cef_browser_t instance. Methods must be called on the
53 // browser process UI thread unless otherwise indicated.
54 ///
55 typedef struct _cef_browser_view_t {
56   ///
57   // Base structure.
58   ///
59   cef_view_t base;
60 
61   ///
62   // Returns the cef_browser_t hosted by this BrowserView. Will return NULL if
63   // the browser has not yet been created or has already been destroyed.
64   ///
65   struct _cef_browser_t*(CEF_CALLBACK* get_browser)(
66       struct _cef_browser_view_t* self);
67 
68   ///
69   // Returns the Chrome toolbar associated with this BrowserView. Only supported
70   // when using the Chrome runtime. The cef_browser_view_delegate_t::
71   // get_chrome_toolbar_type() function must return a value other than
72   // CEF_CTT_NONE and the toolbar will not be available until after this
73   // BrowserView is added to a cef_window_t and
74   // cef_view_delegate_t::on_window_changed() has been called.
75   ///
76   struct _cef_view_t*(CEF_CALLBACK* get_chrome_toolbar)(
77       struct _cef_browser_view_t* self);
78 
79   ///
80   // Sets whether accelerators registered with cef_window_t::SetAccelerator are
81   // triggered before or after the event is sent to the cef_browser_t. If
82   // |prefer_accelerators| is true (1) then the matching accelerator will be
83   // triggered immediately and the event will not be sent to the cef_browser_t.
84   // If |prefer_accelerators| is false (0) then the matching accelerator will
85   // only be triggered if the event is not handled by web content or by
86   // cef_keyboard_handler_t. The default value is false (0).
87   ///
88   void(CEF_CALLBACK* set_prefer_accelerators)(struct _cef_browser_view_t* self,
89                                               int prefer_accelerators);
90 } cef_browser_view_t;
91 
92 ///
93 // Create a new BrowserView. The underlying cef_browser_t will not be created
94 // until this view is added to the views hierarchy. The optional |extra_info|
95 // parameter provides an opportunity to specify extra information specific to
96 // the created browser that will be passed to
97 // cef_render_process_handler_t::on_browser_created() in the render process.
98 ///
99 CEF_EXPORT cef_browser_view_t* cef_browser_view_create(
100     struct _cef_client_t* client,
101     const cef_string_t* url,
102     const struct _cef_browser_settings_t* settings,
103     struct _cef_dictionary_value_t* extra_info,
104     struct _cef_request_context_t* request_context,
105     struct _cef_browser_view_delegate_t* delegate);
106 
107 ///
108 // Returns the BrowserView associated with |browser|.
109 ///
110 CEF_EXPORT cef_browser_view_t* cef_browser_view_get_for_browser(
111     struct _cef_browser_t* browser);
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif  // CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_
118