libdom
Loading...
Searching...
No Matches
text.h
Go to the documentation of this file.
1/*
2 * This file is part of libdom.
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
6 */
7
8#ifndef dom_internal_core_text_h_
9#define dom_internal_core_text_h_
10
11#include <stdbool.h>
12
13#include <dom/core/exceptions.h>
14#include <dom/core/text.h>
15
16#include "core/characterdata.h"
17
18struct dom_document;
19
29
30/* Constructor and Destructor */
32 dom_string *name, dom_string *value,
33 dom_text **result);
34
35void _dom_text_destroy(dom_text *text);
36
38 struct dom_document *doc, dom_node_type type,
39 dom_string *name, dom_string *value);
40
42
43
44/* Virtual functions for dom_text */
46 uint32_t offset, dom_text **result);
48 dom_text *text, bool *result);
50 dom_string **result);
52 dom_string *content, dom_text **result);
53
54#define DOM_TEXT_VTABLE \
55 _dom_text_split_text, \
56 _dom_text_get_is_element_content_whitespace, \
57 _dom_text_get_whole_text, \
58 _dom_text_replace_whole_text
59
60
61/* Following comes the protected vtable */
62void __dom_text_destroy(struct dom_node_internal *node);
64
65#define DOM_TEXT_PROTECT_VTABLE \
66 __dom_text_destroy, \
67 _dom_text_copy
68
69extern const struct dom_text_vtable text_vtable;
70
72#define dom_text_copy_internal(o, n) \
73 _dom_text_copy_internal((dom_text *) (o), (dom_text *) (n))
74
75#endif
dom_exception
Definition exceptions.h:24
dom_node_type
Definition node.h:56
dom_exception _dom_text_copy_internal(dom_text *old, dom_text *new)
Definition text.c:323
dom_exception _dom_text_initialise(dom_text *text, struct dom_document *doc, dom_node_type type, dom_string *name, dom_string *value)
Definition text.c:132
void _dom_text_destroy(dom_text *text)
Definition text.c:111
void _dom_text_finalise(dom_text *text)
Definition text.c:158
dom_exception _dom_text_get_whole_text(dom_text *text, dom_string **result)
Definition text.c:254
void __dom_text_destroy(struct dom_node_internal *node)
Definition text.c:297
dom_exception _dom_text_split_text(dom_text *text, uint32_t offset, dom_text **result)
Definition text.c:180
dom_exception _dom_text_create(struct dom_document *doc, dom_string *name, dom_string *value, dom_text **result)
Definition text.c:75
const struct dom_text_vtable text_vtable
Definition text.c:23
dom_exception _dom_text_get_is_element_content_whitespace(dom_text *text, bool *result)
Definition text.c:239
dom_exception _dom_text_copy(dom_node_internal *old, dom_node_internal **copy)
Definition text.c:303
dom_exception _dom_text_replace_whole_text(dom_text *text, dom_string *content, dom_text **result)
Definition text.c:273
Definition characterdata.h:18
Definition document.h:43
Definition node.h:54
Definition string.h:19
Definition text.h:20
Definition text.h:23
dom_characterdata base
Definition text.h:24
bool element_content_whitespace
Definition text.h:26