summaryrefslogtreecommitdiff
path: root/include/dom/html/html_element.h
blob: ea07c72528eec1c49634c8877baeebfb5f8ecb67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * This file is part of libdom.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
 */

#ifndef dom_html_element_h_
#define dom_html_element_h_

#include <dom/core/element.h>

typedef struct dom_html_element dom_html_element;

typedef struct dom_html_element_vtable {
        struct dom_element_vtable base;
        
        dom_exception (*dom_html_element_get_id)(struct dom_html_element *element,
                                                 dom_string **id);
        dom_exception (*dom_html_element_set_id)(struct dom_html_element *element,
                                                 dom_string *id);
} dom_html_element_vtable;

static inline dom_exception dom_html_element_get_id(struct dom_html_element *element,
                                                    dom_string **id)
{
        return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
                dom_html_element_get_id(element, id);
}
#define dom_html_element_get_id(e, id) dom_html_element_get_id( \
		(dom_html_element *) (e), (dom_string **) (id))

static inline dom_exception dom_html_element_set_id(struct dom_html_element *element,
                                                    dom_string *id)
{
        return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
                dom_html_element_set_id(element, id);
}
#define dom_html_element_set_id(e, id) dom_html_element_set_id( \
		(dom_html_element *) (e), (dom_string *) (id))

#endif