1 // Copyright (c) 2022 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=e5f17a1d61c8211bcf16be848e8aaf48934c5b0c$
13 //
14
15 #include "libcef_dll/ctocpp/domdocument_ctocpp.h"
16 #include "libcef_dll/ctocpp/domnode_ctocpp.h"
17 #include "libcef_dll/shutdown_checker.h"
18
19 // VIRTUAL METHODS - Body may be edited by hand.
20
GetType()21 NO_SANITIZE("cfi-icall") CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() {
22 shutdown_checker::AssertNotShutdown();
23
24 cef_domdocument_t* _struct = GetStruct();
25 if (CEF_MEMBER_MISSING(_struct, get_type))
26 return DOM_DOCUMENT_TYPE_UNKNOWN;
27
28 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
29
30 // Execute
31 cef_dom_document_type_t _retval = _struct->get_type(_struct);
32
33 // Return type: simple
34 return _retval;
35 }
36
37 NO_SANITIZE("cfi-icall")
GetDocument()38 CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetDocument() {
39 shutdown_checker::AssertNotShutdown();
40
41 cef_domdocument_t* _struct = GetStruct();
42 if (CEF_MEMBER_MISSING(_struct, get_document))
43 return nullptr;
44
45 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
46
47 // Execute
48 cef_domnode_t* _retval = _struct->get_document(_struct);
49
50 // Return type: refptr_same
51 return CefDOMNodeCToCpp::Wrap(_retval);
52 }
53
GetBody()54 NO_SANITIZE("cfi-icall") CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetBody() {
55 shutdown_checker::AssertNotShutdown();
56
57 cef_domdocument_t* _struct = GetStruct();
58 if (CEF_MEMBER_MISSING(_struct, get_body))
59 return nullptr;
60
61 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
62
63 // Execute
64 cef_domnode_t* _retval = _struct->get_body(_struct);
65
66 // Return type: refptr_same
67 return CefDOMNodeCToCpp::Wrap(_retval);
68 }
69
GetHead()70 NO_SANITIZE("cfi-icall") CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetHead() {
71 shutdown_checker::AssertNotShutdown();
72
73 cef_domdocument_t* _struct = GetStruct();
74 if (CEF_MEMBER_MISSING(_struct, get_head))
75 return nullptr;
76
77 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
78
79 // Execute
80 cef_domnode_t* _retval = _struct->get_head(_struct);
81
82 // Return type: refptr_same
83 return CefDOMNodeCToCpp::Wrap(_retval);
84 }
85
GetTitle()86 NO_SANITIZE("cfi-icall") CefString CefDOMDocumentCToCpp::GetTitle() {
87 shutdown_checker::AssertNotShutdown();
88
89 cef_domdocument_t* _struct = GetStruct();
90 if (CEF_MEMBER_MISSING(_struct, get_title))
91 return CefString();
92
93 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
94
95 // Execute
96 cef_string_userfree_t _retval = _struct->get_title(_struct);
97
98 // Return type: string
99 CefString _retvalStr;
100 _retvalStr.AttachToUserFree(_retval);
101 return _retvalStr;
102 }
103
104 NO_SANITIZE("cfi-icall")
GetElementById(const CefString & id)105 CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetElementById(
106 const CefString& id) {
107 shutdown_checker::AssertNotShutdown();
108
109 cef_domdocument_t* _struct = GetStruct();
110 if (CEF_MEMBER_MISSING(_struct, get_element_by_id))
111 return nullptr;
112
113 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
114
115 // Verify param: id; type: string_byref_const
116 DCHECK(!id.empty());
117 if (id.empty())
118 return nullptr;
119
120 // Execute
121 cef_domnode_t* _retval = _struct->get_element_by_id(_struct, id.GetStruct());
122
123 // Return type: refptr_same
124 return CefDOMNodeCToCpp::Wrap(_retval);
125 }
126
127 NO_SANITIZE("cfi-icall")
GetFocusedNode()128 CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetFocusedNode() {
129 shutdown_checker::AssertNotShutdown();
130
131 cef_domdocument_t* _struct = GetStruct();
132 if (CEF_MEMBER_MISSING(_struct, get_focused_node))
133 return nullptr;
134
135 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
136
137 // Execute
138 cef_domnode_t* _retval = _struct->get_focused_node(_struct);
139
140 // Return type: refptr_same
141 return CefDOMNodeCToCpp::Wrap(_retval);
142 }
143
HasSelection()144 NO_SANITIZE("cfi-icall") bool CefDOMDocumentCToCpp::HasSelection() {
145 shutdown_checker::AssertNotShutdown();
146
147 cef_domdocument_t* _struct = GetStruct();
148 if (CEF_MEMBER_MISSING(_struct, has_selection))
149 return false;
150
151 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
152
153 // Execute
154 int _retval = _struct->has_selection(_struct);
155
156 // Return type: bool
157 return _retval ? true : false;
158 }
159
GetSelectionStartOffset()160 NO_SANITIZE("cfi-icall") int CefDOMDocumentCToCpp::GetSelectionStartOffset() {
161 shutdown_checker::AssertNotShutdown();
162
163 cef_domdocument_t* _struct = GetStruct();
164 if (CEF_MEMBER_MISSING(_struct, get_selection_start_offset))
165 return 0;
166
167 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
168
169 // Execute
170 int _retval = _struct->get_selection_start_offset(_struct);
171
172 // Return type: simple
173 return _retval;
174 }
175
GetSelectionEndOffset()176 NO_SANITIZE("cfi-icall") int CefDOMDocumentCToCpp::GetSelectionEndOffset() {
177 shutdown_checker::AssertNotShutdown();
178
179 cef_domdocument_t* _struct = GetStruct();
180 if (CEF_MEMBER_MISSING(_struct, get_selection_end_offset))
181 return 0;
182
183 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
184
185 // Execute
186 int _retval = _struct->get_selection_end_offset(_struct);
187
188 // Return type: simple
189 return _retval;
190 }
191
192 NO_SANITIZE("cfi-icall")
GetSelectionAsMarkup()193 CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() {
194 shutdown_checker::AssertNotShutdown();
195
196 cef_domdocument_t* _struct = GetStruct();
197 if (CEF_MEMBER_MISSING(_struct, get_selection_as_markup))
198 return CefString();
199
200 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
201
202 // Execute
203 cef_string_userfree_t _retval = _struct->get_selection_as_markup(_struct);
204
205 // Return type: string
206 CefString _retvalStr;
207 _retvalStr.AttachToUserFree(_retval);
208 return _retvalStr;
209 }
210
GetSelectionAsText()211 NO_SANITIZE("cfi-icall") CefString CefDOMDocumentCToCpp::GetSelectionAsText() {
212 shutdown_checker::AssertNotShutdown();
213
214 cef_domdocument_t* _struct = GetStruct();
215 if (CEF_MEMBER_MISSING(_struct, get_selection_as_text))
216 return CefString();
217
218 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
219
220 // Execute
221 cef_string_userfree_t _retval = _struct->get_selection_as_text(_struct);
222
223 // Return type: string
224 CefString _retvalStr;
225 _retvalStr.AttachToUserFree(_retval);
226 return _retvalStr;
227 }
228
GetBaseURL()229 NO_SANITIZE("cfi-icall") CefString CefDOMDocumentCToCpp::GetBaseURL() {
230 shutdown_checker::AssertNotShutdown();
231
232 cef_domdocument_t* _struct = GetStruct();
233 if (CEF_MEMBER_MISSING(_struct, get_base_url))
234 return CefString();
235
236 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
237
238 // Execute
239 cef_string_userfree_t _retval = _struct->get_base_url(_struct);
240
241 // Return type: string
242 CefString _retvalStr;
243 _retvalStr.AttachToUserFree(_retval);
244 return _retvalStr;
245 }
246
247 NO_SANITIZE("cfi-icall")
GetCompleteURL(const CefString & partialURL)248 CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) {
249 shutdown_checker::AssertNotShutdown();
250
251 cef_domdocument_t* _struct = GetStruct();
252 if (CEF_MEMBER_MISSING(_struct, get_complete_url))
253 return CefString();
254
255 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
256
257 // Verify param: partialURL; type: string_byref_const
258 DCHECK(!partialURL.empty());
259 if (partialURL.empty())
260 return CefString();
261
262 // Execute
263 cef_string_userfree_t _retval =
264 _struct->get_complete_url(_struct, partialURL.GetStruct());
265
266 // Return type: string
267 CefString _retvalStr;
268 _retvalStr.AttachToUserFree(_retval);
269 return _retvalStr;
270 }
271
272 // CONSTRUCTOR - Do not edit by hand.
273
CefDOMDocumentCToCpp()274 CefDOMDocumentCToCpp::CefDOMDocumentCToCpp() {}
275
276 // DESTRUCTOR - Do not edit by hand.
277
~CefDOMDocumentCToCpp()278 CefDOMDocumentCToCpp::~CefDOMDocumentCToCpp() {
279 shutdown_checker::AssertNotShutdown();
280 }
281
282 template <>
283 cef_domdocument_t*
284 CefCToCppRefCounted<CefDOMDocumentCToCpp, CefDOMDocument, cef_domdocument_t>::
UnwrapDerived(CefWrapperType type,CefDOMDocument * c)285 UnwrapDerived(CefWrapperType type, CefDOMDocument* c) {
286 NOTREACHED() << "Unexpected class type: " << type;
287 return nullptr;
288 }
289
290 template <>
291 CefWrapperType CefCToCppRefCounted<CefDOMDocumentCToCpp,
292 CefDOMDocument,
293 cef_domdocument_t>::kWrapperType =
294 WT_DOMDOCUMENT;
295