]> git.sur5r.net Git - glabels/blob - libglabels/lgl-xml.h
Upload to unstable
[glabels] / libglabels / lgl-xml.h
1 /*
2  *  lgl-xml.h
3  *  Copyright (C) 2003-2010  Jim Evins <evins@snaught.com>.
4  *
5  *  This file is part of libglabels.
6  *
7  *  libglabels is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU Lesser General Public License as published by
9  *  the Free Software Foundation, either version 3 of the License, or
10  *  (at your option) any later version.
11  *
12  *  libglabels is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with libglabels.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #ifndef __LGL_XML_H__
22 #define __LGL_XML_H__
23
24 #include <glib.h>
25 #include <libxml/tree.h>
26
27 #include "lgl-units.h"
28
29 #define LGL_XML_NAME_SPACE "http://glabels.org/xmlns/3.0/"
30
31 G_BEGIN_DECLS
32
33 /*
34  * Get property functions
35  */
36 gchar *  lgl_xml_get_prop_string   (xmlNodePtr    node,
37                                     const gchar  *property,
38                                     const gchar  *default_val);
39
40 gchar *  lgl_xml_get_prop_i18n_string (xmlNodePtr    node,
41                                        const gchar  *property,
42                                        const gchar  *default_val);
43
44 gdouble  lgl_xml_get_prop_double   (xmlNodePtr    node,
45                                     const gchar  *property,
46                                     gdouble       default_val);
47
48 gboolean lgl_xml_get_prop_boolean  (xmlNodePtr    node,
49                                     const gchar  *property,
50                                     gboolean      default_val);
51
52 gint     lgl_xml_get_prop_int      (xmlNodePtr    node,
53                                     const gchar  *property,
54                                     gint          default_val);
55
56 guint    lgl_xml_get_prop_uint     (xmlNodePtr    node,
57                                     const gchar  *property,
58                                     guint         default_val);
59
60 gdouble  lgl_xml_get_prop_length   (xmlNodePtr    node,
61                                     const gchar  *property,
62                                     gdouble       default_val);
63
64
65 /*
66  * Set property functions
67  */
68 void     lgl_xml_set_prop_string   (xmlNodePtr    node,
69                                     const gchar  *property,
70                                     const gchar  *val);
71
72 void     lgl_xml_set_prop_double   (xmlNodePtr    node,
73                                     const gchar  *property,
74                                     gdouble       val);
75
76 void     lgl_xml_set_prop_boolean  (xmlNodePtr    node,
77                                     const gchar  *property,
78                                     gboolean      val);
79
80 void     lgl_xml_set_prop_int      (xmlNodePtr    node,
81                                     const gchar  *property,
82                                     gint          val);
83
84 void     lgl_xml_set_prop_uint_hex (xmlNodePtr    node,
85                                     const gchar  *property,
86                                     guint         val);
87
88 void     lgl_xml_set_prop_length   (xmlNodePtr    node,
89                                     const gchar  *property,
90                                     gdouble       val);
91
92 /*
93  * Other node functions
94  */
95 gboolean lgl_xml_is_node           (xmlNodePtr    node,
96                                     const gchar  *name);
97
98 gchar *  lgl_xml_get_node_content  (xmlNodePtr    node);
99
100 /*
101  * Misc functions
102  */
103 void     lgl_xml_set_default_units (lglUnits      units);
104
105 G_END_DECLS
106
107
108 #endif /* __LGL_XML_H__ */
109
110
111
112 /*
113  * Local Variables:       -- emacs
114  * mode: C                -- emacs
115  * c-basic-offset: 8      -- emacs
116  * tab-width: 8           -- emacs
117  * indent-tabs-mode: nil  -- emacs
118  * End:                   -- emacs
119  */