2008-12-07 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / droute / droute.h
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2008 Novell, Inc.
6  * Copyright 2008 Codethink Ltd.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 #ifndef _DROUTE_H
24 #define _DROUTE_H
25
26 #include <dbus/dbus.h>
27 #include <glib.h>
28
29 #include <droute/droute-variant.h>
30
31 typedef DBusMessage *(*DRouteFunction)         (DBusConnection *, DBusMessage *, void *);
32 typedef dbus_bool_t  (*DRoutePropertyFunction) (DBusMessageIter *, void *);
33
34 typedef void        *(*DRouteGetDatumFunction) (const char *, void *);
35
36 typedef struct _DRouteMethod DRouteMethod;
37 struct _DRouteMethod
38 {
39     DRouteFunction func;
40     const char *name;
41 };
42
43 typedef struct _DRouteProperty DRouteProperty;
44 struct _DRouteProperty
45 {
46     DRoutePropertyFunction get;
47     DRoutePropertyFunction set;
48     const char *name;
49 };
50
51 /*---------------------------------------------------------------------------*/
52
53 typedef struct _DRouteContext DRouteContext;
54
55 typedef struct _DRoutePath    DRoutePath;
56
57 /*---------------------------------------------------------------------------*/
58
59 DRouteContext *
60 droute_new      (DBusConnection *bus,
61                  const char *introspect_dir);
62 void
63 droute_free     (DRouteContext *cnx);
64
65 DRoutePath *
66 droute_add_one  (DRouteContext *cnx,
67                  const char    *path,
68                  const void    *data);
69
70 DRoutePath *
71 droute_add_many (DRouteContext *cnx,
72                  const char    *path,
73                  const void    *data,
74                  const DRouteGetDatumFunction get_datum);
75
76 void
77 droute_path_add_interface (DRoutePath *path,
78                            const char *name,
79                            const DRouteMethod   *methods,
80                            const DRouteProperty *properties);
81
82 #endif /* _DROUTE_H */