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=dee9e45990bc87669285dae6b0f78782e15bdbc0$
13 //
14
15 #include "libcef_dll/ctocpp/domnode_ctocpp.h"
16 #include "libcef_dll/ctocpp/domdocument_ctocpp.h"
17 #include "libcef_dll/shutdown_checker.h"
18 #include "libcef_dll/transfer_util.h"
19
20 // VIRTUAL METHODS - Body may be edited by hand.
21
GetType()22 NO_SANITIZE("cfi-icall") CefDOMNode::Type CefDOMNodeCToCpp::GetType() {
23 shutdown_checker::AssertNotShutdown();
24
25 cef_domnode_t* _struct = GetStruct();
26 if (CEF_MEMBER_MISSING(_struct, get_type))
27 return DOM_NODE_TYPE_UNSUPPORTED;
28
29 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
30
31 // Execute
32 cef_dom_node_type_t _retval = _struct->get_type(_struct);
33
34 // Return type: simple
35 return _retval;
36 }
37
IsText()38 NO_SANITIZE("cfi-icall") bool CefDOMNodeCToCpp::IsText() {
39 shutdown_checker::AssertNotShutdown();
40
41 cef_domnode_t* _struct = GetStruct();
42 if (CEF_MEMBER_MISSING(_struct, is_text))
43 return false;
44
45 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
46
47 // Execute
48 int _retval = _struct->is_text(_struct);
49
50 // Return type: bool
51 return _retval ? true : false;
52 }
53
IsElement()54 NO_SANITIZE("cfi-icall") bool CefDOMNodeCToCpp::IsElement() {
55 shutdown_checker::AssertNotShutdown();
56
57 cef_domnode_t* _struct = GetStruct();
58 if (CEF_MEMBER_MISSING(_struct, is_element))
59 return false;
60
61 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
62
63 // Execute
64 int _retval = _struct->is_element(_struct);
65
66 // Return type: bool
67 return _retval ? true : false;
68 }
69
IsEditable()70 NO_SANITIZE("cfi-icall") bool CefDOMNodeCToCpp::IsEditable() {
71 shutdown_checker::AssertNotShutdown();
72
73 cef_domnode_t* _struct = GetStruct();
74 if (CEF_MEMBER_MISSING(_struct, is_editable))
75 return false;
76
77 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
78
79 // Execute
80 int _retval = _struct->is_editable(_struct);
81
82 // Return type: bool
83 return _retval ? true : false;
84 }
85
IsFormControlElement()86 NO_SANITIZE("cfi-icall") bool CefDOMNodeCToCpp::IsFormControlElement() {
87 shutdown_checker::AssertNotShutdown();
88
89 cef_domnode_t* _struct = GetStruct();
90 if (CEF_MEMBER_MISSING(_struct, is_form_control_element))
91 return false;
92
93 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
94
95 // Execute
96 int _retval = _struct->is_form_control_element(_struct);
97
98 // Return type: bool
99 return _retval ? true : false;
100 }
101
102 NO_SANITIZE("cfi-icall")
GetFormControlElementType()103 CefString CefDOMNodeCToCpp::GetFormControlElementType() {
104 shutdown_checker::AssertNotShutdown();
105
106 cef_domnode_t* _struct = GetStruct();
107 if (CEF_MEMBER_MISSING(_struct, get_form_control_element_type))
108 return CefString();
109
110 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
111
112 // Execute
113 cef_string_userfree_t _retval =
114 _struct->get_form_control_element_type(_struct);
115
116 // Return type: string
117 CefString _retvalStr;
118 _retvalStr.AttachToUserFree(_retval);
119 return _retvalStr;
120 }
121
122 NO_SANITIZE("cfi-icall")
IsSame(CefRefPtr<CefDOMNode> that)123 bool CefDOMNodeCToCpp::IsSame(CefRefPtr<CefDOMNode> that) {
124 shutdown_checker::AssertNotShutdown();
125
126 cef_domnode_t* _struct = GetStruct();
127 if (CEF_MEMBER_MISSING(_struct, is_same))
128 return false;
129
130 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
131
132 // Verify param: that; type: refptr_same
133 DCHECK(that.get());
134 if (!that.get())
135 return false;
136
137 // Execute
138 int _retval = _struct->is_same(_struct, CefDOMNodeCToCpp::Unwrap(that));
139
140 // Return type: bool
141 return _retval ? true : false;
142 }
143
GetName()144 NO_SANITIZE("cfi-icall") CefString CefDOMNodeCToCpp::GetName() {
145 shutdown_checker::AssertNotShutdown();
146
147 cef_domnode_t* _struct = GetStruct();
148 if (CEF_MEMBER_MISSING(_struct, get_name))
149 return CefString();
150
151 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
152
153 // Execute
154 cef_string_userfree_t _retval = _struct->get_name(_struct);
155
156 // Return type: string
157 CefString _retvalStr;
158 _retvalStr.AttachToUserFree(_retval);
159 return _retvalStr;
160 }
161
GetValue()162 NO_SANITIZE("cfi-icall") CefString CefDOMNodeCToCpp::GetValue() {
163 shutdown_checker::AssertNotShutdown();
164
165 cef_domnode_t* _struct = GetStruct();
166 if (CEF_MEMBER_MISSING(_struct, get_value))
167 return CefString();
168
169 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
170
171 // Execute
172 cef_string_userfree_t _retval = _struct->get_value(_struct);
173
174 // Return type: string
175 CefString _retvalStr;
176 _retvalStr.AttachToUserFree(_retval);
177 return _retvalStr;
178 }
179
180 NO_SANITIZE("cfi-icall")
SetValue(const CefString & value)181 bool CefDOMNodeCToCpp::SetValue(const CefString& value) {
182 shutdown_checker::AssertNotShutdown();
183
184 cef_domnode_t* _struct = GetStruct();
185 if (CEF_MEMBER_MISSING(_struct, set_value))
186 return false;
187
188 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
189
190 // Verify param: value; type: string_byref_const
191 DCHECK(!value.empty());
192 if (value.empty())
193 return false;
194
195 // Execute
196 int _retval = _struct->set_value(_struct, value.GetStruct());
197
198 // Return type: bool
199 return _retval ? true : false;
200 }
201
GetAsMarkup()202 NO_SANITIZE("cfi-icall") CefString CefDOMNodeCToCpp::GetAsMarkup() {
203 shutdown_checker::AssertNotShutdown();
204
205 cef_domnode_t* _struct = GetStruct();
206 if (CEF_MEMBER_MISSING(_struct, get_as_markup))
207 return CefString();
208
209 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
210
211 // Execute
212 cef_string_userfree_t _retval = _struct->get_as_markup(_struct);
213
214 // Return type: string
215 CefString _retvalStr;
216 _retvalStr.AttachToUserFree(_retval);
217 return _retvalStr;
218 }
219
220 NO_SANITIZE("cfi-icall")
GetDocument()221 CefRefPtr<CefDOMDocument> CefDOMNodeCToCpp::GetDocument() {
222 shutdown_checker::AssertNotShutdown();
223
224 cef_domnode_t* _struct = GetStruct();
225 if (CEF_MEMBER_MISSING(_struct, get_document))
226 return nullptr;
227
228 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
229
230 // Execute
231 cef_domdocument_t* _retval = _struct->get_document(_struct);
232
233 // Return type: refptr_same
234 return CefDOMDocumentCToCpp::Wrap(_retval);
235 }
236
GetParent()237 NO_SANITIZE("cfi-icall") CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetParent() {
238 shutdown_checker::AssertNotShutdown();
239
240 cef_domnode_t* _struct = GetStruct();
241 if (CEF_MEMBER_MISSING(_struct, get_parent))
242 return nullptr;
243
244 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
245
246 // Execute
247 cef_domnode_t* _retval = _struct->get_parent(_struct);
248
249 // Return type: refptr_same
250 return CefDOMNodeCToCpp::Wrap(_retval);
251 }
252
253 NO_SANITIZE("cfi-icall")
GetPreviousSibling()254 CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetPreviousSibling() {
255 shutdown_checker::AssertNotShutdown();
256
257 cef_domnode_t* _struct = GetStruct();
258 if (CEF_MEMBER_MISSING(_struct, get_previous_sibling))
259 return nullptr;
260
261 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
262
263 // Execute
264 cef_domnode_t* _retval = _struct->get_previous_sibling(_struct);
265
266 // Return type: refptr_same
267 return CefDOMNodeCToCpp::Wrap(_retval);
268 }
269
270 NO_SANITIZE("cfi-icall")
GetNextSibling()271 CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetNextSibling() {
272 shutdown_checker::AssertNotShutdown();
273
274 cef_domnode_t* _struct = GetStruct();
275 if (CEF_MEMBER_MISSING(_struct, get_next_sibling))
276 return nullptr;
277
278 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
279
280 // Execute
281 cef_domnode_t* _retval = _struct->get_next_sibling(_struct);
282
283 // Return type: refptr_same
284 return CefDOMNodeCToCpp::Wrap(_retval);
285 }
286
HasChildren()287 NO_SANITIZE("cfi-icall") bool CefDOMNodeCToCpp::HasChildren() {
288 shutdown_checker::AssertNotShutdown();
289
290 cef_domnode_t* _struct = GetStruct();
291 if (CEF_MEMBER_MISSING(_struct, has_children))
292 return false;
293
294 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
295
296 // Execute
297 int _retval = _struct->has_children(_struct);
298
299 // Return type: bool
300 return _retval ? true : false;
301 }
302
303 NO_SANITIZE("cfi-icall")
GetFirstChild()304 CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetFirstChild() {
305 shutdown_checker::AssertNotShutdown();
306
307 cef_domnode_t* _struct = GetStruct();
308 if (CEF_MEMBER_MISSING(_struct, get_first_child))
309 return nullptr;
310
311 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
312
313 // Execute
314 cef_domnode_t* _retval = _struct->get_first_child(_struct);
315
316 // Return type: refptr_same
317 return CefDOMNodeCToCpp::Wrap(_retval);
318 }
319
320 NO_SANITIZE("cfi-icall")
GetLastChild()321 CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetLastChild() {
322 shutdown_checker::AssertNotShutdown();
323
324 cef_domnode_t* _struct = GetStruct();
325 if (CEF_MEMBER_MISSING(_struct, get_last_child))
326 return nullptr;
327
328 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
329
330 // Execute
331 cef_domnode_t* _retval = _struct->get_last_child(_struct);
332
333 // Return type: refptr_same
334 return CefDOMNodeCToCpp::Wrap(_retval);
335 }
336
GetElementTagName()337 NO_SANITIZE("cfi-icall") CefString CefDOMNodeCToCpp::GetElementTagName() {
338 shutdown_checker::AssertNotShutdown();
339
340 cef_domnode_t* _struct = GetStruct();
341 if (CEF_MEMBER_MISSING(_struct, get_element_tag_name))
342 return CefString();
343
344 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
345
346 // Execute
347 cef_string_userfree_t _retval = _struct->get_element_tag_name(_struct);
348
349 // Return type: string
350 CefString _retvalStr;
351 _retvalStr.AttachToUserFree(_retval);
352 return _retvalStr;
353 }
354
HasElementAttributes()355 NO_SANITIZE("cfi-icall") bool CefDOMNodeCToCpp::HasElementAttributes() {
356 shutdown_checker::AssertNotShutdown();
357
358 cef_domnode_t* _struct = GetStruct();
359 if (CEF_MEMBER_MISSING(_struct, has_element_attributes))
360 return false;
361
362 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
363
364 // Execute
365 int _retval = _struct->has_element_attributes(_struct);
366
367 // Return type: bool
368 return _retval ? true : false;
369 }
370
371 NO_SANITIZE("cfi-icall")
HasElementAttribute(const CefString & attrName)372 bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) {
373 shutdown_checker::AssertNotShutdown();
374
375 cef_domnode_t* _struct = GetStruct();
376 if (CEF_MEMBER_MISSING(_struct, has_element_attribute))
377 return false;
378
379 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
380
381 // Verify param: attrName; type: string_byref_const
382 DCHECK(!attrName.empty());
383 if (attrName.empty())
384 return false;
385
386 // Execute
387 int _retval = _struct->has_element_attribute(_struct, attrName.GetStruct());
388
389 // Return type: bool
390 return _retval ? true : false;
391 }
392
393 NO_SANITIZE("cfi-icall")
GetElementAttribute(const CefString & attrName)394 CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) {
395 shutdown_checker::AssertNotShutdown();
396
397 cef_domnode_t* _struct = GetStruct();
398 if (CEF_MEMBER_MISSING(_struct, get_element_attribute))
399 return CefString();
400
401 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
402
403 // Verify param: attrName; type: string_byref_const
404 DCHECK(!attrName.empty());
405 if (attrName.empty())
406 return CefString();
407
408 // Execute
409 cef_string_userfree_t _retval =
410 _struct->get_element_attribute(_struct, attrName.GetStruct());
411
412 // Return type: string
413 CefString _retvalStr;
414 _retvalStr.AttachToUserFree(_retval);
415 return _retvalStr;
416 }
417
418 NO_SANITIZE("cfi-icall")
GetElementAttributes(AttributeMap & attrMap)419 void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) {
420 shutdown_checker::AssertNotShutdown();
421
422 cef_domnode_t* _struct = GetStruct();
423 if (CEF_MEMBER_MISSING(_struct, get_element_attributes))
424 return;
425
426 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
427
428 // Translate param: attrMap; type: string_map_single_byref
429 cef_string_map_t attrMapMap = cef_string_map_alloc();
430 DCHECK(attrMapMap);
431 if (attrMapMap)
432 transfer_string_map_contents(attrMap, attrMapMap);
433
434 // Execute
435 _struct->get_element_attributes(_struct, attrMapMap);
436
437 // Restore param:attrMap; type: string_map_single_byref
438 if (attrMapMap) {
439 attrMap.clear();
440 transfer_string_map_contents(attrMapMap, attrMap);
441 cef_string_map_free(attrMapMap);
442 }
443 }
444
445 NO_SANITIZE("cfi-icall")
SetElementAttribute(const CefString & attrName,const CefString & value)446 bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName,
447 const CefString& value) {
448 shutdown_checker::AssertNotShutdown();
449
450 cef_domnode_t* _struct = GetStruct();
451 if (CEF_MEMBER_MISSING(_struct, set_element_attribute))
452 return false;
453
454 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
455
456 // Verify param: attrName; type: string_byref_const
457 DCHECK(!attrName.empty());
458 if (attrName.empty())
459 return false;
460 // Verify param: value; type: string_byref_const
461 DCHECK(!value.empty());
462 if (value.empty())
463 return false;
464
465 // Execute
466 int _retval = _struct->set_element_attribute(_struct, attrName.GetStruct(),
467 value.GetStruct());
468
469 // Return type: bool
470 return _retval ? true : false;
471 }
472
GetElementInnerText()473 NO_SANITIZE("cfi-icall") CefString CefDOMNodeCToCpp::GetElementInnerText() {
474 shutdown_checker::AssertNotShutdown();
475
476 cef_domnode_t* _struct = GetStruct();
477 if (CEF_MEMBER_MISSING(_struct, get_element_inner_text))
478 return CefString();
479
480 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
481
482 // Execute
483 cef_string_userfree_t _retval = _struct->get_element_inner_text(_struct);
484
485 // Return type: string
486 CefString _retvalStr;
487 _retvalStr.AttachToUserFree(_retval);
488 return _retvalStr;
489 }
490
GetElementBounds()491 NO_SANITIZE("cfi-icall") CefRect CefDOMNodeCToCpp::GetElementBounds() {
492 shutdown_checker::AssertNotShutdown();
493
494 cef_domnode_t* _struct = GetStruct();
495 if (CEF_MEMBER_MISSING(_struct, get_element_bounds))
496 return CefRect();
497
498 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
499
500 // Execute
501 cef_rect_t _retval = _struct->get_element_bounds(_struct);
502
503 // Return type: simple
504 return _retval;
505 }
506
507 // CONSTRUCTOR - Do not edit by hand.
508
CefDOMNodeCToCpp()509 CefDOMNodeCToCpp::CefDOMNodeCToCpp() {}
510
511 // DESTRUCTOR - Do not edit by hand.
512
~CefDOMNodeCToCpp()513 CefDOMNodeCToCpp::~CefDOMNodeCToCpp() {
514 shutdown_checker::AssertNotShutdown();
515 }
516
517 template <>
518 cef_domnode_t*
UnwrapDerived(CefWrapperType type,CefDOMNode * c)519 CefCToCppRefCounted<CefDOMNodeCToCpp, CefDOMNode, cef_domnode_t>::UnwrapDerived(
520 CefWrapperType type,
521 CefDOMNode* c) {
522 NOTREACHED() << "Unexpected class type: " << type;
523 return nullptr;
524 }
525
526 template <>
527 CefWrapperType CefCToCppRefCounted<CefDOMNodeCToCpp,
528 CefDOMNode,
529 cef_domnode_t>::kWrapperType = WT_DOMNODE;
530