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