libdom
Loading...
Searching...
No Matches
html_document.h File Reference
#include <dom/html/html_document.h>
#include <dom/html/html_element.h>
#include "core/document.h"
#include "html_document_strings.h"

Go to the source code of this file.

Classes

struct  dom_html_document
 

Macros

#define DOM_HTML_DOCUMENT_PROTECT_VTABLE
 
#define DOM_HTML_DOCUMENT_VTABLE
 
#define DOM_DOCUMENT_VTABLE_HTML
 

Functions

dom_exception _dom_html_document_create (dom_events_default_action_fetcher daf, void *daf_ctx, dom_html_document **doc)
 
dom_exception _dom_html_document_initialise (dom_html_document *doc, dom_events_default_action_fetcher daf, void *daf_ctx)
 
bool _dom_html_document_finalise (dom_html_document *doc)
 
void _dom_html_document_destroy (dom_node_internal *node)
 
dom_exception _dom_html_document_copy (dom_node_internal *old, dom_node_internal **copy)
 
dom_exception _dom_html_document_get_title (dom_html_document *doc, dom_string **title)
 
dom_exception _dom_html_document_set_title (dom_html_document *doc, dom_string *title)
 
dom_exception _dom_html_document_get_referrer (dom_html_document *doc, dom_string **referrer)
 
dom_exception _dom_html_document_get_domain (dom_html_document *doc, dom_string **domain)
 
dom_exception _dom_html_document_get_url (dom_html_document *doc, dom_string **url)
 
dom_exception _dom_html_document_get_body (dom_html_document *doc, struct dom_html_element **body)
 
dom_exception _dom_html_document_set_body (dom_html_document *doc, struct dom_html_element *body)
 
dom_exception _dom_html_document_get_images (dom_html_document *doc, struct dom_html_collection **col)
 
dom_exception _dom_html_document_get_applets (dom_html_document *doc, struct dom_html_collection **col)
 
dom_exception _dom_html_document_get_links (dom_html_document *doc, struct dom_html_collection **col)
 
dom_exception _dom_html_document_get_forms (dom_html_document *doc, struct dom_html_collection **col)
 
dom_exception _dom_html_document_get_anchors (dom_html_document *doc, struct dom_html_collection **col)
 
dom_exception _dom_html_document_get_cookie (dom_html_document *doc, dom_string **cookie)
 
dom_exception _dom_html_document_set_cookie (dom_html_document *doc, dom_string *cookie)
 
dom_exception _dom_html_document_open (dom_html_document *doc)
 
dom_exception _dom_html_document_close (dom_html_document *doc)
 
dom_exception _dom_html_document_write (dom_html_document *doc, dom_string *text)
 
dom_exception _dom_html_document_writeln (dom_html_document *doc, dom_string *text)
 
dom_exception _dom_html_document_get_elements_by_name (dom_html_document *doc, dom_string *name, struct dom_nodelist **list)
 
dom_exception _dom_html_document_create_element (dom_document *doc, dom_string *tag_name, dom_element **result)
 
dom_exception _dom_html_document_create_element_ns (dom_document *doc, dom_string *namespace, dom_string *qname, dom_element **result)
 
dom_exception _dom_html_document_get_elements_by_tag_name (dom_document *doc, dom_string *tagname, dom_nodelist **result)
 
dom_exception _dom_html_document_get_elements_by_tag_name_ns (dom_document *doc, dom_string *namespace, dom_string *localname, dom_nodelist **result)
 
dom_exception _dom_html_document_create_attribute (dom_document *doc, dom_string *name, dom_attr **result)
 
dom_exception _dom_html_document_create_attribute_ns (dom_document *doc, dom_string *namespace, dom_string *qname, dom_attr **result)
 
bool images_callback (struct dom_node_internal *node, void *ctx)
 
bool applets_callback (struct dom_node_internal *node, void *ctx)
 
bool applet_callback (struct dom_node_internal *node, void *ctx)
 
bool links_callback (struct dom_node_internal *node, void *ctx)
 
bool anchors_callback (struct dom_node_internal *node, void *ctx)
 

Macro Definition Documentation

◆ DOM_DOCUMENT_VTABLE_HTML

#define DOM_DOCUMENT_VTABLE_HTML

◆ DOM_HTML_DOCUMENT_PROTECT_VTABLE

#define DOM_HTML_DOCUMENT_PROTECT_VTABLE
Value:
dom_exception _dom_html_document_copy(dom_node_internal *old, dom_node_internal **copy)
Definition html_document.c:243
void _dom_html_document_destroy(dom_node_internal *node)
Definition html_document.c:235

◆ DOM_HTML_DOCUMENT_VTABLE

#define DOM_HTML_DOCUMENT_VTABLE
Value:
dom_exception _dom_html_document_set_body(dom_html_document *doc, struct dom_html_element *body)
Definition html_document.c:1160
dom_exception _dom_html_document_set_cookie(dom_html_document *doc, dom_string *cookie)
Definition html_document.c:1383
dom_exception _dom_html_document_get_links(dom_html_document *doc, struct dom_html_collection **col)
Definition html_document.c:1281
dom_exception _dom_html_document_get_domain(dom_html_document *doc, dom_string **domain)
Definition html_document.c:1088
dom_exception _dom_html_document_write(dom_html_document *doc, dom_string *text)
Definition html_document.c:1408
dom_exception _dom_html_document_get_cookie(dom_html_document *doc, dom_string **cookie)
Definition html_document.c:1374
dom_exception _dom_html_document_get_forms(dom_html_document *doc, struct dom_html_collection **col)
Definition html_document.c:1307
dom_exception _dom_html_document_writeln(dom_html_document *doc, dom_string *text)
Definition html_document.c:1418
dom_exception _dom_html_document_close(dom_html_document *doc)
Definition html_document.c:1401
dom_exception _dom_html_document_get_body(dom_html_document *doc, struct dom_html_element **body)
Definition html_document.c:1104
dom_exception _dom_html_document_open(dom_html_document *doc)
Definition html_document.c:1393
dom_exception _dom_html_document_get_elements_by_name(dom_html_document *doc, dom_string *name, struct dom_nodelist **list)
Definition html_document.c:1428
dom_exception _dom_html_document_get_referrer(dom_html_document *doc, dom_string **referrer)
Definition html_document.c:1080
dom_exception _dom_html_document_get_anchors(dom_html_document *doc, struct dom_html_collection **col)
Definition html_document.c:1359
dom_exception _dom_html_document_get_title(dom_html_document *doc, dom_string **title)
Definition html_document.c:1025
dom_exception _dom_html_document_get_applets(dom_html_document *doc, struct dom_html_collection **col)
Definition html_document.c:1236
dom_exception _dom_html_document_get_url(dom_html_document *doc, dom_string **url)
Definition html_document.c:1096
dom_exception _dom_html_document_get_images(dom_html_document *doc, struct dom_html_collection **col)
Definition html_document.c:1185
dom_exception _dom_html_document_set_title(dom_html_document *doc, dom_string *title)
Definition html_document.c:1069

Function Documentation

◆ _dom_html_document_close()

dom_exception _dom_html_document_close ( dom_html_document * doc)

◆ _dom_html_document_copy()

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

◆ _dom_html_document_create()

dom_exception _dom_html_document_create ( dom_events_default_action_fetcher daf,
void * daf_ctx,
dom_html_document ** doc )

◆ _dom_html_document_create_attribute()

dom_exception _dom_html_document_create_attribute ( dom_document * doc,
dom_string * name,
dom_attr ** result )

Create an attribute

Parameters
docThe document owning the attribute
nameThe name of the attribute
resultPointer to location to receive result
Returns
DOM_NO_ERR on success,

The constructed attribute will always be classified as 'specified'.

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

◆ _dom_html_document_create_attribute_ns()

dom_exception _dom_html_document_create_attribute_ns ( dom_document * doc,
dom_string * namespace,
dom_string * qname,
dom_attr ** result )

Create an attribute from the qualified name and namespace URI

Parameters
docThe document owning the attribute
namespaceThe namespace URI to use
qnameThe qualified name of the attribute
resultPointer to location to receive result
Returns
DOM_NO_ERR on success, DOM_NAMESPACE_ERR if ::qname is malformed, or it has a prefix and ::namespace is NULL, or ::qname has a prefix "xml" and ::namespace is not "http://www.w3.org/XML/1998/namespace", or ::qname has a prefix "xmlns" and ::namespace is not "http://www.w3.org/2000/xmlns", or ::namespace is "http://www.w3.org/2000/xmlns" and ::qname is not (or is not prefixed by) "xmlns", DOM_NOT_SUPPORTED_ERR if ::doc does not support the "XML" feature.

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

◆ _dom_html_document_create_element()

dom_exception _dom_html_document_create_element ( dom_document * doc,
dom_string * tag_name,
dom_element ** result )

◆ _dom_html_document_create_element_ns()

dom_exception _dom_html_document_create_element_ns ( dom_document * doc,
dom_string * namespace,
dom_string * qname,
dom_element ** result )

◆ _dom_html_document_destroy()

void _dom_html_document_destroy ( dom_node_internal * node)

◆ _dom_html_document_finalise()

bool _dom_html_document_finalise ( dom_html_document * doc)

◆ _dom_html_document_get_anchors()

dom_exception _dom_html_document_get_anchors ( dom_html_document * doc,
struct dom_html_collection ** col )

◆ _dom_html_document_get_applets()

dom_exception _dom_html_document_get_applets ( dom_html_document * doc,
struct dom_html_collection ** col )

◆ _dom_html_document_get_body()

dom_exception _dom_html_document_get_body ( dom_html_document * doc,
struct dom_html_element ** body )

◆ _dom_html_document_get_cookie()

dom_exception _dom_html_document_get_cookie ( dom_html_document * doc,
dom_string ** cookie )

◆ _dom_html_document_get_domain()

dom_exception _dom_html_document_get_domain ( dom_html_document * doc,
dom_string ** domain )

◆ _dom_html_document_get_elements_by_name()

dom_exception _dom_html_document_get_elements_by_name ( dom_html_document * doc,
dom_string * name,
struct dom_nodelist ** list )

◆ _dom_html_document_get_elements_by_tag_name()

dom_exception _dom_html_document_get_elements_by_tag_name ( dom_document * doc,
dom_string * tagname,
dom_nodelist ** result )

Retrieve a list of all elements with a given tag name

Parameters
docThe document to search in
tagnameThe tag name to search for ("*" for all)
resultPointer to location to receive result
Returns
DOM_NO_ERR.

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

◆ _dom_html_document_get_elements_by_tag_name_ns()

dom_exception _dom_html_document_get_elements_by_tag_name_ns ( dom_document * doc,
dom_string * namespace,
dom_string * localname,
dom_nodelist ** result )

Retrieve a list of all elements with a given local name and namespace URI

Parameters
docThe document to search in
namespaceThe namespace URI
localnameThe local name
resultPointer to location to receive result
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

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

◆ _dom_html_document_get_forms()

dom_exception _dom_html_document_get_forms ( dom_html_document * doc,
struct dom_html_collection ** col )

◆ _dom_html_document_get_images()

dom_exception _dom_html_document_get_images ( dom_html_document * doc,
struct dom_html_collection ** col )

◆ _dom_html_document_get_links()

dom_exception _dom_html_document_get_links ( dom_html_document * doc,
struct dom_html_collection ** col )

◆ _dom_html_document_get_referrer()

dom_exception _dom_html_document_get_referrer ( dom_html_document * doc,
dom_string ** referrer )

◆ _dom_html_document_get_title()

dom_exception _dom_html_document_get_title ( dom_html_document * doc,
dom_string ** title )

Get the title of this HTMLDocument

Parameters
docThe document object
titleThe reutrned title string
Returns
DOM_NO_ERR on success, appropriated dom_exception on failure.
Note
: this method find a title for the document as following:
  1. If there is a title in the document object set by dom_html_document_set_title, then use it;
  2. If there is no such one, find the <title> element and use its text as the returned title.

◆ _dom_html_document_get_url()

dom_exception _dom_html_document_get_url ( dom_html_document * doc,
dom_string ** url )

◆ _dom_html_document_initialise()

dom_exception _dom_html_document_initialise ( dom_html_document * doc,
dom_events_default_action_fetcher daf,
void * daf_ctx )

◆ _dom_html_document_open()

dom_exception _dom_html_document_open ( dom_html_document * doc)

◆ _dom_html_document_set_body()

dom_exception _dom_html_document_set_body ( dom_html_document * doc,
struct dom_html_element * body )

◆ _dom_html_document_set_cookie()

dom_exception _dom_html_document_set_cookie ( dom_html_document * doc,
dom_string * cookie )

◆ _dom_html_document_set_title()

dom_exception _dom_html_document_set_title ( dom_html_document * doc,
dom_string * title )

◆ _dom_html_document_write()

dom_exception _dom_html_document_write ( dom_html_document * doc,
dom_string * text )

◆ _dom_html_document_writeln()

dom_exception _dom_html_document_writeln ( dom_html_document * doc,
dom_string * text )

◆ anchors_callback()

bool anchors_callback ( struct dom_node_internal * node,
void * ctx )

Callback for creating the anchors collection

Parameters
nodeThe dom_node_internal object
ctxThe dom_html_document object (void *)
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ applet_callback()

bool applet_callback ( struct dom_node_internal * node,
void * ctx )

◆ applets_callback()

bool applets_callback ( struct dom_node_internal * node,
void * ctx )

Callback for creating the applets collection

Parameters
nodeThe dom_node_internal object
ctxThe dom_html_document object (void *)
Returns
true if node is an applet object

◆ images_callback()

bool images_callback ( struct dom_node_internal * node,
void * ctx )

Callback for creating the images collection

Parameters
nodeThe dom_node_internal object
ctxThe dom_html_document object (void *)
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ links_callback()

bool links_callback ( struct dom_node_internal * node,
void * ctx )

Callback for creating the links collection

Parameters
nodeThe dom_node_internal object
ctxThe dom_html_document object (void *)
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.