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=8582eda62f90bab166d04bb6a2f8783a98fabe15$
13 //
14
15 #include "libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h"
16 #include "libcef_dll/cpptoc/views/textfield_cpptoc.h"
17 #include "libcef_dll/cpptoc/views/view_cpptoc.h"
18 #include "libcef_dll/shutdown_checker.h"
19
20 // VIRTUAL METHODS - Body may be edited by hand.
21
22 NO_SANITIZE("cfi-icall")
OnKeyEvent(CefRefPtr<CefTextfield> textfield,const CefKeyEvent & event)23 bool CefTextfieldDelegateCToCpp::OnKeyEvent(CefRefPtr<CefTextfield> textfield,
24 const CefKeyEvent& event) {
25 shutdown_checker::AssertNotShutdown();
26
27 cef_textfield_delegate_t* _struct = GetStruct();
28 if (CEF_MEMBER_MISSING(_struct, on_key_event))
29 return false;
30
31 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
32
33 // Verify param: textfield; type: refptr_diff
34 DCHECK(textfield.get());
35 if (!textfield.get())
36 return false;
37
38 // Execute
39 int _retval = _struct->on_key_event(
40 _struct, CefTextfieldCppToC::Wrap(textfield), &event);
41
42 // Return type: bool
43 return _retval ? true : false;
44 }
45
46 NO_SANITIZE("cfi-icall")
OnAfterUserAction(CefRefPtr<CefTextfield> textfield)47 void CefTextfieldDelegateCToCpp::OnAfterUserAction(
48 CefRefPtr<CefTextfield> textfield) {
49 shutdown_checker::AssertNotShutdown();
50
51 cef_textfield_delegate_t* _struct = GetStruct();
52 if (CEF_MEMBER_MISSING(_struct, on_after_user_action))
53 return;
54
55 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
56
57 // Verify param: textfield; type: refptr_diff
58 DCHECK(textfield.get());
59 if (!textfield.get())
60 return;
61
62 // Execute
63 _struct->on_after_user_action(_struct, CefTextfieldCppToC::Wrap(textfield));
64 }
65
66 NO_SANITIZE("cfi-icall")
GetPreferredSize(CefRefPtr<CefView> view)67 CefSize CefTextfieldDelegateCToCpp::GetPreferredSize(CefRefPtr<CefView> view) {
68 shutdown_checker::AssertNotShutdown();
69
70 cef_view_delegate_t* _struct =
71 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
72 if (CEF_MEMBER_MISSING(_struct, get_preferred_size))
73 return CefSize();
74
75 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
76
77 // Verify param: view; type: refptr_diff
78 DCHECK(view.get());
79 if (!view.get())
80 return CefSize();
81
82 // Execute
83 cef_size_t _retval =
84 _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view));
85
86 // Return type: simple
87 return _retval;
88 }
89
90 NO_SANITIZE("cfi-icall")
GetMinimumSize(CefRefPtr<CefView> view)91 CefSize CefTextfieldDelegateCToCpp::GetMinimumSize(CefRefPtr<CefView> view) {
92 shutdown_checker::AssertNotShutdown();
93
94 cef_view_delegate_t* _struct =
95 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
96 if (CEF_MEMBER_MISSING(_struct, get_minimum_size))
97 return CefSize();
98
99 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
100
101 // Verify param: view; type: refptr_diff
102 DCHECK(view.get());
103 if (!view.get())
104 return CefSize();
105
106 // Execute
107 cef_size_t _retval =
108 _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view));
109
110 // Return type: simple
111 return _retval;
112 }
113
114 NO_SANITIZE("cfi-icall")
GetMaximumSize(CefRefPtr<CefView> view)115 CefSize CefTextfieldDelegateCToCpp::GetMaximumSize(CefRefPtr<CefView> view) {
116 shutdown_checker::AssertNotShutdown();
117
118 cef_view_delegate_t* _struct =
119 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
120 if (CEF_MEMBER_MISSING(_struct, get_maximum_size))
121 return CefSize();
122
123 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
124
125 // Verify param: view; type: refptr_diff
126 DCHECK(view.get());
127 if (!view.get())
128 return CefSize();
129
130 // Execute
131 cef_size_t _retval =
132 _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view));
133
134 // Return type: simple
135 return _retval;
136 }
137
138 NO_SANITIZE("cfi-icall")
GetHeightForWidth(CefRefPtr<CefView> view,int width)139 int CefTextfieldDelegateCToCpp::GetHeightForWidth(CefRefPtr<CefView> view,
140 int width) {
141 shutdown_checker::AssertNotShutdown();
142
143 cef_view_delegate_t* _struct =
144 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
145 if (CEF_MEMBER_MISSING(_struct, get_height_for_width))
146 return 0;
147
148 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
149
150 // Verify param: view; type: refptr_diff
151 DCHECK(view.get());
152 if (!view.get())
153 return 0;
154
155 // Execute
156 int _retval =
157 _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width);
158
159 // Return type: simple
160 return _retval;
161 }
162
163 NO_SANITIZE("cfi-icall")
OnParentViewChanged(CefRefPtr<CefView> view,bool added,CefRefPtr<CefView> parent)164 void CefTextfieldDelegateCToCpp::OnParentViewChanged(
165 CefRefPtr<CefView> view,
166 bool added,
167 CefRefPtr<CefView> parent) {
168 shutdown_checker::AssertNotShutdown();
169
170 cef_view_delegate_t* _struct =
171 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
172 if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed))
173 return;
174
175 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
176
177 // Verify param: view; type: refptr_diff
178 DCHECK(view.get());
179 if (!view.get())
180 return;
181 // Verify param: parent; type: refptr_diff
182 DCHECK(parent.get());
183 if (!parent.get())
184 return;
185
186 // Execute
187 _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added,
188 CefViewCppToC::Wrap(parent));
189 }
190
191 NO_SANITIZE("cfi-icall")
OnChildViewChanged(CefRefPtr<CefView> view,bool added,CefRefPtr<CefView> child)192 void CefTextfieldDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
193 bool added,
194 CefRefPtr<CefView> child) {
195 shutdown_checker::AssertNotShutdown();
196
197 cef_view_delegate_t* _struct =
198 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
199 if (CEF_MEMBER_MISSING(_struct, on_child_view_changed))
200 return;
201
202 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
203
204 // Verify param: view; type: refptr_diff
205 DCHECK(view.get());
206 if (!view.get())
207 return;
208 // Verify param: child; type: refptr_diff
209 DCHECK(child.get());
210 if (!child.get())
211 return;
212
213 // Execute
214 _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added,
215 CefViewCppToC::Wrap(child));
216 }
217
218 NO_SANITIZE("cfi-icall")
OnWindowChanged(CefRefPtr<CefView> view,bool added)219 void CefTextfieldDelegateCToCpp::OnWindowChanged(CefRefPtr<CefView> view,
220 bool added) {
221 shutdown_checker::AssertNotShutdown();
222
223 cef_view_delegate_t* _struct =
224 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
225 if (CEF_MEMBER_MISSING(_struct, on_window_changed))
226 return;
227
228 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
229
230 // Verify param: view; type: refptr_diff
231 DCHECK(view.get());
232 if (!view.get())
233 return;
234
235 // Execute
236 _struct->on_window_changed(_struct, CefViewCppToC::Wrap(view), added);
237 }
238
239 NO_SANITIZE("cfi-icall")
OnFocus(CefRefPtr<CefView> view)240 void CefTextfieldDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
241 shutdown_checker::AssertNotShutdown();
242
243 cef_view_delegate_t* _struct =
244 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
245 if (CEF_MEMBER_MISSING(_struct, on_focus))
246 return;
247
248 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
249
250 // Verify param: view; type: refptr_diff
251 DCHECK(view.get());
252 if (!view.get())
253 return;
254
255 // Execute
256 _struct->on_focus(_struct, CefViewCppToC::Wrap(view));
257 }
258
259 NO_SANITIZE("cfi-icall")
OnBlur(CefRefPtr<CefView> view)260 void CefTextfieldDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
261 shutdown_checker::AssertNotShutdown();
262
263 cef_view_delegate_t* _struct =
264 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
265 if (CEF_MEMBER_MISSING(_struct, on_blur))
266 return;
267
268 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
269
270 // Verify param: view; type: refptr_diff
271 DCHECK(view.get());
272 if (!view.get())
273 return;
274
275 // Execute
276 _struct->on_blur(_struct, CefViewCppToC::Wrap(view));
277 }
278
279 // CONSTRUCTOR - Do not edit by hand.
280
CefTextfieldDelegateCToCpp()281 CefTextfieldDelegateCToCpp::CefTextfieldDelegateCToCpp() {}
282
283 // DESTRUCTOR - Do not edit by hand.
284
~CefTextfieldDelegateCToCpp()285 CefTextfieldDelegateCToCpp::~CefTextfieldDelegateCToCpp() {
286 shutdown_checker::AssertNotShutdown();
287 }
288
289 template <>
290 cef_textfield_delegate_t* CefCToCppRefCounted<
291 CefTextfieldDelegateCToCpp,
292 CefTextfieldDelegate,
UnwrapDerived(CefWrapperType type,CefTextfieldDelegate * c)293 cef_textfield_delegate_t>::UnwrapDerived(CefWrapperType type,
294 CefTextfieldDelegate* c) {
295 NOTREACHED() << "Unexpected class type: " << type;
296 return nullptr;
297 }
298
299 template <>
300 CefWrapperType CefCToCppRefCounted<CefTextfieldDelegateCToCpp,
301 CefTextfieldDelegate,
302 cef_textfield_delegate_t>::kWrapperType =
303 WT_TEXTFIELD_DELEGATE;
304