1 // Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=e35b635ec442c8910b02aca64d48760b1360c868$
13 //
14
15 #include "libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h"
16 #include "libcef_dll/ctocpp/views/textfield_ctocpp.h"
17 #include "libcef_dll/ctocpp/views/view_ctocpp.h"
18 #include "libcef_dll/shutdown_checker.h"
19
20 namespace {
21
22 // MEMBER FUNCTIONS - Body may be edited by hand.
23
24 int CEF_CALLBACK
textfield_delegate_on_key_event(struct _cef_textfield_delegate_t * self,cef_textfield_t * textfield,const struct _cef_key_event_t * event)25 textfield_delegate_on_key_event(struct _cef_textfield_delegate_t* self,
26 cef_textfield_t* textfield,
27 const struct _cef_key_event_t* event) {
28 shutdown_checker::AssertNotShutdown();
29
30 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
31
32 DCHECK(self);
33 if (!self)
34 return 0;
35 // Verify param: textfield; type: refptr_diff
36 DCHECK(textfield);
37 if (!textfield)
38 return 0;
39 // Verify param: event; type: struct_byref_const
40 DCHECK(event);
41 if (!event)
42 return 0;
43
44 // Translate param: event; type: struct_byref_const
45 CefKeyEvent eventObj;
46 if (event)
47 eventObj.Set(*event, false);
48
49 // Execute
50 bool _retval = CefTextfieldDelegateCppToC::Get(self)->OnKeyEvent(
51 CefTextfieldCToCpp::Wrap(textfield), eventObj);
52
53 // Return type: bool
54 return _retval;
55 }
56
57 void CEF_CALLBACK
textfield_delegate_on_after_user_action(struct _cef_textfield_delegate_t * self,cef_textfield_t * textfield)58 textfield_delegate_on_after_user_action(struct _cef_textfield_delegate_t* self,
59 cef_textfield_t* textfield) {
60 shutdown_checker::AssertNotShutdown();
61
62 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
63
64 DCHECK(self);
65 if (!self)
66 return;
67 // Verify param: textfield; type: refptr_diff
68 DCHECK(textfield);
69 if (!textfield)
70 return;
71
72 // Execute
73 CefTextfieldDelegateCppToC::Get(self)->OnAfterUserAction(
74 CefTextfieldCToCpp::Wrap(textfield));
75 }
76
77 cef_size_t CEF_CALLBACK
textfield_delegate_get_preferred_size(struct _cef_view_delegate_t * self,cef_view_t * view)78 textfield_delegate_get_preferred_size(struct _cef_view_delegate_t* self,
79 cef_view_t* view) {
80 shutdown_checker::AssertNotShutdown();
81
82 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
83
84 DCHECK(self);
85 if (!self)
86 return CefSize();
87 // Verify param: view; type: refptr_diff
88 DCHECK(view);
89 if (!view)
90 return CefSize();
91
92 // Execute
93 cef_size_t _retval = CefTextfieldDelegateCppToC::Get(
94 reinterpret_cast<cef_textfield_delegate_t*>(self))
95 ->GetPreferredSize(CefViewCToCpp::Wrap(view));
96
97 // Return type: simple
98 return _retval;
99 }
100
101 cef_size_t CEF_CALLBACK
textfield_delegate_get_minimum_size(struct _cef_view_delegate_t * self,cef_view_t * view)102 textfield_delegate_get_minimum_size(struct _cef_view_delegate_t* self,
103 cef_view_t* view) {
104 shutdown_checker::AssertNotShutdown();
105
106 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
107
108 DCHECK(self);
109 if (!self)
110 return CefSize();
111 // Verify param: view; type: refptr_diff
112 DCHECK(view);
113 if (!view)
114 return CefSize();
115
116 // Execute
117 cef_size_t _retval = CefTextfieldDelegateCppToC::Get(
118 reinterpret_cast<cef_textfield_delegate_t*>(self))
119 ->GetMinimumSize(CefViewCToCpp::Wrap(view));
120
121 // Return type: simple
122 return _retval;
123 }
124
125 cef_size_t CEF_CALLBACK
textfield_delegate_get_maximum_size(struct _cef_view_delegate_t * self,cef_view_t * view)126 textfield_delegate_get_maximum_size(struct _cef_view_delegate_t* self,
127 cef_view_t* view) {
128 shutdown_checker::AssertNotShutdown();
129
130 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
131
132 DCHECK(self);
133 if (!self)
134 return CefSize();
135 // Verify param: view; type: refptr_diff
136 DCHECK(view);
137 if (!view)
138 return CefSize();
139
140 // Execute
141 cef_size_t _retval = CefTextfieldDelegateCppToC::Get(
142 reinterpret_cast<cef_textfield_delegate_t*>(self))
143 ->GetMaximumSize(CefViewCToCpp::Wrap(view));
144
145 // Return type: simple
146 return _retval;
147 }
148
149 int CEF_CALLBACK
textfield_delegate_get_height_for_width(struct _cef_view_delegate_t * self,cef_view_t * view,int width)150 textfield_delegate_get_height_for_width(struct _cef_view_delegate_t* self,
151 cef_view_t* view,
152 int width) {
153 shutdown_checker::AssertNotShutdown();
154
155 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
156
157 DCHECK(self);
158 if (!self)
159 return 0;
160 // Verify param: view; type: refptr_diff
161 DCHECK(view);
162 if (!view)
163 return 0;
164
165 // Execute
166 int _retval = CefTextfieldDelegateCppToC::Get(
167 reinterpret_cast<cef_textfield_delegate_t*>(self))
168 ->GetHeightForWidth(CefViewCToCpp::Wrap(view), width);
169
170 // Return type: simple
171 return _retval;
172 }
173
174 void CEF_CALLBACK
textfield_delegate_on_parent_view_changed(struct _cef_view_delegate_t * self,cef_view_t * view,int added,cef_view_t * parent)175 textfield_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self,
176 cef_view_t* view,
177 int added,
178 cef_view_t* parent) {
179 shutdown_checker::AssertNotShutdown();
180
181 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
182
183 DCHECK(self);
184 if (!self)
185 return;
186 // Verify param: view; type: refptr_diff
187 DCHECK(view);
188 if (!view)
189 return;
190 // Verify param: parent; type: refptr_diff
191 DCHECK(parent);
192 if (!parent)
193 return;
194
195 // Execute
196 CefTextfieldDelegateCppToC::Get(
197 reinterpret_cast<cef_textfield_delegate_t*>(self))
198 ->OnParentViewChanged(CefViewCToCpp::Wrap(view), added ? true : false,
199 CefViewCToCpp::Wrap(parent));
200 }
201
202 void CEF_CALLBACK
textfield_delegate_on_child_view_changed(struct _cef_view_delegate_t * self,cef_view_t * view,int added,cef_view_t * child)203 textfield_delegate_on_child_view_changed(struct _cef_view_delegate_t* self,
204 cef_view_t* view,
205 int added,
206 cef_view_t* child) {
207 shutdown_checker::AssertNotShutdown();
208
209 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
210
211 DCHECK(self);
212 if (!self)
213 return;
214 // Verify param: view; type: refptr_diff
215 DCHECK(view);
216 if (!view)
217 return;
218 // Verify param: child; type: refptr_diff
219 DCHECK(child);
220 if (!child)
221 return;
222
223 // Execute
224 CefTextfieldDelegateCppToC::Get(
225 reinterpret_cast<cef_textfield_delegate_t*>(self))
226 ->OnChildViewChanged(CefViewCToCpp::Wrap(view), added ? true : false,
227 CefViewCToCpp::Wrap(child));
228 }
229
230 void CEF_CALLBACK
textfield_delegate_on_window_changed(struct _cef_view_delegate_t * self,cef_view_t * view,int added)231 textfield_delegate_on_window_changed(struct _cef_view_delegate_t* self,
232 cef_view_t* view,
233 int added) {
234 shutdown_checker::AssertNotShutdown();
235
236 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
237
238 DCHECK(self);
239 if (!self)
240 return;
241 // Verify param: view; type: refptr_diff
242 DCHECK(view);
243 if (!view)
244 return;
245
246 // Execute
247 CefTextfieldDelegateCppToC::Get(
248 reinterpret_cast<cef_textfield_delegate_t*>(self))
249 ->OnWindowChanged(CefViewCToCpp::Wrap(view), added ? true : false);
250 }
251
textfield_delegate_on_focus(struct _cef_view_delegate_t * self,cef_view_t * view)252 void CEF_CALLBACK textfield_delegate_on_focus(struct _cef_view_delegate_t* self,
253 cef_view_t* view) {
254 shutdown_checker::AssertNotShutdown();
255
256 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
257
258 DCHECK(self);
259 if (!self)
260 return;
261 // Verify param: view; type: refptr_diff
262 DCHECK(view);
263 if (!view)
264 return;
265
266 // Execute
267 CefTextfieldDelegateCppToC::Get(
268 reinterpret_cast<cef_textfield_delegate_t*>(self))
269 ->OnFocus(CefViewCToCpp::Wrap(view));
270 }
271
textfield_delegate_on_blur(struct _cef_view_delegate_t * self,cef_view_t * view)272 void CEF_CALLBACK textfield_delegate_on_blur(struct _cef_view_delegate_t* self,
273 cef_view_t* view) {
274 shutdown_checker::AssertNotShutdown();
275
276 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
277
278 DCHECK(self);
279 if (!self)
280 return;
281 // Verify param: view; type: refptr_diff
282 DCHECK(view);
283 if (!view)
284 return;
285
286 // Execute
287 CefTextfieldDelegateCppToC::Get(
288 reinterpret_cast<cef_textfield_delegate_t*>(self))
289 ->OnBlur(CefViewCToCpp::Wrap(view));
290 }
291
292 } // namespace
293
294 // CONSTRUCTOR - Do not edit by hand.
295
CefTextfieldDelegateCppToC()296 CefTextfieldDelegateCppToC::CefTextfieldDelegateCppToC() {
297 GetStruct()->on_key_event = textfield_delegate_on_key_event;
298 GetStruct()->on_after_user_action = textfield_delegate_on_after_user_action;
299 GetStruct()->base.get_preferred_size = textfield_delegate_get_preferred_size;
300 GetStruct()->base.get_minimum_size = textfield_delegate_get_minimum_size;
301 GetStruct()->base.get_maximum_size = textfield_delegate_get_maximum_size;
302 GetStruct()->base.get_height_for_width =
303 textfield_delegate_get_height_for_width;
304 GetStruct()->base.on_parent_view_changed =
305 textfield_delegate_on_parent_view_changed;
306 GetStruct()->base.on_child_view_changed =
307 textfield_delegate_on_child_view_changed;
308 GetStruct()->base.on_window_changed = textfield_delegate_on_window_changed;
309 GetStruct()->base.on_focus = textfield_delegate_on_focus;
310 GetStruct()->base.on_blur = textfield_delegate_on_blur;
311 }
312
313 // DESTRUCTOR - Do not edit by hand.
314
~CefTextfieldDelegateCppToC()315 CefTextfieldDelegateCppToC::~CefTextfieldDelegateCppToC() {
316 shutdown_checker::AssertNotShutdown();
317 }
318
319 template <>
320 CefRefPtr<CefTextfieldDelegate> CefCppToCRefCounted<
321 CefTextfieldDelegateCppToC,
322 CefTextfieldDelegate,
UnwrapDerived(CefWrapperType type,cef_textfield_delegate_t * s)323 cef_textfield_delegate_t>::UnwrapDerived(CefWrapperType type,
324 cef_textfield_delegate_t* s) {
325 NOTREACHED() << "Unexpected class type: " << type;
326 return nullptr;
327 }
328
329 template <>
330 CefWrapperType CefCppToCRefCounted<CefTextfieldDelegateCppToC,
331 CefTextfieldDelegate,
332 cef_textfield_delegate_t>::kWrapperType =
333 WT_TEXTFIELD_DELEGATE;
334