Fix:map_csv:Disable default notification of each deleted item.
[profile/ivi/navit.git] / navit / navit / xmlconfig.h
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2008 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public License
7  * version 2 as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA  02110-1301, USA.
18  */
19
20 #ifndef NAVIT_XMLCONFIG_H
21 #define NAVIT_XMLCONFIG_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 typedef void *(*object_func_new)(struct attr *parent, struct attr **attrs);
28 typedef int (*object_func_get_attr)(void *, enum attr_type type, struct attr *attr, struct attr_iter *iter);
29 typedef struct attr_iter *(*object_func_iter_new)(void *);
30 typedef void (*object_func_iter_destroy)(struct attr_iter *);
31 typedef int (*object_func_set_attr)(void *, struct attr *attr);
32 typedef int (*object_func_add_attr)(void *, struct attr *attr);
33 typedef int (*object_func_remove_attr)(void *, struct attr *attr);
34 typedef int (*object_func_init)(void *);
35 typedef void (*object_func_destroy)(void *);
36 typedef void *(*object_func_dup)(void *);
37 typedef void *(*object_func_ref)(void *);
38 typedef void *(*object_func_unref)(void *);
39
40
41 struct object_func {
42         enum attr_type type;
43         void *(*create)(struct attr *parent, struct attr **attrs);
44         int (*get_attr)(void *, enum attr_type type, struct attr *attr, struct attr_iter *iter);
45         struct attr_iter *(*iter_new)(void *);
46         void (*iter_destroy)(struct attr_iter *);
47         int (*set_attr)(void *, struct attr *attr);
48         int (*add_attr)(void *, struct attr *attr);
49         int (*remove_attr)(void *, struct attr *attr);
50         int (*init)(void *);
51         void (*destroy)(void *);
52         void *(*dup)(void *);
53         void *(*ref)(void *);
54         void *(*unref)(void *);
55 };
56
57 extern struct object_func map_func, mapset_func, navit_func, tracking_func, vehicle_func;
58
59 #define HAS_OBJECT_FUNC(x) ((x) == attr_map || (x) == attr_mapset || (x) == attr_navit || (x) == attr_trackingo || (x) == attr_vehicle)
60
61 struct navit_object {
62         struct object_func *func;
63         int refcount;
64 };
65
66
67 typedef GError xmlerror;
68
69 extern const int xml_attr_distance;
70
71 /* prototypes */
72 enum attr_type;
73 struct object_func *object_func_lookup(enum attr_type type);
74 void xml_parse_text(const char *document, void *data, void (*start)(void *, const char *, const char **, const char **, void *, void *), void (*end)(void *, const char *, void *, void *), void (*text)(void *, const char *, int, void *, void *));
75 gboolean config_load(const char *filename, xmlerror **error);
76 //static void xinclude(GMarkupParseContext *context, const gchar **attribute_names, const gchar **attribute_values, struct xmldocument *doc_old, xmlerror **error);
77
78 /* end of prototypes */
79
80 #ifdef __cplusplus
81 }
82 #endif
83
84 #endif