• 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=14eaca76dba704ee64f454aaca821a6818012fc6$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_OVERLAY_CONTROLLER_CAPI_H_
40 #define CEF_INCLUDE_CAPI_VIEWS_CEF_OVERLAY_CONTROLLER_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_base_capi.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 struct _cef_view_t;
50 struct _cef_window_t;
51 
52 ///
53 // Controller for an overlay that contains a contents View added via
54 // cef_window_t::AddOverlayView. Methods exposed by this controller should be
55 // called in preference to functions of the same name exposed by the contents
56 // View unless otherwise indicated. Methods must be called on the browser
57 // process UI thread unless otherwise indicated.
58 ///
59 typedef struct _cef_overlay_controller_t {
60   ///
61   // Base structure.
62   ///
63   cef_base_ref_counted_t base;
64 
65   ///
66   // Returns true (1) if this object is valid.
67   ///
68   int(CEF_CALLBACK* is_valid)(struct _cef_overlay_controller_t* self);
69 
70   ///
71   // Returns true (1) if this object is the same as |that| object.
72   ///
73   int(CEF_CALLBACK* is_same)(struct _cef_overlay_controller_t* self,
74                              struct _cef_overlay_controller_t* that);
75 
76   ///
77   // Returns the contents View for this overlay.
78   ///
79   struct _cef_view_t*(CEF_CALLBACK* get_contents_view)(
80       struct _cef_overlay_controller_t* self);
81 
82   ///
83   // Returns the top-level Window hosting this overlay. Use this function
84   // instead of calling get_window() on the contents View.
85   ///
86   struct _cef_window_t*(CEF_CALLBACK* get_window)(
87       struct _cef_overlay_controller_t* self);
88 
89   ///
90   // Returns the docking mode for this overlay.
91   ///
92   cef_docking_mode_t(CEF_CALLBACK* get_docking_mode)(
93       struct _cef_overlay_controller_t* self);
94 
95   ///
96   // Destroy this overlay.
97   ///
98   void(CEF_CALLBACK* destroy)(struct _cef_overlay_controller_t* self);
99 
100   ///
101   // Sets the bounds (size and position) of this overlay. This will set the
102   // bounds of the contents View to match and trigger a re-layout if necessary.
103   // |bounds| is in parent coordinates and any insets configured on this overlay
104   // will be ignored. Use this function only for overlays created with a docking
105   // mode value of CEF_DOCKING_MODE_CUSTOM. With other docking modes modify the
106   // insets of this overlay and/or layout of the contents View and call
107   // size_to_preferred_size() instead to calculate the new size and re-position
108   // the overlay if necessary.
109   ///
110   void(CEF_CALLBACK* set_bounds)(struct _cef_overlay_controller_t* self,
111                                  const cef_rect_t* bounds);
112 
113   ///
114   // Returns the bounds (size and position) of this overlay in parent
115   // coordinates.
116   ///
117   cef_rect_t(CEF_CALLBACK* get_bounds)(struct _cef_overlay_controller_t* self);
118 
119   ///
120   // Returns the bounds (size and position) of this overlay in DIP screen
121   // coordinates.
122   ///
123   cef_rect_t(CEF_CALLBACK* get_bounds_in_screen)(
124       struct _cef_overlay_controller_t* self);
125 
126   ///
127   // Sets the size of this overlay without changing the position. This will set
128   // the size of the contents View to match and trigger a re-layout if
129   // necessary. |size| is in parent coordinates and any insets configured on
130   // this overlay will be ignored. Use this function only for overlays created
131   // with a docking mode value of CEF_DOCKING_MODE_CUSTOM. With other docking
132   // modes modify the insets of this overlay and/or layout of the contents View
133   // and call size_to_preferred_size() instead to calculate the new size and re-
134   // position the overlay if necessary.
135   ///
136   void(CEF_CALLBACK* set_size)(struct _cef_overlay_controller_t* self,
137                                const cef_size_t* size);
138 
139   ///
140   // Returns the size of this overlay in parent coordinates.
141   ///
142   cef_size_t(CEF_CALLBACK* get_size)(struct _cef_overlay_controller_t* self);
143 
144   ///
145   // Sets the position of this overlay without changing the size. |position| is
146   // in parent coordinates and any insets configured on this overlay will be
147   // ignored. Use this function only for overlays created with a docking mode
148   // value of CEF_DOCKING_MODE_CUSTOM. With other docking modes modify the
149   // insets of this overlay and/or layout of the contents View and call
150   // size_to_preferred_size() instead to calculate the new size and re-position
151   // the overlay if necessary.
152   ///
153   void(CEF_CALLBACK* set_position)(struct _cef_overlay_controller_t* self,
154                                    const cef_point_t* position);
155 
156   ///
157   // Returns the position of this overlay in parent coordinates.
158   ///
159   cef_point_t(CEF_CALLBACK* get_position)(
160       struct _cef_overlay_controller_t* self);
161 
162   ///
163   // Sets the insets for this overlay. |insets| is in parent coordinates. Use
164   // this function only for overlays created with a docking mode value other
165   // than CEF_DOCKING_MODE_CUSTOM.
166   ///
167   void(CEF_CALLBACK* set_insets)(struct _cef_overlay_controller_t* self,
168                                  const cef_insets_t* insets);
169 
170   ///
171   // Returns the insets for this overlay in parent coordinates.
172   ///
173   cef_insets_t(CEF_CALLBACK* get_insets)(
174       struct _cef_overlay_controller_t* self);
175 
176   ///
177   // Size this overlay to its preferred size and trigger a re-layout if
178   // necessary. The position of overlays created with a docking mode value of
179   // CEF_DOCKING_MODE_CUSTOM will not be modified by calling this function. With
180   // other docking modes this function may re-position the overlay if necessary
181   // to accommodate the new size and any insets configured on the contents View.
182   ///
183   void(CEF_CALLBACK* size_to_preferred_size)(
184       struct _cef_overlay_controller_t* self);
185 
186   ///
187   // Sets whether this overlay is visible. Overlays are hidden by default. If
188   // this overlay is hidden then it and any child Views will not be drawn and,
189   // if any of those Views currently have focus, then focus will also be
190   // cleared. Painting is scheduled as needed.
191   ///
192   void(CEF_CALLBACK* set_visible)(struct _cef_overlay_controller_t* self,
193                                   int visible);
194 
195   ///
196   // Returns whether this overlay is visible. A View may be visible but still
197   // not drawn in a Window if any parent Views are hidden. Call is_drawn() to
198   // determine whether this overlay and all parent Views are visible and will be
199   // drawn.
200   ///
201   int(CEF_CALLBACK* is_visible)(struct _cef_overlay_controller_t* self);
202 
203   ///
204   // Returns whether this overlay is visible and drawn in a Window. A View is
205   // drawn if it and all parent Views are visible. To determine if the
206   // containing Window is visible to the user on-screen call is_visible() on the
207   // Window.
208   ///
209   int(CEF_CALLBACK* is_drawn)(struct _cef_overlay_controller_t* self);
210 } cef_overlay_controller_t;
211 
212 #ifdef __cplusplus
213 }
214 #endif
215 
216 #endif  // CEF_INCLUDE_CAPI_VIEWS_CEF_OVERLAY_CONTROLLER_CAPI_H_
217