libdom
|
Go to the source code of this file.
Classes | |
struct | dom_attr_vtable |
Macros | |
#define | dom_attr_get_name(a, r) |
#define | dom_attr_get_specified(a, r) |
#define | dom_attr_get_value(a, r) |
#define | dom_attr_set_value(a, v) |
#define | dom_attr_get_owner_element(a, r) |
#define | dom_attr_get_schema_type_info(a, r) |
#define | dom_attr_is_id(a, r) |
Typedefs | |
typedef struct dom_attr | dom_attr |
typedef struct dom_attr_vtable | dom_attr_vtable |
Enumerations | |
enum | dom_attr_type { DOM_ATTR_UNSET = 0 , DOM_ATTR_STRING , DOM_ATTR_BOOL , DOM_ATTR_SHORT , DOM_ATTR_INTEGER } |
Functions | |
dom_attr_type | dom_attr_get_type (dom_attr *a) |
dom_exception | dom_attr_get_integer (dom_attr *a, uint32_t *value) |
dom_exception | dom_attr_set_integer (dom_attr *a, uint32_t value) |
dom_exception | dom_attr_get_short (dom_attr *a, unsigned short *value) |
dom_exception | dom_attr_set_short (dom_attr *a, unsigned short value) |
dom_exception | dom_attr_get_bool (dom_attr *a, bool *value) |
dom_exception | dom_attr_set_bool (dom_attr *a, bool value) |
void | dom_attr_mark_readonly (dom_attr *a) |
#define dom_attr_get_name | ( | a, | |
r ) |
#define dom_attr_get_owner_element | ( | a, | |
r ) |
#define dom_attr_get_schema_type_info | ( | a, | |
r ) |
#define dom_attr_get_specified | ( | a, | |
r ) |
#define dom_attr_get_value | ( | a, | |
r ) |
#define dom_attr_is_id | ( | a, | |
r ) |
#define dom_attr_set_value | ( | a, | |
v ) |
typedef struct dom_attr dom_attr |
typedef struct dom_attr_vtable dom_attr_vtable |
enum dom_attr_type |
dom_exception dom_attr_get_bool | ( | dom_attr * | a, |
bool * | value ) |
Get the bool value of this attribute
a | The attribute object |
value | The returned value |
dom_exception dom_attr_get_integer | ( | dom_attr * | a, |
uint32_t * | value ) |
Get the integer value of this attribute
a | The attribute object |
value | The returned value |
dom_exception dom_attr_get_short | ( | dom_attr * | a, |
unsigned short * | value ) |
Get the short value of this attribute
a | The attribute object |
value | The returned value |
dom_attr_type dom_attr_get_type | ( | dom_attr * | a | ) |
Following are our implementation specific APIs.
These APIs are defined for the purpose that there are some attributes in HTML and other DOM module whose type is not DOMString, but uint32_t or boolean, for those types of attributes, clients should call one of the following APIs to set it.
When an Attr node is created, its type is unset and it can be turned into any of the four types. Once the type is fixed by calling any of the four APIs: dom_attr_set_value dom_attr_set_integer dom_attr_set_short dom_attr_set_bool it can't be modified in future.
For integer/short/bool type of attributes, we provide no string repensentation of them, so when you call dom_attr_get_value on these three type of attribute nodes, you will always get a empty dom_string. If you want to do something with Attr node, you must know its type firstly by calling dom_attr_get_type before you decide to call other dom_attr_get_* functions.
Get the Attr Node type
a | The attribute node |
void dom_attr_mark_readonly | ( | dom_attr * | a | ) |
Set the node as a readonly attribute
a | The attribute |
dom_exception dom_attr_set_bool | ( | dom_attr * | a, |
bool | value ) |
Set the bool value of this attribute
a | The attribute object |
value | The new value |
dom_exception dom_attr_set_integer | ( | dom_attr * | a, |
uint32_t | value ) |
Set the integer value of this attribute
a | The attribute object |
value | The new value |
dom_exception dom_attr_set_short | ( | dom_attr * | a, |
unsigned short | value ) |
Set the short value of this attribute
a | The attribute object |
value | The new value |