]> git.sesse.net Git - casparcg/blob - dependencies64/cef/include/capi/cef_dom_capi.h
* Merged html producer and updated to latest CEF version (does not have satisfactory...
[casparcg] / dependencies64 / cef / include / capi / cef_dom_capi.h
1 // Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // ---------------------------------------------------------------------------
31 //
32 // This file was generated by the CEF translator tool and should not edited
33 // by hand. See the translator.README.txt file in the tools directory for
34 // more information.
35 //
36
37 #ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
38 #define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
39 #pragma once
40
41 #include "include/capi/cef_base_capi.h"
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 struct _cef_domdocument_t;
48 struct _cef_domnode_t;
49
50 ///
51 // Structure to implement for visiting the DOM. The functions of this structure
52 // will be called on the render process main thread.
53 ///
54 typedef struct _cef_domvisitor_t {
55   ///
56   // Base structure.
57   ///
58   cef_base_t base;
59
60   ///
61   // Method executed for visiting the DOM. The document object passed to this
62   // function represents a snapshot of the DOM at the time this function is
63   // executed. DOM objects are only valid for the scope of this function. Do not
64   // keep references to or attempt to access any DOM objects outside the scope
65   // of this function.
66   ///
67   void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self,
68       struct _cef_domdocument_t* document);
69 } cef_domvisitor_t;
70
71
72 ///
73 // Structure used to represent a DOM document. The functions of this structure
74 // should only be called on the render process main thread thread.
75 ///
76 typedef struct _cef_domdocument_t {
77   ///
78   // Base structure.
79   ///
80   cef_base_t base;
81
82   ///
83   // Returns the document type.
84   ///
85   cef_dom_document_type_t (CEF_CALLBACK *get_type)(
86       struct _cef_domdocument_t* self);
87
88   ///
89   // Returns the root document node.
90   ///
91   struct _cef_domnode_t* (CEF_CALLBACK *get_document)(
92       struct _cef_domdocument_t* self);
93
94   ///
95   // Returns the BODY node of an HTML document.
96   ///
97   struct _cef_domnode_t* (CEF_CALLBACK *get_body)(
98       struct _cef_domdocument_t* self);
99
100   ///
101   // Returns the HEAD node of an HTML document.
102   ///
103   struct _cef_domnode_t* (CEF_CALLBACK *get_head)(
104       struct _cef_domdocument_t* self);
105
106   ///
107   // Returns the title of an HTML document.
108   ///
109   // The resulting string must be freed by calling cef_string_userfree_free().
110   cef_string_userfree_t (CEF_CALLBACK *get_title)(
111       struct _cef_domdocument_t* self);
112
113   ///
114   // Returns the document element with the specified ID value.
115   ///
116   struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)(
117       struct _cef_domdocument_t* self, const cef_string_t* id);
118
119   ///
120   // Returns the node that currently has keyboard focus.
121   ///
122   struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)(
123       struct _cef_domdocument_t* self);
124
125   ///
126   // Returns true (1) if a portion of the document is selected.
127   ///
128   int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self);
129
130   ///
131   // Returns the selection offset within the start node.
132   ///
133   int (CEF_CALLBACK *get_selection_start_offset)(
134       struct _cef_domdocument_t* self);
135
136   ///
137   // Returns the selection offset within the end node.
138   ///
139   int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self);
140
141   ///
142   // Returns the contents of this selection as markup.
143   ///
144   // The resulting string must be freed by calling cef_string_userfree_free().
145   cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)(
146       struct _cef_domdocument_t* self);
147
148   ///
149   // Returns the contents of this selection as text.
150   ///
151   // The resulting string must be freed by calling cef_string_userfree_free().
152   cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)(
153       struct _cef_domdocument_t* self);
154
155   ///
156   // Returns the base URL for the document.
157   ///
158   // The resulting string must be freed by calling cef_string_userfree_free().
159   cef_string_userfree_t (CEF_CALLBACK *get_base_url)(
160       struct _cef_domdocument_t* self);
161
162   ///
163   // Returns a complete URL based on the document base URL and the specified
164   // partial URL.
165   ///
166   // The resulting string must be freed by calling cef_string_userfree_free().
167   cef_string_userfree_t (CEF_CALLBACK *get_complete_url)(
168       struct _cef_domdocument_t* self, const cef_string_t* partialURL);
169 } cef_domdocument_t;
170
171
172 ///
173 // Structure used to represent a DOM node. The functions of this structure
174 // should only be called on the render process main thread.
175 ///
176 typedef struct _cef_domnode_t {
177   ///
178   // Base structure.
179   ///
180   cef_base_t base;
181
182   ///
183   // Returns the type for this node.
184   ///
185   cef_dom_node_type_t (CEF_CALLBACK *get_type)(struct _cef_domnode_t* self);
186
187   ///
188   // Returns true (1) if this is a text node.
189   ///
190   int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self);
191
192   ///
193   // Returns true (1) if this is an element node.
194   ///
195   int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self);
196
197   ///
198   // Returns true (1) if this is an editable node.
199   ///
200   int (CEF_CALLBACK *is_editable)(struct _cef_domnode_t* self);
201
202   ///
203   // Returns true (1) if this is a form control element node.
204   ///
205   int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self);
206
207   ///
208   // Returns the type of this form control element node.
209   ///
210   // The resulting string must be freed by calling cef_string_userfree_free().
211   cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)(
212       struct _cef_domnode_t* self);
213
214   ///
215   // Returns true (1) if this object is pointing to the same handle as |that|
216   // object.
217   ///
218   int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self,
219       struct _cef_domnode_t* that);
220
221   ///
222   // Returns the name of this node.
223   ///
224   // The resulting string must be freed by calling cef_string_userfree_free().
225   cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self);
226
227   ///
228   // Returns the value of this node.
229   ///
230   // The resulting string must be freed by calling cef_string_userfree_free().
231   cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self);
232
233   ///
234   // Set the value of this node. Returns true (1) on success.
235   ///
236   int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self,
237       const cef_string_t* value);
238
239   ///
240   // Returns the contents of this node as markup.
241   ///
242   // The resulting string must be freed by calling cef_string_userfree_free().
243   cef_string_userfree_t (CEF_CALLBACK *get_as_markup)(
244       struct _cef_domnode_t* self);
245
246   ///
247   // Returns the document associated with this node.
248   ///
249   struct _cef_domdocument_t* (CEF_CALLBACK *get_document)(
250       struct _cef_domnode_t* self);
251
252   ///
253   // Returns the parent node.
254   ///
255   struct _cef_domnode_t* (CEF_CALLBACK *get_parent)(
256       struct _cef_domnode_t* self);
257
258   ///
259   // Returns the previous sibling node.
260   ///
261   struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)(
262       struct _cef_domnode_t* self);
263
264   ///
265   // Returns the next sibling node.
266   ///
267   struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)(
268       struct _cef_domnode_t* self);
269
270   ///
271   // Returns true (1) if this node has child nodes.
272   ///
273   int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self);
274
275   ///
276   // Return the first child node.
277   ///
278   struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)(
279       struct _cef_domnode_t* self);
280
281   ///
282   // Returns the last child node.
283   ///
284   struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)(
285       struct _cef_domnode_t* self);
286
287
288   // The following functions are valid only for element nodes.
289
290   ///
291   // Returns the tag name of this element.
292   ///
293   // The resulting string must be freed by calling cef_string_userfree_free().
294   cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)(
295       struct _cef_domnode_t* self);
296
297   ///
298   // Returns true (1) if this element has attributes.
299   ///
300   int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self);
301
302   ///
303   // Returns true (1) if this element has an attribute named |attrName|.
304   ///
305   int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self,
306       const cef_string_t* attrName);
307
308   ///
309   // Returns the element attribute named |attrName|.
310   ///
311   // The resulting string must be freed by calling cef_string_userfree_free().
312   cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)(
313       struct _cef_domnode_t* self, const cef_string_t* attrName);
314
315   ///
316   // Returns a map of all element attributes.
317   ///
318   void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self,
319       cef_string_map_t attrMap);
320
321   ///
322   // Set the value for the element attribute named |attrName|. Returns true (1)
323   // on success.
324   ///
325   int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self,
326       const cef_string_t* attrName, const cef_string_t* value);
327
328   ///
329   // Returns the inner text of the element.
330   ///
331   // The resulting string must be freed by calling cef_string_userfree_free().
332   cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)(
333       struct _cef_domnode_t* self);
334 } cef_domnode_t;
335
336
337 #ifdef __cplusplus
338 }
339 #endif
340
341 #endif  // CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_