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=e2f6dee4f74c0eb0979d7a557b007fb8e495bcbb$
13 //
14
15 #include "libcef_dll/cpptoc/context_menu_params_cpptoc.h"
16 #include "libcef_dll/shutdown_checker.h"
17 #include "libcef_dll/transfer_util.h"
18
19 namespace {
20
21 // MEMBER FUNCTIONS - Body may be edited by hand.
22
23 int CEF_CALLBACK
context_menu_params_get_xcoord(struct _cef_context_menu_params_t * self)24 context_menu_params_get_xcoord(struct _cef_context_menu_params_t* self) {
25 shutdown_checker::AssertNotShutdown();
26
27 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
28
29 DCHECK(self);
30 if (!self)
31 return 0;
32
33 // Execute
34 int _retval = CefContextMenuParamsCppToC::Get(self)->GetXCoord();
35
36 // Return type: simple
37 return _retval;
38 }
39
40 int CEF_CALLBACK
context_menu_params_get_ycoord(struct _cef_context_menu_params_t * self)41 context_menu_params_get_ycoord(struct _cef_context_menu_params_t* self) {
42 shutdown_checker::AssertNotShutdown();
43
44 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
45
46 DCHECK(self);
47 if (!self)
48 return 0;
49
50 // Execute
51 int _retval = CefContextMenuParamsCppToC::Get(self)->GetYCoord();
52
53 // Return type: simple
54 return _retval;
55 }
56
57 cef_context_menu_type_flags_t CEF_CALLBACK
context_menu_params_get_type_flags(struct _cef_context_menu_params_t * self)58 context_menu_params_get_type_flags(struct _cef_context_menu_params_t* self) {
59 shutdown_checker::AssertNotShutdown();
60
61 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
62
63 DCHECK(self);
64 if (!self)
65 return CM_TYPEFLAG_NONE;
66
67 // Execute
68 cef_context_menu_type_flags_t _retval =
69 CefContextMenuParamsCppToC::Get(self)->GetTypeFlags();
70
71 // Return type: simple
72 return _retval;
73 }
74
75 cef_string_userfree_t CEF_CALLBACK
context_menu_params_get_link_url(struct _cef_context_menu_params_t * self)76 context_menu_params_get_link_url(struct _cef_context_menu_params_t* self) {
77 shutdown_checker::AssertNotShutdown();
78
79 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
80
81 DCHECK(self);
82 if (!self)
83 return NULL;
84
85 // Execute
86 CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetLinkUrl();
87
88 // Return type: string
89 return _retval.DetachToUserFree();
90 }
91
context_menu_params_get_unfiltered_link_url(struct _cef_context_menu_params_t * self)92 cef_string_userfree_t CEF_CALLBACK context_menu_params_get_unfiltered_link_url(
93 struct _cef_context_menu_params_t* self) {
94 shutdown_checker::AssertNotShutdown();
95
96 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
97
98 DCHECK(self);
99 if (!self)
100 return NULL;
101
102 // Execute
103 CefString _retval =
104 CefContextMenuParamsCppToC::Get(self)->GetUnfilteredLinkUrl();
105
106 // Return type: string
107 return _retval.DetachToUserFree();
108 }
109
110 cef_string_userfree_t CEF_CALLBACK
context_menu_params_get_source_url(struct _cef_context_menu_params_t * self)111 context_menu_params_get_source_url(struct _cef_context_menu_params_t* self) {
112 shutdown_checker::AssertNotShutdown();
113
114 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
115
116 DCHECK(self);
117 if (!self)
118 return NULL;
119
120 // Execute
121 CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetSourceUrl();
122
123 // Return type: string
124 return _retval.DetachToUserFree();
125 }
126
context_menu_params_has_image_contents(struct _cef_context_menu_params_t * self)127 int CEF_CALLBACK context_menu_params_has_image_contents(
128 struct _cef_context_menu_params_t* self) {
129 shutdown_checker::AssertNotShutdown();
130
131 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
132
133 DCHECK(self);
134 if (!self)
135 return 0;
136
137 // Execute
138 bool _retval = CefContextMenuParamsCppToC::Get(self)->HasImageContents();
139
140 // Return type: bool
141 return _retval;
142 }
143
144 cef_string_userfree_t CEF_CALLBACK
context_menu_params_get_title_text(struct _cef_context_menu_params_t * self)145 context_menu_params_get_title_text(struct _cef_context_menu_params_t* self) {
146 shutdown_checker::AssertNotShutdown();
147
148 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
149
150 DCHECK(self);
151 if (!self)
152 return NULL;
153
154 // Execute
155 CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetTitleText();
156
157 // Return type: string
158 return _retval.DetachToUserFree();
159 }
160
161 cef_string_userfree_t CEF_CALLBACK
context_menu_params_get_page_url(struct _cef_context_menu_params_t * self)162 context_menu_params_get_page_url(struct _cef_context_menu_params_t* self) {
163 shutdown_checker::AssertNotShutdown();
164
165 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
166
167 DCHECK(self);
168 if (!self)
169 return NULL;
170
171 // Execute
172 CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetPageUrl();
173
174 // Return type: string
175 return _retval.DetachToUserFree();
176 }
177
178 cef_string_userfree_t CEF_CALLBACK
context_menu_params_get_frame_url(struct _cef_context_menu_params_t * self)179 context_menu_params_get_frame_url(struct _cef_context_menu_params_t* self) {
180 shutdown_checker::AssertNotShutdown();
181
182 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
183
184 DCHECK(self);
185 if (!self)
186 return NULL;
187
188 // Execute
189 CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetFrameUrl();
190
191 // Return type: string
192 return _retval.DetachToUserFree();
193 }
194
195 cef_string_userfree_t CEF_CALLBACK
context_menu_params_get_frame_charset(struct _cef_context_menu_params_t * self)196 context_menu_params_get_frame_charset(struct _cef_context_menu_params_t* self) {
197 shutdown_checker::AssertNotShutdown();
198
199 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
200
201 DCHECK(self);
202 if (!self)
203 return NULL;
204
205 // Execute
206 CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetFrameCharset();
207
208 // Return type: string
209 return _retval.DetachToUserFree();
210 }
211
212 cef_context_menu_media_type_t CEF_CALLBACK
context_menu_params_get_media_type(struct _cef_context_menu_params_t * self)213 context_menu_params_get_media_type(struct _cef_context_menu_params_t* self) {
214 shutdown_checker::AssertNotShutdown();
215
216 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
217
218 DCHECK(self);
219 if (!self)
220 return CM_MEDIATYPE_NONE;
221
222 // Execute
223 cef_context_menu_media_type_t _retval =
224 CefContextMenuParamsCppToC::Get(self)->GetMediaType();
225
226 // Return type: simple
227 return _retval;
228 }
229
230 cef_context_menu_media_state_flags_t CEF_CALLBACK
context_menu_params_get_media_state_flags(struct _cef_context_menu_params_t * self)231 context_menu_params_get_media_state_flags(
232 struct _cef_context_menu_params_t* self) {
233 shutdown_checker::AssertNotShutdown();
234
235 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
236
237 DCHECK(self);
238 if (!self)
239 return CM_MEDIAFLAG_NONE;
240
241 // Execute
242 cef_context_menu_media_state_flags_t _retval =
243 CefContextMenuParamsCppToC::Get(self)->GetMediaStateFlags();
244
245 // Return type: simple
246 return _retval;
247 }
248
context_menu_params_get_selection_text(struct _cef_context_menu_params_t * self)249 cef_string_userfree_t CEF_CALLBACK context_menu_params_get_selection_text(
250 struct _cef_context_menu_params_t* self) {
251 shutdown_checker::AssertNotShutdown();
252
253 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
254
255 DCHECK(self);
256 if (!self)
257 return NULL;
258
259 // Execute
260 CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetSelectionText();
261
262 // Return type: string
263 return _retval.DetachToUserFree();
264 }
265
context_menu_params_get_misspelled_word(struct _cef_context_menu_params_t * self)266 cef_string_userfree_t CEF_CALLBACK context_menu_params_get_misspelled_word(
267 struct _cef_context_menu_params_t* self) {
268 shutdown_checker::AssertNotShutdown();
269
270 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
271
272 DCHECK(self);
273 if (!self)
274 return NULL;
275
276 // Execute
277 CefString _retval =
278 CefContextMenuParamsCppToC::Get(self)->GetMisspelledWord();
279
280 // Return type: string
281 return _retval.DetachToUserFree();
282 }
283
context_menu_params_get_dictionary_suggestions(struct _cef_context_menu_params_t * self,cef_string_list_t suggestions)284 int CEF_CALLBACK context_menu_params_get_dictionary_suggestions(
285 struct _cef_context_menu_params_t* self,
286 cef_string_list_t suggestions) {
287 shutdown_checker::AssertNotShutdown();
288
289 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
290
291 DCHECK(self);
292 if (!self)
293 return 0;
294 // Verify param: suggestions; type: string_vec_byref
295 DCHECK(suggestions);
296 if (!suggestions)
297 return 0;
298
299 // Translate param: suggestions; type: string_vec_byref
300 std::vector<CefString> suggestionsList;
301 transfer_string_list_contents(suggestions, suggestionsList);
302
303 // Execute
304 bool _retval =
305 CefContextMenuParamsCppToC::Get(self)->GetDictionarySuggestions(
306 suggestionsList);
307
308 // Restore param: suggestions; type: string_vec_byref
309 cef_string_list_clear(suggestions);
310 transfer_string_list_contents(suggestionsList, suggestions);
311
312 // Return type: bool
313 return _retval;
314 }
315
316 int CEF_CALLBACK
context_menu_params_is_editable(struct _cef_context_menu_params_t * self)317 context_menu_params_is_editable(struct _cef_context_menu_params_t* self) {
318 shutdown_checker::AssertNotShutdown();
319
320 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
321
322 DCHECK(self);
323 if (!self)
324 return 0;
325
326 // Execute
327 bool _retval = CefContextMenuParamsCppToC::Get(self)->IsEditable();
328
329 // Return type: bool
330 return _retval;
331 }
332
context_menu_params_is_spell_check_enabled(struct _cef_context_menu_params_t * self)333 int CEF_CALLBACK context_menu_params_is_spell_check_enabled(
334 struct _cef_context_menu_params_t* self) {
335 shutdown_checker::AssertNotShutdown();
336
337 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
338
339 DCHECK(self);
340 if (!self)
341 return 0;
342
343 // Execute
344 bool _retval = CefContextMenuParamsCppToC::Get(self)->IsSpellCheckEnabled();
345
346 // Return type: bool
347 return _retval;
348 }
349
350 cef_context_menu_edit_state_flags_t CEF_CALLBACK
context_menu_params_get_edit_state_flags(struct _cef_context_menu_params_t * self)351 context_menu_params_get_edit_state_flags(
352 struct _cef_context_menu_params_t* self) {
353 shutdown_checker::AssertNotShutdown();
354
355 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
356
357 DCHECK(self);
358 if (!self)
359 return CM_EDITFLAG_NONE;
360
361 // Execute
362 cef_context_menu_edit_state_flags_t _retval =
363 CefContextMenuParamsCppToC::Get(self)->GetEditStateFlags();
364
365 // Return type: simple
366 return _retval;
367 }
368
369 int CEF_CALLBACK
context_menu_params_is_custom_menu(struct _cef_context_menu_params_t * self)370 context_menu_params_is_custom_menu(struct _cef_context_menu_params_t* self) {
371 shutdown_checker::AssertNotShutdown();
372
373 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
374
375 DCHECK(self);
376 if (!self)
377 return 0;
378
379 // Execute
380 bool _retval = CefContextMenuParamsCppToC::Get(self)->IsCustomMenu();
381
382 // Return type: bool
383 return _retval;
384 }
385
386 } // namespace
387
388 // CONSTRUCTOR - Do not edit by hand.
389
CefContextMenuParamsCppToC()390 CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() {
391 GetStruct()->get_xcoord = context_menu_params_get_xcoord;
392 GetStruct()->get_ycoord = context_menu_params_get_ycoord;
393 GetStruct()->get_type_flags = context_menu_params_get_type_flags;
394 GetStruct()->get_link_url = context_menu_params_get_link_url;
395 GetStruct()->get_unfiltered_link_url =
396 context_menu_params_get_unfiltered_link_url;
397 GetStruct()->get_source_url = context_menu_params_get_source_url;
398 GetStruct()->has_image_contents = context_menu_params_has_image_contents;
399 GetStruct()->get_title_text = context_menu_params_get_title_text;
400 GetStruct()->get_page_url = context_menu_params_get_page_url;
401 GetStruct()->get_frame_url = context_menu_params_get_frame_url;
402 GetStruct()->get_frame_charset = context_menu_params_get_frame_charset;
403 GetStruct()->get_media_type = context_menu_params_get_media_type;
404 GetStruct()->get_media_state_flags =
405 context_menu_params_get_media_state_flags;
406 GetStruct()->get_selection_text = context_menu_params_get_selection_text;
407 GetStruct()->get_misspelled_word = context_menu_params_get_misspelled_word;
408 GetStruct()->get_dictionary_suggestions =
409 context_menu_params_get_dictionary_suggestions;
410 GetStruct()->is_editable = context_menu_params_is_editable;
411 GetStruct()->is_spell_check_enabled =
412 context_menu_params_is_spell_check_enabled;
413 GetStruct()->get_edit_state_flags = context_menu_params_get_edit_state_flags;
414 GetStruct()->is_custom_menu = context_menu_params_is_custom_menu;
415 }
416
417 // DESTRUCTOR - Do not edit by hand.
418
~CefContextMenuParamsCppToC()419 CefContextMenuParamsCppToC::~CefContextMenuParamsCppToC() {
420 shutdown_checker::AssertNotShutdown();
421 }
422
423 template <>
424 CefRefPtr<CefContextMenuParams> CefCppToCRefCounted<
425 CefContextMenuParamsCppToC,
426 CefContextMenuParams,
UnwrapDerived(CefWrapperType type,cef_context_menu_params_t * s)427 cef_context_menu_params_t>::UnwrapDerived(CefWrapperType type,
428 cef_context_menu_params_t* s) {
429 NOTREACHED() << "Unexpected class type: " << type;
430 return nullptr;
431 }
432
433 template <>
434 CefWrapperType CefCppToCRefCounted<CefContextMenuParamsCppToC,
435 CefContextMenuParams,
436 cef_context_menu_params_t>::kWrapperType =
437 WT_CONTEXT_MENU_PARAMS;
438