Hubbub $Id$
tree.h
Go to the documentation of this file.
1/*
2 * This file is part of Hubbub.
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2008 John-Mark Bell <jmb@netsurf-browser.org>
6 */
7
8#ifndef hubbub_tree_h_
9#define hubbub_tree_h_
10
11#ifdef __cplusplus
12extern "C"
13{
14#endif
15
16#include <hubbub/functypes.h>
17
29 const hubbub_string *data,
30 void **result);
31
43 const hubbub_doctype *doctype,
44 void **result);
45
57 const hubbub_tag *tag,
58 void **result);
59
71 const hubbub_string *data,
72 void **result);
73
83typedef hubbub_error (*hubbub_tree_ref_node)(void *ctx, void *node);
84
96typedef hubbub_error (*hubbub_tree_unref_node)(void *ctx, void *node);
97
112 void *parent,
113 void *child,
114 void **result);
115
131 void *parent,
132 void *child,
133 void *ref_child,
134 void **result);
135
148 void *parent,
149 void *child,
150 void **result);
151
164 void *node,
165 bool deep,
166 void **result);
167
177 void *node,
178 void *new_parent);
179
196 void *node,
197 bool element_only,
198 void **result);
199
209 void *node,
210 bool *result);
211
221 void *form,
222 void *node);
223
234 void *node,
235 const hubbub_attribute *attributes,
236 uint32_t n_attributes);
237
247
259 const char *encname);
260
268typedef hubbub_error (*hubbub_tree_complete_script)(void *ctx, void *script);
269
273typedef struct hubbub_tree_handler {
292 void *ctx;
294
295#ifdef __cplusplus
296}
297#endif
298
299#endif
300
hubbub_error
Definition: errors.h:18
Tag attribute data.
Definition: types.h:84
Data for doctype token.
Definition: types.h:93
Tokeniser string type.
Definition: types.h:76
Data for a tag.
Definition: types.h:108
Hubbub tree handler.
Definition: tree.h:273
hubbub_tree_complete_script complete_script
Script Complete.
Definition: tree.h:291
hubbub_tree_clone_node clone_node
Clone node.
Definition: tree.h:283
hubbub_tree_reparent_children reparent_children
Reparent children.
Definition: tree.h:284
hubbub_tree_set_quirks_mode set_quirks_mode
Set quirks mode.
Definition: tree.h:289
hubbub_tree_form_associate form_associate
Form associate.
Definition: tree.h:287
hubbub_tree_insert_before insert_before
Insert before.
Definition: tree.h:281
hubbub_tree_encoding_change encoding_change
Change encoding.
Definition: tree.h:290
hubbub_tree_create_doctype create_doctype
Create doctype.
Definition: tree.h:275
hubbub_tree_add_attributes add_attributes
Add attributes.
Definition: tree.h:288
hubbub_tree_has_children has_children
Has children?
Definition: tree.h:286
hubbub_tree_create_text create_text
Create text.
Definition: tree.h:277
hubbub_tree_ref_node ref_node
Reference node.
Definition: tree.h:278
hubbub_tree_append_child append_child
Append child.
Definition: tree.h:280
hubbub_tree_get_parent get_parent
Get parent.
Definition: tree.h:285
hubbub_tree_remove_child remove_child
Remove child.
Definition: tree.h:282
void * ctx
Context pointer.
Definition: tree.h:292
hubbub_tree_create_element create_element
Create element.
Definition: tree.h:276
hubbub_tree_create_comment create_comment
Create comment.
Definition: tree.h:274
hubbub_tree_unref_node unref_node
Unreference node.
Definition: tree.h:279
hubbub_error(* hubbub_tree_unref_node)(void *ctx, void *node)
Decrease a node's reference count.
Definition: tree.h:96
struct hubbub_tree_handler hubbub_tree_handler
Hubbub tree handler.
hubbub_error(* hubbub_tree_has_children)(void *ctx, void *node, bool *result)
Determine if a node has children.
Definition: tree.h:208
hubbub_error(* hubbub_tree_remove_child)(void *ctx, void *parent, void *child, void **result)
Remove a node from another's child list.
Definition: tree.h:147
hubbub_error(* hubbub_tree_form_associate)(void *ctx, void *form, void *node)
Associate a node with a form.
Definition: tree.h:220
hubbub_error(* hubbub_tree_ref_node)(void *ctx, void *node)
Increase a node's reference count.
Definition: tree.h:83
hubbub_error(* hubbub_tree_create_text)(void *ctx, const hubbub_string *data, void **result)
Create a text node.
Definition: tree.h:70
hubbub_error(* hubbub_tree_create_element)(void *ctx, const hubbub_tag *tag, void **result)
Create an element node.
Definition: tree.h:56
hubbub_error(* hubbub_tree_clone_node)(void *ctx, void *node, bool deep, void **result)
Clone a node.
Definition: tree.h:163
hubbub_error(* hubbub_tree_set_quirks_mode)(void *ctx, hubbub_quirks_mode mode)
Notification of the quirks mode of a document.
Definition: tree.h:245
hubbub_error(* hubbub_tree_create_comment)(void *ctx, const hubbub_string *data, void **result)
Create a comment node.
Definition: tree.h:28
hubbub_error(* hubbub_tree_reparent_children)(void *ctx, void *node, void *new_parent)
Move all the children of one node to another.
Definition: tree.h:176
hubbub_error(* hubbub_tree_append_child)(void *ctx, void *parent, void *child, void **result)
Append a node to the end of another's child list.
Definition: tree.h:111
hubbub_error(* hubbub_tree_get_parent)(void *ctx, void *node, bool element_only, void **result)
Retrieve the parent of a node.
Definition: tree.h:195
hubbub_error(* hubbub_tree_encoding_change)(void *ctx, const char *encname)
Notification that a potential encoding change is required.
Definition: tree.h:258
hubbub_error(* hubbub_tree_add_attributes)(void *ctx, void *node, const hubbub_attribute *attributes, uint32_t n_attributes)
Add attributes to a node.
Definition: tree.h:233
hubbub_error(* hubbub_tree_create_doctype)(void *ctx, const hubbub_doctype *doctype, void **result)
Create a doctype node.
Definition: tree.h:42
hubbub_error(* hubbub_tree_complete_script)(void *ctx, void *script)
Complete script processing.
Definition: tree.h:268
hubbub_error(* hubbub_tree_insert_before)(void *ctx, void *parent, void *child, void *ref_child, void **result)
Insert a node into another's child list.
Definition: tree.h:130
#define mode(x)
hubbub_quirks_mode
Quirks mode flag.
Definition: types.h:42