libdom
Loading...
Searching...
No Matches
Functions
html_option_element.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <dom/dom.h>
#include <dom/html/html_option_element.h>
#include <dom/html/html_select_element.h>
#include "html/html_document.h"
#include "html/html_option_element.h"
#include "core/node.h"
#include "core/attr.h"
#include "utils/utils.h"

Functions

dom_exception _dom_html_option_element_create (struct dom_html_element_create_params *params, struct dom_html_option_element **ele)
 
dom_exception _dom_html_option_element_initialise (struct dom_html_element_create_params *params, struct dom_html_option_element *ele)
 
void _dom_html_option_element_finalise (struct dom_html_option_element *ele)
 
void _dom_html_option_element_destroy (struct dom_html_option_element *ele)
 
dom_exception dom_html_option_element_get_form (dom_html_option_element *option, dom_html_form_element **form)
 
dom_exception dom_html_option_element_get_default_selected (dom_html_option_element *option, bool *default_selected)
 
dom_exception dom_html_option_element_set_default_selected (dom_html_option_element *option, bool default_selected)
 
dom_exception dom_html_option_element_get_text (dom_html_option_element *option, dom_string **text)
 
dom_exception dom_html_option_element_get_index (dom_html_option_element *option, int32_t *index)
 
dom_exception dom_html_option_element_get_disabled (dom_html_option_element *ele, bool *disabled)
 
dom_exception dom_html_option_element_set_disabled (dom_html_option_element *ele, bool disabled)
 
dom_exception dom_html_option_element_get_label (dom_html_option_element *option, dom_string **label)
 
dom_exception dom_html_option_element_set_label (dom_html_option_element *option, dom_string *label)
 
dom_exception dom_html_option_element_get_selected (dom_html_option_element *ele, bool *selected)
 
dom_exception dom_html_option_element_set_selected (dom_html_option_element *ele, bool selected)
 
dom_exception dom_html_option_element_get_value (dom_html_option_element *option, dom_string **value)
 
dom_exception dom_html_option_element_set_value (dom_html_option_element *option, dom_string *value)
 
dom_exception _dom_html_option_element_parse_attribute (dom_element *ele, dom_string *name, dom_string *value, dom_string **parsed)
 
void _dom_virtual_html_option_element_destroy (dom_node_internal *node)
 
dom_exception _dom_html_option_element_copy (dom_node_internal *old, dom_node_internal **copy)
 
dom_exception _dom_html_option_element_copy_internal (dom_html_option_element *old, dom_html_option_element *new)
 

Function Documentation

◆ _dom_html_option_element_copy()

dom_exception _dom_html_option_element_copy ( dom_node_internal old,
dom_node_internal **  copy 
)

◆ _dom_html_option_element_copy_internal()

dom_exception _dom_html_option_element_copy_internal ( dom_html_option_element old,
dom_html_option_element new 
)

◆ _dom_html_option_element_create()

dom_exception _dom_html_option_element_create ( struct dom_html_element_create_params params,
struct dom_html_option_element **  ele 
)

Create a dom_html_option_element object

Parameters
paramsThe html element creation parameters
eleThe returned element object
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ _dom_html_option_element_destroy()

void _dom_html_option_element_destroy ( struct dom_html_option_element ele)

Destroy a dom_html_option_element object

Parameters
eleThe dom_html_option_element object

◆ _dom_html_option_element_finalise()

void _dom_html_option_element_finalise ( struct dom_html_option_element ele)

Finalise a dom_html_option_element object

Parameters
eleThe dom_html_option_element object

◆ _dom_html_option_element_initialise()

dom_exception _dom_html_option_element_initialise ( struct dom_html_element_create_params params,
struct dom_html_option_element ele 
)

Initialise a dom_html_option_element object

Parameters
paramsThe html element creation parameters
eleThe dom_html_option_element object
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ _dom_html_option_element_parse_attribute()

dom_exception _dom_html_option_element_parse_attribute ( dom_element ele,
dom_string name,
dom_string value,
dom_string **  parsed 
)
Todo:
Find some way to do the equiv for default_selected to be false instead of true. Some end-tag hook in the binding perhaps?

◆ _dom_virtual_html_option_element_destroy()

void _dom_virtual_html_option_element_destroy ( dom_node_internal node)

◆ dom_html_option_element_get_default_selected()

dom_exception dom_html_option_element_get_default_selected ( dom_html_option_element option,
bool *  default_selected 
)

Get the defaultSelected property

Parameters
optionThe dom_html_option_element object
default_selectedPointer to location to receive value
Returns
DOM_NO_ERR on success, appropriate error otherwise.

◆ dom_html_option_element_get_disabled()

dom_exception dom_html_option_element_get_disabled ( dom_html_option_element ele,
bool *  disabled 
)

Get the disabled property

Parameters
eleThe dom_html_option_element object
disabledThe returned status
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_option_element_get_form()

dom_exception dom_html_option_element_get_form ( dom_html_option_element option,
dom_html_form_element **  form 
)

◆ dom_html_option_element_get_index()

dom_exception dom_html_option_element_get_index ( dom_html_option_element option,
int32_t *  index 
)

Obtain the index of this option in its parent

Parameters
optionThe dom_html_option_element object
indexPointer to receive zero-based index
Returns
DOM_NO_ERR on success, appropriate error otherwise.

◆ dom_html_option_element_get_label()

dom_exception dom_html_option_element_get_label ( dom_html_option_element option,
dom_string **  label 
)

Get the label property

Parameters
optionThe dom_html_option_element object
labelPointer to location to receive label
Returns
DOM_NO_ERR on success, appropriate error otherwise.

◆ dom_html_option_element_get_selected()

dom_exception dom_html_option_element_get_selected ( dom_html_option_element ele,
bool *  selected 
)

Get the selected property

Parameters
eleThe dom_html_option_element object
selectedThe returned status
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_option_element_get_text()

dom_exception dom_html_option_element_get_text ( dom_html_option_element option,
dom_string **  text 
)

Get the text contained in the option

Parameters
optionThe dom_html_option_element object
textPointer to location to receive text
Returns
DOM_NO_ERR on success, appropriate error otherwise

◆ dom_html_option_element_get_value()

dom_exception dom_html_option_element_get_value ( dom_html_option_element option,
dom_string **  value 
)

Get the value property

Parameters
optionThe dom_html_option_element object
valuePointer to location to receive property value
Returns
DOM_NO_ERR on success, appropriate error otherwise.

◆ dom_html_option_element_set_default_selected()

dom_exception dom_html_option_element_set_default_selected ( dom_html_option_element option,
bool  default_selected 
)

Set the defaultSelected property

Parameters
optionThe dom_html_option_element object
default_selectedNew value for property
Returns
DOM_NO_ERR on success, appropriate error otherwise.

◆ dom_html_option_element_set_disabled()

dom_exception dom_html_option_element_set_disabled ( dom_html_option_element ele,
bool  disabled 
)

Set the disabled property

Parameters
eleThe dom_html_option_element object
disabledThe status
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_option_element_set_label()

dom_exception dom_html_option_element_set_label ( dom_html_option_element option,
dom_string label 
)

Set the label property

Parameters
optionThe dom_html_option_element object
labelLabel value
Returns
DOM_NO_ERR on success, appropriate error otherwise.

◆ dom_html_option_element_set_selected()

dom_exception dom_html_option_element_set_selected ( dom_html_option_element ele,
bool  selected 
)

Set the selected property

Parameters
eleThe dom_html_option_element object
selectedThe status
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ dom_html_option_element_set_value()

dom_exception dom_html_option_element_set_value ( dom_html_option_element option,
dom_string value 
)

Set the value property

Parameters
optionThe dom_html_option_element object
valueProperty value
Returns
DOM_NO_ERR on success, appropriate error otherwise.