libdom
Loading...
Searching...
No Matches
html_element.h
Go to the documentation of this file.
1/*
2 * This file is part of libdom.
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
6 */
7
8#ifndef dom_internal_html_element_h_
9#define dom_internal_html_element_h_
10
13
14#include "core/element.h"
15
17
27
35
37 struct dom_html_element_create_params *params,
38 dom_html_element **result);
39
41 struct dom_html_element_create_params *params,
42 struct dom_html_element *el);
43
45
46/* Virtual functions */
48 struct dom_element *element,
49 dom_string *name, dom_string **value);
50
52 struct dom_element *element,
53 dom_string *name, dom_string *value);
54
56 struct dom_element *element,
57 dom_string *name);
58
60 struct dom_element *element,
61 dom_string *name, bool *result);
62
64 struct dom_element *element, dom_string *name,
65 struct dom_nodelist **result);
66
68 struct dom_element *element, dom_string *namespace,
69 dom_string *localname, struct dom_nodelist **result);
70
71
72/* The protected virtual functions */
75 dom_node_internal **copy);
76
77#define DOM_ELEMENT_VTABLE_HTML_ELEMENT \
78 _dom_element_get_tag_name, \
79 _dom_html_element_get_attribute, \
80 _dom_html_element_set_attribute, \
81 _dom_html_element_remove_attribute, \
82 _dom_element_get_attribute_node, \
83 _dom_element_set_attribute_node, \
84 _dom_element_remove_attribute_node, \
85 _dom_html_element_get_elements_by_tag_name, \
86 _dom_element_get_attribute_ns, \
87 _dom_element_set_attribute_ns, \
88 _dom_element_remove_attribute_ns, \
89 _dom_element_get_attribute_node_ns, \
90 _dom_element_set_attribute_node_ns, \
91 _dom_html_element_get_elements_by_tag_name_ns, \
92 _dom_html_element_has_attribute, \
93 _dom_element_has_attribute_ns, \
94 _dom_element_get_schema_type_info, \
95 _dom_element_set_id_attribute, \
96 _dom_element_set_id_attribute_ns, \
97 _dom_element_set_id_attribute_node, \
98 _dom_element_get_classes, \
99 _dom_element_has_class
100
101#define DOM_HTML_ELEMENT_PROTECT_VTABLE \
102 _dom_html_element_destroy, \
103 _dom_html_element_copy
104
105
106/* The API functions */
108 dom_string **id);
110 dom_string *id);
112 dom_string **title);
116 dom_string **lang);
118 dom_string *lang);
120 dom_string **dir);
122 dom_string *dir);
124 dom_string **class_name);
126 dom_string *class_name);
129
130#define DOM_HTML_ELEMENT_VTABLE \
131 _dom_html_element_get_id, \
132 _dom_html_element_set_id, \
133 _dom_html_element_get_title, \
134 _dom_html_element_set_title, \
135 _dom_html_element_get_lang, \
136 _dom_html_element_set_lang, \
137 _dom_html_element_get_dir, \
138 _dom_html_element_set_dir, \
139 _dom_html_element_get_class_name, \
140 _dom_html_element_set_class_name, \
141 _dom_html_element_get_tag_type
142
143/* Some common functions used by all child classes */
145 const char *name, uint32_t len, bool *has);
147 const char *name, uint32_t len, bool has);
148
150 const char *name, uint32_t len, int32_t *value);
152 const char *name, uint32_t len, uint32_t value);
153
155 const char *name, uint32_t len, dom_ulong *value);
157 const char *name, uint32_t len, dom_ulong value);
158
159/* Helper functions*/
161 dom_html_element *new);
162#define dom_html_element_copy_internal(o, n) _dom_html_element_copy_internal( \
163 (dom_html_element *) (o), (dom_html_element *) (n))
164
166
167#endif
168
dom_exception
Definition exceptions.h:24
dom_html_element_type
Definition html_elements.h:142
uint32_t dom_ulong
Definition inttypes.h:31
dom_exception _dom_html_element_get_tag_type(const dom_html_element *element, dom_html_element_type *type)
const struct dom_html_element_vtable _dom_html_element_vtable
Definition html_element.c:21
dom_exception _dom_html_element_get_attribute(struct dom_element *element, dom_string *name, dom_string **value)
Definition html_element.c:177
dom_exception _dom_html_element_copy_internal(dom_html_element *old, dom_html_element *new)
Definition html_element.c:122
dom_exception _dom_html_element_get_elements_by_tag_name(struct dom_element *element, dom_string *name, struct dom_nodelist **result)
Definition html_element.c:263
dom_exception _dom_html_element_copy(dom_node_internal *old, dom_node_internal **copy)
Definition html_element.c:101
dom_exception _dom_html_element_get_id(dom_html_element *element, dom_string **id)
dom_exception dom_html_element_set_int32_t_property(dom_html_element *ele, const char *name, uint32_t len, uint32_t value)
Definition html_element.c:510
dom_exception _dom_html_element_remove_attribute(struct dom_element *element, dom_string *name)
Definition html_element.c:213
dom_exception dom_html_element_set_dom_ulong_property(dom_html_element *ele, const char *name, uint32_t len, dom_ulong value)
Definition html_element.c:599
dom_exception _dom_html_element_set_dir(dom_html_element *element, dom_string *dir)
dom_exception _dom_html_element_get_dir(dom_html_element *element, dom_string **dir)
dom_exception _dom_html_element_set_class_name(dom_html_element *element, dom_string *class_name)
dom_exception dom_html_element_get_bool_property(dom_html_element *ele, const char *name, uint32_t len, bool *has)
Definition html_element.c:345
void _dom_html_element_finalise(struct dom_html_element *ele)
Definition html_element.c:82
dom_exception dom_html_element_get_dom_ulong_property(dom_html_element *ele, const char *name, uint32_t len, dom_ulong *value)
Definition html_element.c:548
dom_exception _dom_html_element_initialise(struct dom_html_element_create_params *params, struct dom_html_element *el)
Definition html_element.c:66
dom_exception _dom_html_element_has_attribute(struct dom_element *element, dom_string *name, bool *result)
Definition html_element.c:231
dom_exception dom_html_element_set_bool_property(dom_html_element *ele, const char *name, uint32_t len, bool has)
Definition html_element.c:384
dom_exception _dom_html_element_set_title(dom_html_element *element, dom_string *title)
dom_exception _dom_html_element_create(struct dom_html_element_create_params *params, dom_html_element **result)
Definition html_element.c:41
dom_exception dom_html_element_get_int32_t_property(dom_html_element *ele, const char *name, uint32_t len, int32_t *value)
Definition html_element.c:459
dom_exception _dom_html_element_set_id(dom_html_element *element, dom_string *id)
dom_exception _dom_html_element_get_title(dom_html_element *element, dom_string **title)
void _dom_html_element_destroy(dom_node_internal *node)
Definition html_element.c:91
dom_exception _dom_html_element_set_lang(dom_html_element *element, dom_string *lang)
dom_exception _dom_html_element_get_elements_by_tag_name_ns(struct dom_element *element, dom_string *namespace, dom_string *localname, struct dom_nodelist **result)
Definition html_element.c:298
dom_exception _dom_html_element_get_class_name(dom_html_element *element, dom_string **class_name)
dom_exception _dom_html_element_set_attribute(struct dom_element *element, dom_string *name, dom_string *value)
Definition html_element.c:195
dom_exception _dom_html_element_get_lang(dom_html_element *element, dom_string **lang)
Definition element.h:29
Definition html_document.h:19
dom_string * title
Definition html_document.h:22
Definition html_element.h:28
dom_string * prefix
Definition html_element.h:32
dom_html_element_type type
Definition html_element.h:29
dom_string * name
Definition html_element.h:31
struct dom_html_document * doc
Definition html_element.h:30
Definition html_element.h:16
Definition html_element.h:22
struct dom_element base
Definition html_element.h:23
dom_html_element_type type
Definition html_element.h:25
Definition node.h:54
Definition nodelist.c:26
Definition string.h:19