• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=57352ff85ca98fc34a0f2c58afbb1224ce1a1f09$
13 //
14 
15 #include "libcef_dll/ctocpp/drag_data_ctocpp.h"
16 #include "libcef_dll/ctocpp/image_ctocpp.h"
17 #include "libcef_dll/ctocpp/stream_writer_ctocpp.h"
18 #include "libcef_dll/shutdown_checker.h"
19 #include "libcef_dll/transfer_util.h"
20 
21 // STATIC METHODS - Body may be edited by hand.
22 
Create()23 NO_SANITIZE("cfi-icall") CefRefPtr<CefDragData> CefDragData::Create() {
24   shutdown_checker::AssertNotShutdown();
25 
26   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
27 
28   // Execute
29   cef_drag_data_t* _retval = cef_drag_data_create();
30 
31   // Return type: refptr_same
32   return CefDragDataCToCpp::Wrap(_retval);
33 }
34 
35 // VIRTUAL METHODS - Body may be edited by hand.
36 
Clone()37 NO_SANITIZE("cfi-icall") CefRefPtr<CefDragData> CefDragDataCToCpp::Clone() {
38   shutdown_checker::AssertNotShutdown();
39 
40   cef_drag_data_t* _struct = GetStruct();
41   if (CEF_MEMBER_MISSING(_struct, clone))
42     return nullptr;
43 
44   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
45 
46   // Execute
47   cef_drag_data_t* _retval = _struct->clone(_struct);
48 
49   // Return type: refptr_same
50   return CefDragDataCToCpp::Wrap(_retval);
51 }
52 
IsReadOnly()53 NO_SANITIZE("cfi-icall") bool CefDragDataCToCpp::IsReadOnly() {
54   shutdown_checker::AssertNotShutdown();
55 
56   cef_drag_data_t* _struct = GetStruct();
57   if (CEF_MEMBER_MISSING(_struct, is_read_only))
58     return false;
59 
60   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
61 
62   // Execute
63   int _retval = _struct->is_read_only(_struct);
64 
65   // Return type: bool
66   return _retval ? true : false;
67 }
68 
IsLink()69 NO_SANITIZE("cfi-icall") bool CefDragDataCToCpp::IsLink() {
70   shutdown_checker::AssertNotShutdown();
71 
72   cef_drag_data_t* _struct = GetStruct();
73   if (CEF_MEMBER_MISSING(_struct, is_link))
74     return false;
75 
76   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
77 
78   // Execute
79   int _retval = _struct->is_link(_struct);
80 
81   // Return type: bool
82   return _retval ? true : false;
83 }
84 
IsFragment()85 NO_SANITIZE("cfi-icall") bool CefDragDataCToCpp::IsFragment() {
86   shutdown_checker::AssertNotShutdown();
87 
88   cef_drag_data_t* _struct = GetStruct();
89   if (CEF_MEMBER_MISSING(_struct, is_fragment))
90     return false;
91 
92   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
93 
94   // Execute
95   int _retval = _struct->is_fragment(_struct);
96 
97   // Return type: bool
98   return _retval ? true : false;
99 }
100 
IsFile()101 NO_SANITIZE("cfi-icall") bool CefDragDataCToCpp::IsFile() {
102   shutdown_checker::AssertNotShutdown();
103 
104   cef_drag_data_t* _struct = GetStruct();
105   if (CEF_MEMBER_MISSING(_struct, is_file))
106     return false;
107 
108   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
109 
110   // Execute
111   int _retval = _struct->is_file(_struct);
112 
113   // Return type: bool
114   return _retval ? true : false;
115 }
116 
GetLinkURL()117 NO_SANITIZE("cfi-icall") CefString CefDragDataCToCpp::GetLinkURL() {
118   shutdown_checker::AssertNotShutdown();
119 
120   cef_drag_data_t* _struct = GetStruct();
121   if (CEF_MEMBER_MISSING(_struct, get_link_url))
122     return CefString();
123 
124   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
125 
126   // Execute
127   cef_string_userfree_t _retval = _struct->get_link_url(_struct);
128 
129   // Return type: string
130   CefString _retvalStr;
131   _retvalStr.AttachToUserFree(_retval);
132   return _retvalStr;
133 }
134 
GetLinkTitle()135 NO_SANITIZE("cfi-icall") CefString CefDragDataCToCpp::GetLinkTitle() {
136   shutdown_checker::AssertNotShutdown();
137 
138   cef_drag_data_t* _struct = GetStruct();
139   if (CEF_MEMBER_MISSING(_struct, get_link_title))
140     return CefString();
141 
142   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
143 
144   // Execute
145   cef_string_userfree_t _retval = _struct->get_link_title(_struct);
146 
147   // Return type: string
148   CefString _retvalStr;
149   _retvalStr.AttachToUserFree(_retval);
150   return _retvalStr;
151 }
152 
GetLinkMetadata()153 NO_SANITIZE("cfi-icall") CefString CefDragDataCToCpp::GetLinkMetadata() {
154   shutdown_checker::AssertNotShutdown();
155 
156   cef_drag_data_t* _struct = GetStruct();
157   if (CEF_MEMBER_MISSING(_struct, get_link_metadata))
158     return CefString();
159 
160   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
161 
162   // Execute
163   cef_string_userfree_t _retval = _struct->get_link_metadata(_struct);
164 
165   // Return type: string
166   CefString _retvalStr;
167   _retvalStr.AttachToUserFree(_retval);
168   return _retvalStr;
169 }
170 
GetFragmentText()171 NO_SANITIZE("cfi-icall") CefString CefDragDataCToCpp::GetFragmentText() {
172   shutdown_checker::AssertNotShutdown();
173 
174   cef_drag_data_t* _struct = GetStruct();
175   if (CEF_MEMBER_MISSING(_struct, get_fragment_text))
176     return CefString();
177 
178   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
179 
180   // Execute
181   cef_string_userfree_t _retval = _struct->get_fragment_text(_struct);
182 
183   // Return type: string
184   CefString _retvalStr;
185   _retvalStr.AttachToUserFree(_retval);
186   return _retvalStr;
187 }
188 
GetFragmentHtml()189 NO_SANITIZE("cfi-icall") CefString CefDragDataCToCpp::GetFragmentHtml() {
190   shutdown_checker::AssertNotShutdown();
191 
192   cef_drag_data_t* _struct = GetStruct();
193   if (CEF_MEMBER_MISSING(_struct, get_fragment_html))
194     return CefString();
195 
196   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
197 
198   // Execute
199   cef_string_userfree_t _retval = _struct->get_fragment_html(_struct);
200 
201   // Return type: string
202   CefString _retvalStr;
203   _retvalStr.AttachToUserFree(_retval);
204   return _retvalStr;
205 }
206 
GetFragmentBaseURL()207 NO_SANITIZE("cfi-icall") CefString CefDragDataCToCpp::GetFragmentBaseURL() {
208   shutdown_checker::AssertNotShutdown();
209 
210   cef_drag_data_t* _struct = GetStruct();
211   if (CEF_MEMBER_MISSING(_struct, get_fragment_base_url))
212     return CefString();
213 
214   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
215 
216   // Execute
217   cef_string_userfree_t _retval = _struct->get_fragment_base_url(_struct);
218 
219   // Return type: string
220   CefString _retvalStr;
221   _retvalStr.AttachToUserFree(_retval);
222   return _retvalStr;
223 }
224 
GetFileName()225 NO_SANITIZE("cfi-icall") CefString CefDragDataCToCpp::GetFileName() {
226   shutdown_checker::AssertNotShutdown();
227 
228   cef_drag_data_t* _struct = GetStruct();
229   if (CEF_MEMBER_MISSING(_struct, get_file_name))
230     return CefString();
231 
232   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
233 
234   // Execute
235   cef_string_userfree_t _retval = _struct->get_file_name(_struct);
236 
237   // Return type: string
238   CefString _retvalStr;
239   _retvalStr.AttachToUserFree(_retval);
240   return _retvalStr;
241 }
242 
243 NO_SANITIZE("cfi-icall")
GetFileContents(CefRefPtr<CefStreamWriter> writer)244 size_t CefDragDataCToCpp::GetFileContents(CefRefPtr<CefStreamWriter> writer) {
245   shutdown_checker::AssertNotShutdown();
246 
247   cef_drag_data_t* _struct = GetStruct();
248   if (CEF_MEMBER_MISSING(_struct, get_file_contents))
249     return 0;
250 
251   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
252 
253   // Unverified params: writer
254 
255   // Execute
256   size_t _retval = _struct->get_file_contents(
257       _struct, CefStreamWriterCToCpp::Unwrap(writer));
258 
259   // Return type: simple
260   return _retval;
261 }
262 
263 NO_SANITIZE("cfi-icall")
GetFileNames(std::vector<CefString> & names)264 bool CefDragDataCToCpp::GetFileNames(std::vector<CefString>& names) {
265   shutdown_checker::AssertNotShutdown();
266 
267   cef_drag_data_t* _struct = GetStruct();
268   if (CEF_MEMBER_MISSING(_struct, get_file_names))
269     return false;
270 
271   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
272 
273   // Translate param: names; type: string_vec_byref
274   cef_string_list_t namesList = cef_string_list_alloc();
275   DCHECK(namesList);
276   if (namesList)
277     transfer_string_list_contents(names, namesList);
278 
279   // Execute
280   int _retval = _struct->get_file_names(_struct, namesList);
281 
282   // Restore param:names; type: string_vec_byref
283   if (namesList) {
284     names.clear();
285     transfer_string_list_contents(namesList, names);
286     cef_string_list_free(namesList);
287   }
288 
289   // Return type: bool
290   return _retval ? true : false;
291 }
292 
293 NO_SANITIZE("cfi-icall")
SetLinkURL(const CefString & url)294 void CefDragDataCToCpp::SetLinkURL(const CefString& url) {
295   shutdown_checker::AssertNotShutdown();
296 
297   cef_drag_data_t* _struct = GetStruct();
298   if (CEF_MEMBER_MISSING(_struct, set_link_url))
299     return;
300 
301   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
302 
303   // Unverified params: url
304 
305   // Execute
306   _struct->set_link_url(_struct, url.GetStruct());
307 }
308 
309 NO_SANITIZE("cfi-icall")
SetLinkTitle(const CefString & title)310 void CefDragDataCToCpp::SetLinkTitle(const CefString& title) {
311   shutdown_checker::AssertNotShutdown();
312 
313   cef_drag_data_t* _struct = GetStruct();
314   if (CEF_MEMBER_MISSING(_struct, set_link_title))
315     return;
316 
317   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
318 
319   // Unverified params: title
320 
321   // Execute
322   _struct->set_link_title(_struct, title.GetStruct());
323 }
324 
325 NO_SANITIZE("cfi-icall")
SetLinkMetadata(const CefString & data)326 void CefDragDataCToCpp::SetLinkMetadata(const CefString& data) {
327   shutdown_checker::AssertNotShutdown();
328 
329   cef_drag_data_t* _struct = GetStruct();
330   if (CEF_MEMBER_MISSING(_struct, set_link_metadata))
331     return;
332 
333   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
334 
335   // Unverified params: data
336 
337   // Execute
338   _struct->set_link_metadata(_struct, data.GetStruct());
339 }
340 
341 NO_SANITIZE("cfi-icall")
SetFragmentText(const CefString & text)342 void CefDragDataCToCpp::SetFragmentText(const CefString& text) {
343   shutdown_checker::AssertNotShutdown();
344 
345   cef_drag_data_t* _struct = GetStruct();
346   if (CEF_MEMBER_MISSING(_struct, set_fragment_text))
347     return;
348 
349   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
350 
351   // Unverified params: text
352 
353   // Execute
354   _struct->set_fragment_text(_struct, text.GetStruct());
355 }
356 
357 NO_SANITIZE("cfi-icall")
SetFragmentHtml(const CefString & html)358 void CefDragDataCToCpp::SetFragmentHtml(const CefString& html) {
359   shutdown_checker::AssertNotShutdown();
360 
361   cef_drag_data_t* _struct = GetStruct();
362   if (CEF_MEMBER_MISSING(_struct, set_fragment_html))
363     return;
364 
365   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
366 
367   // Unverified params: html
368 
369   // Execute
370   _struct->set_fragment_html(_struct, html.GetStruct());
371 }
372 
373 NO_SANITIZE("cfi-icall")
SetFragmentBaseURL(const CefString & base_url)374 void CefDragDataCToCpp::SetFragmentBaseURL(const CefString& base_url) {
375   shutdown_checker::AssertNotShutdown();
376 
377   cef_drag_data_t* _struct = GetStruct();
378   if (CEF_MEMBER_MISSING(_struct, set_fragment_base_url))
379     return;
380 
381   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
382 
383   // Unverified params: base_url
384 
385   // Execute
386   _struct->set_fragment_base_url(_struct, base_url.GetStruct());
387 }
388 
ResetFileContents()389 NO_SANITIZE("cfi-icall") void CefDragDataCToCpp::ResetFileContents() {
390   shutdown_checker::AssertNotShutdown();
391 
392   cef_drag_data_t* _struct = GetStruct();
393   if (CEF_MEMBER_MISSING(_struct, reset_file_contents))
394     return;
395 
396   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
397 
398   // Execute
399   _struct->reset_file_contents(_struct);
400 }
401 
402 NO_SANITIZE("cfi-icall")
AddFile(const CefString & path,const CefString & display_name)403 void CefDragDataCToCpp::AddFile(const CefString& path,
404                                 const CefString& display_name) {
405   shutdown_checker::AssertNotShutdown();
406 
407   cef_drag_data_t* _struct = GetStruct();
408   if (CEF_MEMBER_MISSING(_struct, add_file))
409     return;
410 
411   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
412 
413   // Verify param: path; type: string_byref_const
414   DCHECK(!path.empty());
415   if (path.empty())
416     return;
417   // Unverified params: display_name
418 
419   // Execute
420   _struct->add_file(_struct, path.GetStruct(), display_name.GetStruct());
421 }
422 
GetImage()423 NO_SANITIZE("cfi-icall") CefRefPtr<CefImage> CefDragDataCToCpp::GetImage() {
424   shutdown_checker::AssertNotShutdown();
425 
426   cef_drag_data_t* _struct = GetStruct();
427   if (CEF_MEMBER_MISSING(_struct, get_image))
428     return nullptr;
429 
430   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
431 
432   // Execute
433   cef_image_t* _retval = _struct->get_image(_struct);
434 
435   // Return type: refptr_same
436   return CefImageCToCpp::Wrap(_retval);
437 }
438 
GetImageHotspot()439 NO_SANITIZE("cfi-icall") CefPoint CefDragDataCToCpp::GetImageHotspot() {
440   shutdown_checker::AssertNotShutdown();
441 
442   cef_drag_data_t* _struct = GetStruct();
443   if (CEF_MEMBER_MISSING(_struct, get_image_hotspot))
444     return CefPoint();
445 
446   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
447 
448   // Execute
449   cef_point_t _retval = _struct->get_image_hotspot(_struct);
450 
451   // Return type: simple
452   return _retval;
453 }
454 
HasImage()455 NO_SANITIZE("cfi-icall") bool CefDragDataCToCpp::HasImage() {
456   shutdown_checker::AssertNotShutdown();
457 
458   cef_drag_data_t* _struct = GetStruct();
459   if (CEF_MEMBER_MISSING(_struct, has_image))
460     return false;
461 
462   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
463 
464   // Execute
465   int _retval = _struct->has_image(_struct);
466 
467   // Return type: bool
468   return _retval ? true : false;
469 }
470 
471 // CONSTRUCTOR - Do not edit by hand.
472 
CefDragDataCToCpp()473 CefDragDataCToCpp::CefDragDataCToCpp() {}
474 
475 // DESTRUCTOR - Do not edit by hand.
476 
~CefDragDataCToCpp()477 CefDragDataCToCpp::~CefDragDataCToCpp() {
478   shutdown_checker::AssertNotShutdown();
479 }
480 
481 template <>
482 cef_drag_data_t*
483 CefCToCppRefCounted<CefDragDataCToCpp, CefDragData, cef_drag_data_t>::
UnwrapDerived(CefWrapperType type,CefDragData * c)484     UnwrapDerived(CefWrapperType type, CefDragData* c) {
485   NOTREACHED() << "Unexpected class type: " << type;
486   return nullptr;
487 }
488 
489 template <>
490 CefWrapperType CefCToCppRefCounted<CefDragDataCToCpp,
491                                    CefDragData,
492                                    cef_drag_data_t>::kWrapperType =
493     WT_DRAG_DATA;
494