Modified to support char type.
[platform/upstream/dbus.git] / glib / dbus-gidl.h
1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-gidl.h data structure describing an interface, to be generated from IDL
3  *             or something
4  *
5  * Copyright (C) 2003  Red Hat, Inc.
6  *
7  * Licensed under the Academic Free License version 2.0
8  * 
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  * 
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22  *
23  */
24 #ifndef DBUS_GLIB_IDL_H
25 #define DBUS_GLIB_IDL_H
26
27 #ifndef DOXYGEN_SHOULD_SKIP_THIS
28
29 #include <dbus/dbus.h>
30 #include <glib-object.h>
31
32 G_BEGIN_DECLS
33
34 typedef struct BaseInfo      BaseInfo;
35 typedef struct NodeInfo      NodeInfo;
36 typedef struct InterfaceInfo InterfaceInfo;
37 typedef struct MethodInfo    MethodInfo;
38 typedef struct SignalInfo    SignalInfo;
39 typedef struct ArgInfo       ArgInfo;
40
41 typedef enum
42 {
43   ARG_IN,
44   ARG_OUT
45 } ArgDirection;
46
47 typedef enum
48 {
49   INFO_TYPE_NODE,
50   INFO_TYPE_INTERFACE,
51   INFO_TYPE_METHOD,
52   INFO_TYPE_SIGNAL,
53   INFO_TYPE_ARG
54
55 } InfoType;
56
57 BaseInfo*      base_info_ref              (BaseInfo      *info);
58 void           base_info_unref            (BaseInfo      *info);
59 InfoType       base_info_get_type         (BaseInfo      *info);
60 const char*    base_info_get_name         (BaseInfo      *info);
61 void           base_info_set_name         (BaseInfo      *info,
62                                            const char    *name);
63 GType          base_info_get_gtype        (void);
64 #define        BASE_INFO_TYPE             (base_info_get_gtype ())
65
66
67 NodeInfo*      node_info_new              (const char    *name);
68 NodeInfo*      node_info_ref              (NodeInfo      *info);
69 void           node_info_unref            (NodeInfo      *info);
70 const char*    node_info_get_name         (NodeInfo      *info);
71 GSList*        node_info_get_interfaces   (NodeInfo      *info);
72 GSList*        node_info_get_nodes        (NodeInfo      *info);
73 void           node_info_add_interface    (NodeInfo      *info,
74                                            InterfaceInfo *interface);
75 void           node_info_add_node         (NodeInfo      *info,
76                                            NodeInfo      *child);
77
78 InterfaceInfo* interface_info_new         (const char    *name);
79 InterfaceInfo* interface_info_ref         (InterfaceInfo *info);
80 void           interface_info_unref       (InterfaceInfo *info);
81 const char*    interface_info_get_name    (InterfaceInfo *info);
82 GSList*        interface_info_get_methods (InterfaceInfo *info);
83 GSList*        interface_info_get_signals (InterfaceInfo *info);
84 void           interface_info_add_method  (InterfaceInfo *info,
85                                            MethodInfo    *method);
86 void           interface_info_add_signal  (InterfaceInfo *info,
87                                            SignalInfo    *signal);
88
89 MethodInfo*    method_info_new            (const char    *name);
90 MethodInfo*    method_info_ref            (MethodInfo    *info);
91 void           method_info_unref          (MethodInfo    *info);
92
93 const char*    method_info_get_name       (MethodInfo    *info);
94 GSList*        method_info_get_args       (MethodInfo    *info);
95 void           method_info_add_arg        (MethodInfo    *info,
96                                            ArgInfo       *arg);
97
98 SignalInfo*    signal_info_new            (const char    *name);
99 SignalInfo*    signal_info_ref            (SignalInfo    *info);
100 void           signal_info_unref          (SignalInfo    *info);
101
102 const char*    signal_info_get_name       (SignalInfo    *info);
103 GSList*        signal_info_get_args       (SignalInfo    *info);
104 void           signal_info_add_arg        (SignalInfo    *info,
105                                            ArgInfo       *arg);
106
107 ArgInfo*       arg_info_new               (const char    *name,
108                                            ArgDirection   direction,
109                                            int            type);
110 ArgInfo*       arg_info_ref               (ArgInfo       *info);
111 void           arg_info_unref             (ArgInfo       *info);
112 const char*    arg_info_get_name          (ArgInfo       *info);
113 int            arg_info_get_type          (ArgInfo       *info);
114 ArgDirection   arg_info_get_direction     (ArgInfo       *info);
115
116 G_END_DECLS
117
118 #endif /* DBUS_GLIB_IDL_H */
119
120 #endif /* DOXYGEN_SHOULD_SKIP_THIS */