1/*
2 * This file is part of the WebKit open source project.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#if !defined(__WEBKITDOM_H_INSIDE__) && !defined(BUILDING_WEBKIT)
21#error "Only <webkitdom/webkitdom.h> can be included directly."
22#endif
23
24#ifndef WebKitDOMNode_h
25#define WebKitDOMNode_h
26
27#include <glib-object.h>
28#include <jsc/jsc.h>
29#include <webkitdom/WebKitDOMObject.h>
30#include <webkitdom/webkitdomdefines.h>
31
32G_BEGIN_DECLS
33
34#define WEBKIT_DOM_TYPE_NODE (webkit_dom_node_get_type())
35#define WEBKIT_DOM_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_NODE, WebKitDOMNode))
36#define WEBKIT_DOM_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_DOM_TYPE_NODE, WebKitDOMNodeClass)
37#define WEBKIT_DOM_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_DOM_TYPE_NODE))
38#define WEBKIT_DOM_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_DOM_TYPE_NODE))
39#define WEBKIT_DOM_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_DOM_TYPE_NODE, WebKitDOMNodeClass))
40
41struct _WebKitDOMNode {
42 WebKitDOMObject parent_instance;
43};
44
45struct _WebKitDOMNodeClass {
46 WebKitDOMObjectClass parent_class;
47};
48
49#ifndef WEBKIT_DISABLE_DEPRECATED
50
51/**
52 * WEBKIT_DOM_NODE_ELEMENT_NODE:
53 *
54 * Deprecated: 2.22: Use JavaScriptCore API instead
55 */
56#define WEBKIT_DOM_NODE_ELEMENT_NODE 1
57
58/**
59 * WEBKIT_DOM_NODE_ATTRIBUTE_NODE:
60 *
61 * Deprecated: 2.22: Use JavaScriptCore API instead
62 */
63#define WEBKIT_DOM_NODE_ATTRIBUTE_NODE 2
64
65/**
66 * WEBKIT_DOM_NODE_TEXT_NODE:
67 *
68 * Deprecated: 2.22: Use JavaScriptCore API instead
69 */
70#define WEBKIT_DOM_NODE_TEXT_NODE 3
71
72/**
73 * WEBKIT_DOM_NODE_CDATA_SECTION_NODE:
74 *
75 * Deprecated: 2.22: Use JavaScriptCore API instead
76 */
77#define WEBKIT_DOM_NODE_CDATA_SECTION_NODE 4
78
79/**
80 * WEBKIT_DOM_NODE_ENTITY_REFERENCE_NODE:
81 *
82 * Deprecated: 2.22: Use JavaScriptCore API instead
83 */
84#define WEBKIT_DOM_NODE_ENTITY_REFERENCE_NODE 5
85
86/**
87 * WEBKIT_DOM_NODE_ENTITY_NODE:
88 *
89 * Deprecated: 2.22: Use JavaScriptCore API instead
90 */
91#define WEBKIT_DOM_NODE_ENTITY_NODE 6
92
93/**
94 * WEBKIT_DOM_NODE_PROCESSING_INSTRUCTION_NODE:
95 *
96 * Deprecated: 2.22: Use JavaScriptCore API instead
97 */
98#define WEBKIT_DOM_NODE_PROCESSING_INSTRUCTION_NODE 7
99
100/**
101 * WEBKIT_DOM_NODE_COMMENT_NODE:
102 *
103 * Deprecated: 2.22: Use JavaScriptCore API instead
104 */
105#define WEBKIT_DOM_NODE_COMMENT_NODE 8
106
107/**
108 * WEBKIT_DOM_NODE_DOCUMENT_NODE:
109 *
110 * Deprecated: 2.22: Use JavaScriptCore API instead
111 */
112#define WEBKIT_DOM_NODE_DOCUMENT_NODE 9
113
114/**
115 * WEBKIT_DOM_NODE_DOCUMENT_TYPE_NODE:
116 *
117 * Deprecated: 2.22: Use JavaScriptCore API instead
118 */
119#define WEBKIT_DOM_NODE_DOCUMENT_TYPE_NODE 10
120
121/**
122 * WEBKIT_DOM_NODE_DOCUMENT_FRAGMENT_NODE:
123 *
124 * Deprecated: 2.22: Use JavaScriptCore API instead
125 */
126#define WEBKIT_DOM_NODE_DOCUMENT_FRAGMENT_NODE 11
127
128/**
129 * WEBKIT_DOM_NODE_DOCUMENT_POSITION_DISCONNECTED:
130 *
131 * Deprecated: 2.22: Use JavaScriptCore API instead
132 */
133#define WEBKIT_DOM_NODE_DOCUMENT_POSITION_DISCONNECTED 0x01
134
135/**
136 * WEBKIT_DOM_NODE_DOCUMENT_POSITION_PRECEDING:
137 *
138 * Deprecated: 2.22: Use JavaScriptCore API instead
139 */
140#define WEBKIT_DOM_NODE_DOCUMENT_POSITION_PRECEDING 0x02
141
142/**
143 * WEBKIT_DOM_NODE_DOCUMENT_POSITION_FOLLOWING:
144 *
145 * Deprecated: 2.22: Use JavaScriptCore API instead
146 */
147#define WEBKIT_DOM_NODE_DOCUMENT_POSITION_FOLLOWING 0x04
148
149/**
150 * WEBKIT_DOM_NODE_DOCUMENT_POSITION_CONTAINS:
151 *
152 * Deprecated: 2.22: Use JavaScriptCore API instead
153 */
154#define WEBKIT_DOM_NODE_DOCUMENT_POSITION_CONTAINS 0x08
155
156/**
157 * WEBKIT_DOM_NODE_DOCUMENT_POSITION_CONTAINED_BY:
158 *
159 * Deprecated: 2.22: Use JavaScriptCore API instead
160 */
161#define WEBKIT_DOM_NODE_DOCUMENT_POSITION_CONTAINED_BY 0x10
162
163/**
164 * WEBKIT_DOM_NODE_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:
165 *
166 * Deprecated: 2.22: Use JavaScriptCore API instead
167 */
168#define WEBKIT_DOM_NODE_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC 0x20
169
170#endif /* WEBKIT_DISABLE_DEPRECATED */
171
172WEBKIT_API GType
173webkit_dom_node_get_type(void);
174
175/**
176 * webkit_dom_node_insert_before:
177 * @self: A #WebKitDOMNode
178 * @newChild: A #WebKitDOMNode
179 * @refChild: (allow-none): A #WebKitDOMNode
180 * @error: #GError
181 *
182 * Returns: (transfer none): A #WebKitDOMNode
183 *
184 * Deprecated: 2.22: Use JavaScriptCore API instead
185**/
186WEBKIT_DEPRECATED WebKitDOMNode*
187webkit_dom_node_insert_before(WebKitDOMNode* self, WebKitDOMNode* newChild, WebKitDOMNode* refChild, GError** error);
188
189/**
190 * webkit_dom_node_replace_child:
191 * @self: A #WebKitDOMNode
192 * @newChild: A #WebKitDOMNode
193 * @oldChild: A #WebKitDOMNode
194 * @error: #GError
195 *
196 * Returns: (transfer none): A #WebKitDOMNode
197 *
198 * Deprecated: 2.22: Use JavaScriptCore API instead
199**/
200WEBKIT_DEPRECATED WebKitDOMNode*
201webkit_dom_node_replace_child(WebKitDOMNode* self, WebKitDOMNode* newChild, WebKitDOMNode* oldChild, GError** error);
202
203/**
204 * webkit_dom_node_remove_child:
205 * @self: A #WebKitDOMNode
206 * @oldChild: A #WebKitDOMNode
207 * @error: #GError
208 *
209 * Returns: (transfer none): A #WebKitDOMNode
210 *
211 * Deprecated: 2.22: Use JavaScriptCore API instead
212**/
213WEBKIT_DEPRECATED WebKitDOMNode*
214webkit_dom_node_remove_child(WebKitDOMNode* self, WebKitDOMNode* oldChild, GError** error);
215
216/**
217 * webkit_dom_node_append_child:
218 * @self: A #WebKitDOMNode
219 * @newChild: A #WebKitDOMNode
220 * @error: #GError
221 *
222 * Returns: (transfer none): A #WebKitDOMNode
223 *
224 * Deprecated: 2.22: Use JavaScriptCore API instead
225**/
226WEBKIT_DEPRECATED WebKitDOMNode*
227webkit_dom_node_append_child(WebKitDOMNode* self, WebKitDOMNode* newChild, GError** error);
228
229/**
230 * webkit_dom_node_has_child_nodes:
231 * @self: A #WebKitDOMNode
232 *
233 * Returns: A #gboolean
234 *
235 * Deprecated: 2.22: Use JavaScriptCore API instead
236**/
237WEBKIT_DEPRECATED gboolean
238webkit_dom_node_has_child_nodes(WebKitDOMNode* self);
239
240/**
241 * webkit_dom_node_clone_node_with_error:
242 * @self: A #WebKitDOMNode
243 * @deep: A #gboolean
244 * @error: #GError
245 *
246 * Returns: (transfer none): A #WebKitDOMNode
247 *
248 * Since: 2.14
249 *
250 * Deprecated: 2.22: Use JavaScriptCore API instead
251**/
252WEBKIT_DEPRECATED WebKitDOMNode*
253webkit_dom_node_clone_node_with_error(WebKitDOMNode* self, gboolean deep, GError** error);
254
255/**
256 * webkit_dom_node_normalize:
257 * @self: A #WebKitDOMNode
258 *
259 *
260 * Deprecated: 2.22: Use JavaScriptCore API instead
261**/
262WEBKIT_DEPRECATED void
263webkit_dom_node_normalize(WebKitDOMNode* self);
264
265/**
266 * webkit_dom_node_is_supported:
267 * @self: A #WebKitDOMNode
268 * @feature: A #gchar
269 * @version: A #gchar
270 *
271 * Returns: A #gboolean
272 *
273 * Deprecated: 2.22: Use JavaScriptCore API instead
274**/
275WEBKIT_DEPRECATED gboolean
276webkit_dom_node_is_supported(WebKitDOMNode* self, const gchar* feature, const gchar* version);
277
278/**
279 * webkit_dom_node_is_same_node:
280 * @self: A #WebKitDOMNode
281 * @other: A #WebKitDOMNode
282 *
283 * Returns: A #gboolean
284 *
285 * Deprecated: 2.22: Use JavaScriptCore API instead
286**/
287WEBKIT_DEPRECATED gboolean
288webkit_dom_node_is_same_node(WebKitDOMNode* self, WebKitDOMNode* other);
289
290/**
291 * webkit_dom_node_is_equal_node:
292 * @self: A #WebKitDOMNode
293 * @other: A #WebKitDOMNode
294 *
295 * Returns: A #gboolean
296 *
297 * Deprecated: 2.22: Use JavaScriptCore API instead
298**/
299WEBKIT_DEPRECATED gboolean
300webkit_dom_node_is_equal_node(WebKitDOMNode* self, WebKitDOMNode* other);
301
302/**
303 * webkit_dom_node_lookup_prefix:
304 * @self: A #WebKitDOMNode
305 * @namespaceURI: A #gchar
306 *
307 * Returns: A #gchar
308 *
309 * Deprecated: 2.22: Use JavaScriptCore API instead
310**/
311WEBKIT_DEPRECATED gchar*
312webkit_dom_node_lookup_prefix(WebKitDOMNode* self, const gchar* namespaceURI);
313
314/**
315 * webkit_dom_node_lookup_namespace_uri:
316 * @self: A #WebKitDOMNode
317 * @prefix: A #gchar
318 *
319 * Returns: A #gchar
320 *
321 * Deprecated: 2.22: Use JavaScriptCore API instead
322**/
323WEBKIT_DEPRECATED gchar*
324webkit_dom_node_lookup_namespace_uri(WebKitDOMNode* self, const gchar* prefix);
325
326/**
327 * webkit_dom_node_is_default_namespace:
328 * @self: A #WebKitDOMNode
329 * @namespaceURI: A #gchar
330 *
331 * Returns: A #gboolean
332 *
333 * Deprecated: 2.22: Use JavaScriptCore API instead
334**/
335WEBKIT_DEPRECATED gboolean
336webkit_dom_node_is_default_namespace(WebKitDOMNode* self, const gchar* namespaceURI);
337
338/**
339 * webkit_dom_node_compare_document_position:
340 * @self: A #WebKitDOMNode
341 * @other: A #WebKitDOMNode
342 *
343 * Returns: A #gushort
344 *
345 * Deprecated: 2.22: Use JavaScriptCore API instead
346**/
347WEBKIT_DEPRECATED gushort
348webkit_dom_node_compare_document_position(WebKitDOMNode* self, WebKitDOMNode* other);
349
350/**
351 * webkit_dom_node_contains:
352 * @self: A #WebKitDOMNode
353 * @other: A #WebKitDOMNode
354 *
355 * Returns: A #gboolean
356 *
357 * Deprecated: 2.22: Use JavaScriptCore API instead
358**/
359WEBKIT_DEPRECATED gboolean
360webkit_dom_node_contains(WebKitDOMNode* self, WebKitDOMNode* other);
361
362/**
363 * webkit_dom_node_get_node_name:
364 * @self: A #WebKitDOMNode
365 *
366 * Returns: A #gchar
367 *
368 * Deprecated: 2.22: Use JavaScriptCore API instead
369**/
370WEBKIT_DEPRECATED gchar*
371webkit_dom_node_get_node_name(WebKitDOMNode* self);
372
373/**
374 * webkit_dom_node_get_node_value:
375 * @self: A #WebKitDOMNode
376 *
377 * Returns: A #gchar
378 *
379 * Deprecated: 2.22: Use JavaScriptCore API instead
380**/
381WEBKIT_DEPRECATED gchar*
382webkit_dom_node_get_node_value(WebKitDOMNode* self);
383
384/**
385 * webkit_dom_node_set_node_value:
386 * @self: A #WebKitDOMNode
387 * @value: A #gchar
388 * @error: #GError
389 *
390 *
391 * Deprecated: 2.22: Use JavaScriptCore API instead
392**/
393WEBKIT_DEPRECATED void
394webkit_dom_node_set_node_value(WebKitDOMNode* self, const gchar* value, GError** error);
395
396/**
397 * webkit_dom_node_get_node_type:
398 * @self: A #WebKitDOMNode
399 *
400 * Returns: A #gushort
401 *
402 * Deprecated: 2.22: Use JavaScriptCore API instead
403**/
404WEBKIT_DEPRECATED gushort
405webkit_dom_node_get_node_type(WebKitDOMNode* self);
406
407/**
408 * webkit_dom_node_get_parent_node:
409 * @self: A #WebKitDOMNode
410 *
411 * Returns: (transfer none): A #WebKitDOMNode
412 *
413 * Deprecated: 2.22: Use JavaScriptCore API instead
414**/
415WEBKIT_DEPRECATED WebKitDOMNode*
416webkit_dom_node_get_parent_node(WebKitDOMNode* self);
417
418/**
419 * webkit_dom_node_get_child_nodes:
420 * @self: A #WebKitDOMNode
421 *
422 * Returns: (transfer full): A #WebKitDOMNodeList
423 *
424 * Deprecated: 2.22: Use JavaScriptCore API instead
425**/
426WEBKIT_DEPRECATED WebKitDOMNodeList*
427webkit_dom_node_get_child_nodes(WebKitDOMNode* self);
428
429/**
430 * webkit_dom_node_get_first_child:
431 * @self: A #WebKitDOMNode
432 *
433 * Returns: (transfer none): A #WebKitDOMNode
434 *
435 * Deprecated: 2.22: Use JavaScriptCore API instead
436**/
437WEBKIT_DEPRECATED WebKitDOMNode*
438webkit_dom_node_get_first_child(WebKitDOMNode* self);
439
440/**
441 * webkit_dom_node_get_last_child:
442 * @self: A #WebKitDOMNode
443 *
444 * Returns: (transfer none): A #WebKitDOMNode
445 *
446 * Deprecated: 2.22: Use JavaScriptCore API instead
447**/
448WEBKIT_DEPRECATED WebKitDOMNode*
449webkit_dom_node_get_last_child(WebKitDOMNode* self);
450
451/**
452 * webkit_dom_node_get_previous_sibling:
453 * @self: A #WebKitDOMNode
454 *
455 * Returns: (transfer none): A #WebKitDOMNode
456 *
457 * Deprecated: 2.22: Use JavaScriptCore API instead
458**/
459WEBKIT_DEPRECATED WebKitDOMNode*
460webkit_dom_node_get_previous_sibling(WebKitDOMNode* self);
461
462/**
463 * webkit_dom_node_get_next_sibling:
464 * @self: A #WebKitDOMNode
465 *
466 * Returns: (transfer none): A #WebKitDOMNode
467 *
468 * Deprecated: 2.22: Use JavaScriptCore API instead
469**/
470WEBKIT_DEPRECATED WebKitDOMNode*
471webkit_dom_node_get_next_sibling(WebKitDOMNode* self);
472
473/**
474 * webkit_dom_node_get_owner_document:
475 * @self: A #WebKitDOMNode
476 *
477 * Returns: (transfer none): A #WebKitDOMDocument
478 *
479 * Deprecated: 2.22: Use JavaScriptCore API instead
480**/
481WEBKIT_DEPRECATED WebKitDOMDocument*
482webkit_dom_node_get_owner_document(WebKitDOMNode* self);
483
484/**
485 * webkit_dom_node_get_base_uri:
486 * @self: A #WebKitDOMNode
487 *
488 * Returns: A #gchar
489 *
490 * Deprecated: 2.22: Use JavaScriptCore API instead
491**/
492WEBKIT_DEPRECATED gchar*
493webkit_dom_node_get_base_uri(WebKitDOMNode* self);
494
495/**
496 * webkit_dom_node_get_text_content:
497 * @self: A #WebKitDOMNode
498 *
499 * Returns: A #gchar
500 *
501 * Deprecated: 2.22: Use JavaScriptCore API instead
502**/
503WEBKIT_DEPRECATED gchar*
504webkit_dom_node_get_text_content(WebKitDOMNode* self);
505
506/**
507 * webkit_dom_node_set_text_content:
508 * @self: A #WebKitDOMNode
509 * @value: A #gchar
510 * @error: #GError
511 *
512 *
513 * Deprecated: 2.22: Use JavaScriptCore API instead
514**/
515WEBKIT_DEPRECATED void
516webkit_dom_node_set_text_content(WebKitDOMNode* self, const gchar* value, GError** error);
517
518/**
519 * webkit_dom_node_get_parent_element:
520 * @self: A #WebKitDOMNode
521 *
522 * Returns: (transfer none): A #WebKitDOMElement
523 *
524 * Deprecated: 2.22: Use JavaScriptCore API instead
525**/
526WEBKIT_DEPRECATED WebKitDOMElement*
527webkit_dom_node_get_parent_element(WebKitDOMNode* self);
528
529WEBKIT_API WebKitDOMNode *
530webkit_dom_node_for_js_value(JSCValue* value);
531
532G_END_DECLS
533
534#endif /* WebKitDOMNode_h */
535