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