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_core_text_h_
9#define dom_core_text_h_
10
11#include <stdbool.h>
12
13#include <dom/core/exceptions.h>
15
17
18typedef struct dom_text dom_text;
19
20typedef struct dom_text_vtable {
22
24 uint32_t offset, struct dom_text **result);
26 struct dom_text *text, bool *result);
28 dom_string **result);
30 dom_string *content, struct dom_text **result);
32
33static inline dom_exception dom_text_split_text(struct dom_text *text,
34 uint32_t offset, struct dom_text **result)
35{
36 return ((dom_text_vtable *) ((dom_node *) text)->vtable)->
37 dom_text_split_text(text, offset, result);
38}
39#define dom_text_split_text(t, o, r) dom_text_split_text((dom_text *) (t), \
40 (uint32_t) (o), (dom_text **) (r))
41
43 struct dom_text *text, bool *result)
44{
45 return ((dom_text_vtable *) ((dom_node *) text)->vtable)->
47 result);
48}
49#define dom_text_get_is_element_content_whitespace(t, r) \
50 dom_text_get_is_element_content_whitespace((dom_text *) (t), \
51 (bool *) (r))
52
53static inline dom_exception dom_text_get_whole_text(struct dom_text *text,
54 dom_string **result)
55{
56 return ((dom_text_vtable *) ((dom_node *) text)->vtable)->
57 dom_text_get_whole_text(text, result);
58}
59#define dom_text_get_whole_text(t, r) dom_text_get_whole_text((dom_text *) (t), (r))
60
61static inline dom_exception dom_text_replace_whole_text(struct dom_text *text,
62 dom_string *content, struct dom_text **result)
63{
64 return ((dom_text_vtable *) ((dom_node *) text)->vtable)->
65 dom_text_replace_whole_text(text, content, result);
66}
67#define dom_text_replace_whole_text(t, c, r) dom_text_replace_whole_text( \
68 (dom_text *) (t), (c), (dom_text **) (r))
69
70#endif
dom_exception
Definition exceptions.h:24
#define dom_text_split_text(t, o, r)
Definition text.h:39
#define dom_text_get_whole_text(t, r)
Definition text.h:59
struct dom_text_vtable dom_text_vtable
#define dom_text_get_is_element_content_whitespace(t, r)
Definition text.h:49
#define dom_text_replace_whole_text(t, c, r)
Definition text.h:67
Definition characterdata.h:18
Definition characterdata.h:18
Definition node.h:79
Definition string.h:19
Definition text.h:20
struct dom_characterdata_vtable base
Definition text.h:21
dom_exception(* dom_text_split_text)(struct dom_text *text, uint32_t offset, struct dom_text **result)
Definition text.h:23
dom_exception(* dom_text_replace_whole_text)(struct dom_text *text, dom_string *content, struct dom_text **result)
Definition text.h:29
dom_exception(* dom_text_get_is_element_content_whitespace)(struct dom_text *text, bool *result)
Definition text.h:25
dom_exception(* dom_text_get_whole_text)(struct dom_text *text, dom_string **result)
Definition text.h:27
Definition text.h:23