libdom
Loading...
Searching...
No Matches
html_element.h File Reference
#include <dom/html/html_element.h>
#include <dom/html/html_elements.h>
#include "core/element.h"

Go to the source code of this file.

Classes

struct  dom_html_element
 
struct  dom_html_element_create_params
 

Macros

#define DOM_ELEMENT_VTABLE_HTML_ELEMENT
 
#define DOM_HTML_ELEMENT_PROTECT_VTABLE
 
#define DOM_HTML_ELEMENT_VTABLE
 
#define dom_html_element_copy_internal(o, n)
 

Functions

dom_exception _dom_html_element_create (struct dom_html_element_create_params *params, dom_html_element **result)
 
dom_exception _dom_html_element_initialise (struct dom_html_element_create_params *params, struct dom_html_element *el)
 
void _dom_html_element_finalise (struct dom_html_element *ele)
 
dom_exception _dom_html_element_get_attribute (struct dom_element *element, dom_string *name, dom_string **value)
 
dom_exception _dom_html_element_set_attribute (struct dom_element *element, dom_string *name, dom_string *value)
 
dom_exception _dom_html_element_remove_attribute (struct dom_element *element, dom_string *name)
 
dom_exception _dom_html_element_has_attribute (struct dom_element *element, dom_string *name, bool *result)
 
dom_exception _dom_html_element_get_elements_by_tag_name (struct dom_element *element, dom_string *name, struct dom_nodelist **result)
 
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)
 
void _dom_html_element_destroy (dom_node_internal *node)
 
dom_exception _dom_html_element_copy (dom_node_internal *old, dom_node_internal **copy)
 
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_class_name (dom_html_element *element, dom_string **class_name)
 
dom_exception _dom_html_element_set_class_name (dom_html_element *element, dom_string *class_name)
 
dom_exception _dom_html_element_get_tag_type (const dom_html_element *element, dom_html_element_type *type)
 
dom_exception dom_html_element_get_bool_property (dom_html_element *ele, const char *name, uint32_t len, bool *has)
 
dom_exception dom_html_element_set_bool_property (dom_html_element *ele, const char *name, uint32_t len, bool has)
 
dom_exception dom_html_element_get_int32_t_property (dom_html_element *ele, const char *name, uint32_t len, int32_t *value)
 
dom_exception dom_html_element_set_int32_t_property (dom_html_element *ele, const char *name, uint32_t len, uint32_t value)
 
dom_exception dom_html_element_get_dom_ulong_property (dom_html_element *ele, const char *name, uint32_t len, dom_ulong *value)
 
dom_exception dom_html_element_set_dom_ulong_property (dom_html_element *ele, const char *name, uint32_t len, dom_ulong value)
 
dom_exception _dom_html_element_copy_internal (dom_html_element *old, dom_html_element *new)
 

Variables

const struct dom_html_element_vtable _dom_html_element_vtable
 

Macro Definition Documentation

◆ DOM_ELEMENT_VTABLE_HTML_ELEMENT

#define DOM_ELEMENT_VTABLE_HTML_ELEMENT
Value:
dom_exception _dom_element_get_schema_type_info(struct dom_element *element, struct dom_type_info **result)
Definition element.c:1066
dom_exception _dom_element_has_class(struct dom_element *element, lwc_string *name, bool *match)
Definition element.c:1193
dom_exception _dom_element_get_classes(struct dom_element *element, lwc_string ***classes, uint32_t *n_classes)
Definition element.c:1165
dom_exception _dom_element_set_attribute_ns(struct dom_element *element, dom_string *namespace, dom_string *qname, dom_string *value)
Definition element.c:866
dom_exception _dom_element_get_attribute_node(struct dom_element *element, dom_string *name, struct dom_attr **result)
Definition element.c:734
dom_exception _dom_element_set_attribute_node_ns(struct dom_element *element, struct dom_attr *attr, struct dom_attr **result)
Definition element.c:967
dom_exception _dom_element_get_tag_name(struct dom_element *element, dom_string **name)
Definition element.c:667
dom_exception _dom_element_set_id_attribute(struct dom_element *element, dom_string *name, bool is_id)
Definition element.c:1090
dom_exception _dom_element_has_attribute_ns(struct dom_element *element, dom_string *namespace, dom_string *localname, bool *result)
Definition element.c:1048
dom_exception _dom_element_remove_attribute_node(struct dom_element *element, struct dom_attr *attr, struct dom_attr **result)
Definition element.c:778
dom_exception _dom_element_set_id_attribute_ns(struct dom_element *element, dom_string *namespace, dom_string *localname, bool is_id)
Definition element.c:1108
dom_exception _dom_element_set_id_attribute_node(struct dom_element *element, struct dom_attr *id_attr, bool is_id)
Definition element.c:1132
dom_exception _dom_element_get_attribute_node_ns(struct dom_element *element, dom_string *namespace, dom_string *localname, struct dom_attr **result)
Definition element.c:937
dom_exception _dom_element_get_attribute_ns(struct dom_element *element, dom_string *namespace, dom_string *localname, dom_string **value)
Definition element.c:830
dom_exception _dom_element_set_attribute_node(struct dom_element *element, struct dom_attr *attr, struct dom_attr **result)
Definition element.c:757
dom_exception _dom_element_remove_attribute_ns(struct dom_element *element, dom_string *namespace, dom_string *localname)
Definition element.c:914
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_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_remove_attribute(struct dom_element *element, dom_string *name)
Definition html_element.c:213
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_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_set_attribute(struct dom_element *element, dom_string *name, dom_string *value)
Definition html_element.c:195

◆ dom_html_element_copy_internal

#define dom_html_element_copy_internal ( o,
n )
Value:
dom_exception _dom_html_element_copy_internal(dom_html_element *old, dom_html_element *new)
Definition html_element.c:122
Definition html_element.h:22

◆ DOM_HTML_ELEMENT_PROTECT_VTABLE

#define DOM_HTML_ELEMENT_PROTECT_VTABLE
Value:
dom_exception _dom_html_element_copy(dom_node_internal *old, dom_node_internal **copy)
Definition html_element.c:101
void _dom_html_element_destroy(dom_node_internal *node)
Definition html_element.c:91

◆ DOM_HTML_ELEMENT_VTABLE

#define DOM_HTML_ELEMENT_VTABLE
Value:
dom_exception _dom_html_element_get_tag_type(const dom_html_element *element, dom_html_element_type *type)
dom_exception _dom_html_element_get_id(dom_html_element *element, dom_string **id)
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_set_title(dom_html_element *element, dom_string *title)
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_lang(dom_html_element *element, dom_string *lang)
dom_exception _dom_html_element_get_class_name(dom_html_element *element, dom_string **class_name)
dom_exception _dom_html_element_get_lang(dom_html_element *element, dom_string **lang)

Function Documentation

◆ _dom_html_element_copy()

dom_exception _dom_html_element_copy ( dom_node_internal * old,
dom_node_internal ** copy )

◆ _dom_html_element_copy_internal()

dom_exception _dom_html_element_copy_internal ( dom_html_element * old,
dom_html_element * new )

◆ _dom_html_element_create()

dom_exception _dom_html_element_create ( struct dom_html_element_create_params * params,
dom_html_element ** result )

◆ _dom_html_element_destroy()

void _dom_html_element_destroy ( dom_node_internal * node)

◆ _dom_html_element_finalise()

void _dom_html_element_finalise ( struct dom_html_element * ele)

◆ _dom_html_element_get_attribute()

dom_exception _dom_html_element_get_attribute ( struct dom_element * element,
dom_string * name,
dom_string ** value )

◆ _dom_html_element_get_class_name()

dom_exception _dom_html_element_get_class_name ( dom_html_element * element,
dom_string ** class_name )

◆ _dom_html_element_get_dir()

dom_exception _dom_html_element_get_dir ( dom_html_element * element,
dom_string ** dir )

◆ _dom_html_element_get_elements_by_tag_name()

dom_exception _dom_html_element_get_elements_by_tag_name ( struct dom_element * element,
dom_string * name,
struct dom_nodelist ** result )

Retrieve a list of descendant elements of an element which match a given tag name (caselessly)

Parameters
elementThe root of the subtree to search
nameThe tag name to match (or "*" for all tags)
resultPointer to location to receive result
Returns
DOM_NO_ERR.

The returned nodelist will have its reference count increased. It is the responsibility of the caller to unref the nodelist once it has finished with it.

◆ _dom_html_element_get_elements_by_tag_name_ns()

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 )

Retrieve a list of descendant elements of an element which match a given namespace/localname pair, caselessly.

Parameters
elementThe root of the subtree to search
namespaceThe namespace URI to match (or "*" for all)
localnameThe local name to match (or "*" for all)
resultPointer to location to receive result
Returns
DOM_NO_ERR on success, DOM_NOT_SUPPORTED_ERR if the implementation does not support the feature "XML" and the language exposed through the Document does not support Namespaces.

The returned nodelist will have its reference count increased. It is the responsibility of the caller to unref the nodelist once it has finished with it.

Todo
ensure XML feature is supported

◆ _dom_html_element_get_id()

dom_exception _dom_html_element_get_id ( dom_html_element * element,
dom_string ** id )

◆ _dom_html_element_get_lang()

dom_exception _dom_html_element_get_lang ( dom_html_element * element,
dom_string ** lang )

◆ _dom_html_element_get_tag_type()

dom_exception _dom_html_element_get_tag_type ( const dom_html_element * element,
dom_html_element_type * type )

◆ _dom_html_element_get_title()

dom_exception _dom_html_element_get_title ( dom_html_element * element,
dom_string ** title )

◆ _dom_html_element_has_attribute()

dom_exception _dom_html_element_has_attribute ( struct dom_element * element,
dom_string * name,
bool * result )

◆ _dom_html_element_initialise()

dom_exception _dom_html_element_initialise ( struct dom_html_element_create_params * params,
struct dom_html_element * el )

◆ _dom_html_element_remove_attribute()

dom_exception _dom_html_element_remove_attribute ( struct dom_element * element,
dom_string * name )

◆ _dom_html_element_set_attribute()

dom_exception _dom_html_element_set_attribute ( struct dom_element * element,
dom_string * name,
dom_string * value )

◆ _dom_html_element_set_class_name()

dom_exception _dom_html_element_set_class_name ( dom_html_element * element,
dom_string * class_name )

◆ _dom_html_element_set_dir()

dom_exception _dom_html_element_set_dir ( dom_html_element * element,
dom_string * dir )

◆ _dom_html_element_set_id()

dom_exception _dom_html_element_set_id ( dom_html_element * element,
dom_string * id )

◆ _dom_html_element_set_lang()

dom_exception _dom_html_element_set_lang ( dom_html_element * element,
dom_string * lang )

◆ _dom_html_element_set_title()

dom_exception _dom_html_element_set_title ( dom_html_element * element,
dom_string * title )

◆ dom_html_element_get_bool_property()

dom_exception dom_html_element_get_bool_property ( dom_html_element * ele,
const char * name,
uint32_t len,
bool * has )

Get the a bool property

Parameters
eleThe dom_html_element object
nameThe name of the attribute
lenThe length of ::name
hasThe returned status
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_element_get_dom_ulong_property()

dom_exception dom_html_element_get_dom_ulong_property ( dom_html_element * ele,
const char * name,
uint32_t len,
dom_ulong * value )

Get the a dom_ulong property

Parameters
eleThe dom_html_element object
nameThe name of the attribute
lenThe length of ::name
valueThe returned value, or -1 if prop. not set
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_element_get_int32_t_property()

dom_exception dom_html_element_get_int32_t_property ( dom_html_element * ele,
const char * name,
uint32_t len,
int32_t * value )

Get the a int32_t property

Parameters
eleThe dom_html_element object
nameThe name of the attribute
lenThe length of ::name
valueThe returned value, or -1 if prop. not set
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_element_set_bool_property()

dom_exception dom_html_element_set_bool_property ( dom_html_element * ele,
const char * name,
uint32_t len,
bool has )

Set a bool property

Parameters
eleThe dom_html_element object
nameThe name of the attribute
lenThe length of ::name
hasThe status
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_element_set_dom_ulong_property()

dom_exception dom_html_element_set_dom_ulong_property ( dom_html_element * ele,
const char * name,
uint32_t len,
dom_ulong value )

Set a dom_ulong property

Parameters
eleThe dom_html_element object
nameThe name of the attribute
lenThe length of ::name
valueThe value
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_element_set_int32_t_property()

dom_exception dom_html_element_set_int32_t_property ( dom_html_element * ele,
const char * name,
uint32_t len,
uint32_t value )

Set a int32_t property

Parameters
eleThe dom_html_element object
nameThe name of the attribute
lenThe length of ::name
valueThe value
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

Variable Documentation

◆ _dom_html_element_vtable

const struct dom_html_element_vtable _dom_html_element_vtable
extern