diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2018-01-20 10:22:55 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2018-01-21 10:38:48 +0000 |
commit | e28c8c517ef1e89638de059c5f8da6cb8dab0adc (patch) | |
tree | c744435d4010a632b7fda19c01d03650f15e36dc /include/dom | |
parent | 9158d4bedb8b16b8bc413c365a70321db6fbb1cd (diff) | |
download | libdom-dsilvers/forms1.tar.gz libdom-dsilvers/forms1.tar.bz2 |
Add HTMLFormControlsCollection and RadioNodeListdsilvers/forms1
These are a necessary step on the way to libdom being able to
manage the content and behaviours of web forms.
Diffstat (limited to 'include/dom')
-rw-r--r-- | include/dom/dom.h | 2 | ||||
-rw-r--r-- | include/dom/html/html_form_controls_collection.h | 38 | ||||
-rw-r--r-- | include/dom/html/html_form_element.h | 4 | ||||
-rw-r--r-- | include/dom/html/html_radio_nodelist.h | 33 |
4 files changed, 75 insertions, 2 deletions
diff --git a/include/dom/dom.h b/include/dom/dom.h index 0740fe9..26f139c 100644 --- a/include/dom/dom.h +++ b/include/dom/dom.h @@ -40,6 +40,8 @@ /* DOM HTML headers */ #include <dom/html/html_collection.h> +#include <dom/html/html_radio_nodelist.h> +#include <dom/html/html_form_controls_collection.h> #include <dom/html/html_document.h> #include <dom/html/html_element.h> #include <dom/html/html_html_element.h> diff --git a/include/dom/html/html_form_controls_collection.h b/include/dom/html/html_form_controls_collection.h new file mode 100644 index 0000000..23a1725 --- /dev/null +++ b/include/dom/html/html_form_controls_collection.h @@ -0,0 +1,38 @@ +/* + * This file is part of libdom. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2018 Daniel Silverstone <dsilvers@netsurf-browser.org> + */ + +#ifndef dom_html_form_controls_collection_h_ +#define dom_html_form_controls_collection_h_ + +#include <dom/core/exceptions.h> +#include <dom/core/string.h> + +struct dom_node; +struct dom_html_radionodelist; + +typedef struct dom_html_collection dom_html_form_controls_collection; + +#define dom_html_form_controls_collection_get_length(col, len) \ + dom_html_collection_get_length((dom_html_collection *)(col), (len)) + +#define dom_html_form_controls_collection_item(col, index, node) \ + dom_html_collection((dom_html_collection *)(col), (index), (node)) + +#define dom_html_form_controls_collection_named_item(col, name, node) \ + dom_html_collection((dom_html_collection *)(col), (name), (node)) + +dom_exception dom_html_form_controls_collection_named_items(dom_html_form_controls_collection *col, + dom_string *name, struct dom_html_radionodelist **nodes); + +#define dom_html_form_controls_collection_ref(col) \ + dom_html_collection_ref((dom_html_collection *)(col)) + +#define dom_html_form_controls_collection_unref(col) \ + dom_html_collection_unref((dom_html_collection *)(col)) + +#endif + diff --git a/include/dom/html/html_form_element.h b/include/dom/html/html_form_element.h index 81637a3..fe4bf3f 100644 --- a/include/dom/html/html_form_element.h +++ b/include/dom/html/html_form_element.h @@ -11,12 +11,12 @@ #include <dom/core/exceptions.h> #include <dom/core/string.h> -struct dom_html_collection; +#include <dom/html/html_form_controls_collection.h> typedef struct dom_html_form_element dom_html_form_element; dom_exception dom_html_form_element_get_elements(dom_html_form_element *ele, - struct dom_html_collection **col); + dom_html_form_controls_collection **col); dom_exception dom_html_form_element_get_length(dom_html_form_element *ele, uint32_t *len); diff --git a/include/dom/html/html_radio_nodelist.h b/include/dom/html/html_radio_nodelist.h new file mode 100644 index 0000000..c15ec7c --- /dev/null +++ b/include/dom/html/html_radio_nodelist.h @@ -0,0 +1,33 @@ +/* + * This file is part of libdom. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2018 Daniel Silverstone <dsilvers@netsurf-browser.org> + */ + +#ifndef dom_html_radio_nodelist_h_ +#define dom_html_radio_nodelist_h_ + +#include <dom/core/exceptions.h> +#include <dom/core/string.h> + +struct dom_node; + +typedef struct dom_html_radio_nodelist dom_html_radio_nodelist; + +dom_exception dom_html_radio_nodelist_get_length(dom_html_radio_nodelist *nodelist, + uint32_t *len); +dom_exception dom_html_radio_nodelist_item(dom_html_radio_nodelist *nodelist, + uint32_t index, struct dom_node **node); + +dom_exception dom_html_radio_nodelist_get_value(dom_html_radio_nodelist *nodelist, + dom_string **value); + +dom_exception dom_html_radio_nodelist_set_value(dom_html_radio_nodelist *nodelist, + dom_string *value); + +void dom_html_radio_nodelist_ref(dom_html_radio_nodelist *nodelist); +void dom_html_radio_nodelist_unref(dom_html_radio_nodelist *nodelist); + +#endif + |