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

Macros

#define SIMPLE_GET(attr)
 
#define SIMPLE_SET(attr)
 
#define SIMPLE_GET_SET(attr)   SIMPLE_GET(attr) SIMPLE_SET(attr)
 

Functions

dom_exception _dom_html_input_element_create (struct dom_html_element_create_params *params, struct dom_html_input_element **ele)
 
dom_exception _dom_html_input_element_initialise (struct dom_html_element_create_params *params, struct dom_html_input_element *ele)
 
void _dom_html_input_element_finalise (struct dom_html_input_element *ele)
 
void _dom_html_input_element_destroy (struct dom_html_input_element *ele)
 
dom_exception dom_html_input_element_get_disabled (dom_html_input_element *ele, bool *disabled)
 
dom_exception dom_html_input_element_set_disabled (dom_html_input_element *ele, bool disabled)
 
dom_exception dom_html_input_element_get_read_only (dom_html_input_element *ele, bool *read_only)
 
dom_exception dom_html_input_element_set_read_only (dom_html_input_element *ele, bool read_only)
 
dom_exception dom_html_input_element_get_checked (dom_html_input_element *ele, bool *checked)
 
dom_exception dom_html_input_element_set_checked (dom_html_input_element *ele, bool checked)
 
dom_exception dom_html_input_element_get_default_value (dom_html_input_element *ele, dom_string **default_value)
 
dom_exception dom_html_input_element_set_default_value (dom_html_input_element *ele, dom_string *default_value)
 
dom_exception dom_html_input_element_get_default_checked (dom_html_input_element *ele, bool *default_checked)
 
dom_exception dom_html_input_element_set_default_checked (dom_html_input_element *ele, bool default_checked)
 
dom_exception _dom_html_input_element_parse_attribute (dom_element *ele, dom_string *name, dom_string *value, dom_string **parsed)
 
void _dom_virtual_html_input_element_destroy (dom_node_internal *node)
 
dom_exception _dom_html_input_element_copy (dom_node_internal *old, dom_node_internal **copy)
 
dom_exception _dom_html_input_element_copy_internal (dom_html_input_element *old, dom_html_input_element *new)
 
 SIMPLE_GET_SET (accept)
 
 SIMPLE_GET_SET (access_key)
 
 SIMPLE_GET_SET (align)
 
 SIMPLE_GET_SET (alt)
 
 SIMPLE_GET_SET (name)
 
 SIMPLE_GET_SET (src)
 
 SIMPLE_GET (type)
 
 SIMPLE_GET_SET (use_map)
 
 SIMPLE_GET_SET (value)
 
dom_exception dom_html_input_element_get_size (dom_html_input_element *input, dom_ulong *size)
 
dom_exception dom_html_input_element_set_size (dom_html_input_element *input, dom_ulong size)
 
dom_exception dom_html_input_element_get_tab_index (dom_html_input_element *input, int32_t *tab_index)
 
dom_exception dom_html_input_element_set_tab_index (dom_html_input_element *input, uint32_t tab_index)
 
dom_exception dom_html_input_element_get_max_length (dom_html_input_element *input, int32_t *max_length)
 
dom_exception dom_html_input_element_set_max_length (dom_html_input_element *input, uint32_t max_length)
 
dom_exception dom_html_input_element_get_form (dom_html_input_element *input, dom_html_form_element **form)
 
dom_exception _dom_html_input_element_set_form (dom_html_input_element *input, dom_html_form_element *form)
 
dom_exception dom_html_input_element_blur (dom_html_input_element *ele)
 
dom_exception dom_html_input_element_focus (dom_html_input_element *ele)
 
dom_exception dom_html_input_element_select (dom_html_input_element *ele)
 
dom_exception dom_html_input_element_click (dom_html_input_element *ele)
 

Macro Definition Documentation

◆ SIMPLE_GET

#define SIMPLE_GET ( attr)
Value:
dom_exception dom_html_input_element_get_##attr( \
dom_string **attr) \
{ \
dom_string *_memo_##attr; \
\
_memo_##attr = \
((struct dom_html_document *) \
((struct dom_node_internal *)element)->owner)->\
memoised[hds_##attr]; \
\
ret = dom_element_get_attribute(element, _memo_##attr, attr); \
\
return ret; \
}
dom_exception
Definition exceptions.h:24
#define dom_element_get_attribute(e, n, v)
Definition element.h:117
Definition html_document.h:19
dom_string ** memoised
Definition html_document.h:30
Definition html_input_element.h:15
Definition node.h:54
Definition string.h:19

◆ SIMPLE_GET_SET

#define SIMPLE_GET_SET ( attr)    SIMPLE_GET(attr) SIMPLE_SET(attr)

◆ SIMPLE_SET

#define SIMPLE_SET ( attr)
Value:
dom_exception dom_html_input_element_set_##attr( \
dom_string *attr) \
{ \
dom_string *_memo_##attr; \
\
_memo_##attr = \
((struct dom_html_document *) \
((struct dom_node_internal *)element)->owner)->\
memoised[hds_##attr]; \
\
ret = dom_element_set_attribute(element, _memo_##attr, attr); \
\
return ret; \
}
#define dom_element_set_attribute(e, n, v)
Definition element.h:127

Function Documentation

◆ _dom_html_input_element_copy()

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

◆ _dom_html_input_element_copy_internal()

dom_exception _dom_html_input_element_copy_internal ( dom_html_input_element * old,
dom_html_input_element * new )

◆ _dom_html_input_element_create()

dom_exception _dom_html_input_element_create ( struct dom_html_element_create_params * params,
struct dom_html_input_element ** ele )

Create a dom_html_input_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_input_element_destroy()

void _dom_html_input_element_destroy ( struct dom_html_input_element * ele)

Destroy a dom_html_input_element object

Parameters
eleThe dom_html_input_element object

◆ _dom_html_input_element_finalise()

void _dom_html_input_element_finalise ( struct dom_html_input_element * ele)

Finalise a dom_html_input_element object

Parameters
eleThe dom_html_input_element object

◆ _dom_html_input_element_initialise()

dom_exception _dom_html_input_element_initialise ( struct dom_html_element_create_params * params,
struct dom_html_input_element * ele )

Initialise a dom_html_input_element object

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

◆ _dom_html_input_element_parse_attribute()

dom_exception _dom_html_input_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_checked to be false instead of true. Some end-tag hook in the binding perhaps?

◆ _dom_html_input_element_set_form()

dom_exception _dom_html_input_element_set_form ( dom_html_input_element * input,
dom_html_form_element * form )

◆ _dom_virtual_html_input_element_destroy()

void _dom_virtual_html_input_element_destroy ( dom_node_internal * node)

◆ dom_html_input_element_blur()

dom_exception dom_html_input_element_blur ( dom_html_input_element * ele)

Blur this control

Parameters
eleThe form object
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.
Todo
Is this event (a) default (b) bubbling and (c) cancelable?

◆ dom_html_input_element_click()

dom_exception dom_html_input_element_click ( dom_html_input_element * ele)

Click this control

Parameters
eleThe form object
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

\This event bubbles & is cancelable src:Wikipedia

◆ dom_html_input_element_focus()

dom_exception dom_html_input_element_focus ( dom_html_input_element * ele)

Focus this control

Parameters
eleThe form object
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

\this event doesnt bubble and is non-cancelable src:wikipedia

◆ dom_html_input_element_get_checked()

dom_exception dom_html_input_element_get_checked ( dom_html_input_element * ele,
bool * checked )

Get the checked property

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

◆ dom_html_input_element_get_default_checked()

dom_exception dom_html_input_element_get_default_checked ( dom_html_input_element * ele,
bool * default_checked )

Get the defaultChecked property

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

◆ dom_html_input_element_get_default_value()

dom_exception dom_html_input_element_get_default_value ( dom_html_input_element * ele,
dom_string ** default_value )

Get the defaultValue property

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

◆ dom_html_input_element_get_disabled()

dom_exception dom_html_input_element_get_disabled ( dom_html_input_element * ele,
bool * disabled )

Get the disabled property

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

◆ dom_html_input_element_get_form()

dom_exception dom_html_input_element_get_form ( dom_html_input_element * input,
dom_html_form_element ** form )

◆ dom_html_input_element_get_max_length()

dom_exception dom_html_input_element_get_max_length ( dom_html_input_element * input,
int32_t * max_length )

◆ dom_html_input_element_get_read_only()

dom_exception dom_html_input_element_get_read_only ( dom_html_input_element * ele,
bool * read_only )

Get the readOnly property

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

◆ dom_html_input_element_get_size()

dom_exception dom_html_input_element_get_size ( dom_html_input_element * input,
dom_ulong * size )

◆ dom_html_input_element_get_tab_index()

dom_exception dom_html_input_element_get_tab_index ( dom_html_input_element * input,
int32_t * tab_index )

◆ dom_html_input_element_select()

dom_exception dom_html_input_element_select ( dom_html_input_element * ele)

Select this control

Parameters
eleThe form object
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

\this event bubbles and non-cancelable src:wikipedia

◆ dom_html_input_element_set_checked()

dom_exception dom_html_input_element_set_checked ( dom_html_input_element * ele,
bool checked )

Set the checked property

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

◆ dom_html_input_element_set_default_checked()

dom_exception dom_html_input_element_set_default_checked ( dom_html_input_element * ele,
bool default_checked )

Set the defaultChecked property

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

◆ dom_html_input_element_set_default_value()

dom_exception dom_html_input_element_set_default_value ( dom_html_input_element * ele,
dom_string * default_value )

Set the defaultValue property

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

◆ dom_html_input_element_set_disabled()

dom_exception dom_html_input_element_set_disabled ( dom_html_input_element * ele,
bool disabled )

Set the disabled property

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

◆ dom_html_input_element_set_max_length()

dom_exception dom_html_input_element_set_max_length ( dom_html_input_element * input,
uint32_t max_length )

◆ dom_html_input_element_set_read_only()

dom_exception dom_html_input_element_set_read_only ( dom_html_input_element * ele,
bool read_only )

Set the readOnly property

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

◆ dom_html_input_element_set_size()

dom_exception dom_html_input_element_set_size ( dom_html_input_element * input,
dom_ulong size )

◆ dom_html_input_element_set_tab_index()

dom_exception dom_html_input_element_set_tab_index ( dom_html_input_element * input,
uint32_t tab_index )

◆ SIMPLE_GET()

SIMPLE_GET ( type )

◆ SIMPLE_GET_SET() [1/8]

SIMPLE_GET_SET ( accept )

◆ SIMPLE_GET_SET() [2/8]

SIMPLE_GET_SET ( access_key )

◆ SIMPLE_GET_SET() [3/8]

SIMPLE_GET_SET ( align )

◆ SIMPLE_GET_SET() [4/8]

SIMPLE_GET_SET ( alt )

◆ SIMPLE_GET_SET() [5/8]

SIMPLE_GET_SET ( name )

◆ SIMPLE_GET_SET() [6/8]

SIMPLE_GET_SET ( src )

◆ SIMPLE_GET_SET() [7/8]

SIMPLE_GET_SET ( use_map )

◆ SIMPLE_GET_SET() [8/8]

SIMPLE_GET_SET ( value )