diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2012-02-05 14:33:17 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2012-02-05 14:33:17 +0000 |
commit | 7b193ec6c254488870c0360a2a5bf004d1d848b4 (patch) | |
tree | 8b666110763d6da3297d19a020b9eb5279caf051 /src/html/html_element.h | |
parent | 941e2f52a2b3d4bf0febeff73301c89aab625ae0 (diff) | |
download | libdom-7b193ec6c254488870c0360a2a5bf004d1d848b4.tar.gz libdom-7b193ec6c254488870c0360a2a5bf004d1d848b4.tar.bz2 |
A bunch of panel beating:
* HTMLElement and HTMLDocument now have vtables
* All HTML nodes require an HTMLDocument to create
* Miscellaneous other cleanups
svn path=/trunk/libdom/; revision=13424
Diffstat (limited to 'src/html/html_element.h')
-rw-r--r-- | src/html/html_element.h | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/html/html_element.h b/src/html/html_element.h index e183ec3..3194cba 100644 --- a/src/html/html_element.h +++ b/src/html/html_element.h @@ -12,6 +12,8 @@ #include "core/element.h" +struct dom_html_document; + /** * The dom_html_element class * @@ -21,22 +23,59 @@ struct dom_html_element { /**< The base class */ }; -dom_exception _dom_html_element_initialise(struct dom_document *doc, +dom_exception _dom_html_element_create(struct dom_html_document *doc, + dom_string *name, dom_string *namespace, + dom_string *prefix, dom_html_element **result); + +dom_exception _dom_html_element_initialise(struct dom_html_document *doc, struct dom_html_element *el, dom_string *name, dom_string *namespace, dom_string *prefix); void _dom_html_element_finalise(struct dom_html_element *ele); /* The protected virtual functions */ -void _dom_virtual_html_element_destroy(dom_node_internal *node); +void _dom_html_element_destroy(dom_node_internal *node); dom_exception _dom_html_element_copy(dom_node_internal *old, dom_node_internal **copy); +#define DOM_HTML_ELEMENT_PROTECT_VTABLE \ + _dom_html_element_destroy, \ + _dom_html_element_copy + + /* The API functions */ dom_exception _dom_html_element_get_id(dom_html_element *element, dom_string **id); 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); +dom_exception _dom_html_element_set_title(dom_html_element *element, + dom_string *title); +dom_exception _dom_html_element_get_lang(dom_html_element *element, + dom_string **lang); +dom_exception _dom_html_element_set_lang(dom_html_element *element, + dom_string *lang); +dom_exception _dom_html_element_get_dir(dom_html_element *element, + dom_string **dir); +dom_exception _dom_html_element_set_dir(dom_html_element *element, + dom_string *dir); +dom_exception _dom_html_element_get_classname(dom_html_element *element, + dom_string **classname); +dom_exception _dom_html_element_set_classname(dom_html_element *element, + dom_string *classname); + +#define DOM_HTML_ELEMENT_VTABLE \ + _dom_html_element_get_id, \ + _dom_html_element_set_id, \ + _dom_html_element_get_title, \ + _dom_html_element_set_title, \ + _dom_html_element_get_lang, \ + _dom_html_element_set_lang, \ + _dom_html_element_get_dir, \ + _dom_html_element_set_dir, \ + _dom_html_element_get_classname, \ + _dom_html_element_set_classname /* Some common functions used by all child classes */ dom_exception dom_html_element_get_bool_property(dom_html_element *ele, |