Merge branch 'gdbus-merge'
[platform/upstream/glib.git] / gio / gdbusintrospection.h
1 /* GDBus - GLib D-Bus Library
2  *
3  * Copyright (C) 2008-2010 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: David Zeuthen <davidz@redhat.com>
21  */
22
23 #ifndef __G_DBUS_INTROSPECTION_H__
24 #define __G_DBUS_INTROSPECTION_H__
25
26 #include <gio/giotypes.h>
27
28 G_BEGIN_DECLS
29
30 /**
31  * GDBusAnnotationInfo:
32  * @ref_count: The reference count or -1 if statically allocated.
33  * @key: The name of the annotation, e.g. "org.freedesktop.DBus.Deprecated".
34  * @value: The value of the annotation.
35  * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
36  *
37  * Information about an annotation.
38  *
39  * Since: 2.26
40  */
41 struct _GDBusAnnotationInfo
42 {
43   volatile gint         ref_count;
44   gchar                *key;
45   gchar                *value;
46   GDBusAnnotationInfo **annotations;
47 };
48
49 /**
50  * GDBusArgInfo:
51  * @ref_count: The reference count or -1 if statically allocated.
52  * @name: Name of the argument, e.g. @unix_user_id.
53  * @signature: D-Bus signature of the argument (a single complete type).
54  * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
55  *
56  * Information about an argument for a method or a signal.
57  *
58  * Since: 2.26
59  */
60 struct _GDBusArgInfo
61 {
62   volatile gint         ref_count;
63   gchar                *name;
64   gchar                *signature;
65   GDBusAnnotationInfo **annotations;
66 };
67
68 /**
69  * GDBusMethodInfo:
70  * @ref_count: The reference count or -1 if statically allocated.
71  * @name: The name of the D-Bus method, e.g. @RequestName.
72  * @in_args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no in arguments.
73  * @out_args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no out arguments.
74  * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
75  *
76  * Information about a method on an D-Bus interface.
77  *
78  * Since: 2.26
79  */
80 struct _GDBusMethodInfo
81 {
82   volatile gint         ref_count;
83   gchar                *name;
84   GDBusArgInfo        **in_args;
85   GDBusArgInfo        **out_args;
86   GDBusAnnotationInfo **annotations;
87 };
88
89 /**
90  * GDBusSignalInfo:
91  * @ref_count: The reference count or -1 if statically allocated.
92  * @name: The name of the D-Bus signal, e.g. "NameOwnerChanged".
93  * @args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no arguments.
94  * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
95  *
96  * Information about a signal on a D-Bus interface.
97  *
98  * Since: 2.26
99  */
100 struct _GDBusSignalInfo
101 {
102   volatile gint         ref_count;
103   gchar                *name;
104   GDBusArgInfo        **args;
105   GDBusAnnotationInfo **annotations;
106 };
107
108 /**
109  * GDBusPropertyInfo:
110  * @ref_count: The reference count or -1 if statically allocated.
111  * @name: The name of the D-Bus property, e.g. "SupportedFilesystems".
112  * @signature: The D-Bus signature of the property (a single complete type).
113  * @flags: Access control flags for the property.
114  * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
115  *
116  * Information about a D-Bus property on a D-Bus interface.
117  *
118  * Since: 2.26
119  */
120 struct _GDBusPropertyInfo
121 {
122   volatile gint             ref_count;
123   gchar                    *name;
124   gchar                    *signature;
125   GDBusPropertyInfoFlags    flags;
126   GDBusAnnotationInfo     **annotations;
127 };
128
129 /**
130  * GDBusInterfaceInfo:
131  * @ref_count: The reference count or -1 if statically allocated.
132  * @name: The name of the D-Bus interface, e.g. "org.freedesktop.DBus.Properties".
133  * @methods: A pointer to a %NULL-terminated array of pointers to #GDBusMethodInfo structures or %NULL if there are no methods.
134  * @signals: A pointer to a %NULL-terminated array of pointers to #GDBusSignalInfo structures or %NULL if there are no signals.
135  * @properties: A pointer to a %NULL-terminated array of pointers to #GDBusPropertyInfo structures or %NULL if there are no properties.
136  * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
137  *
138  * Information about a D-Bus interface.
139  *
140  * Since: 2.26
141  */
142 struct _GDBusInterfaceInfo
143 {
144   volatile gint         ref_count;
145   gchar                *name;
146   GDBusMethodInfo     **methods;
147   GDBusSignalInfo     **signals;
148   GDBusPropertyInfo   **properties;
149   GDBusAnnotationInfo **annotations;
150 };
151
152 /**
153  * GDBusNodeInfo:
154  * @ref_count: The reference count or -1 if statically allocated.
155  * @path: The path of the node or %NULL if omitted. Note that this may be a relative path. See the D-Bus specification for more details.
156  * @interfaces: A pointer to a %NULL-terminated array of pointers to #GDBusInterfaceInfo structures or %NULL if there are no interfaces.
157  * @nodes: A pointer to a %NULL-terminated array of pointers to #GDBusNodeInfo structures or %NULL if there are no nodes.
158  * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
159  *
160  * Information about nodes in a remote object hierarchy.
161  *
162  * Since: 2.26
163  */
164 struct _GDBusNodeInfo
165 {
166   volatile gint         ref_count;
167   gchar                *path;
168   GDBusInterfaceInfo  **interfaces;
169   GDBusNodeInfo       **nodes;
170   GDBusAnnotationInfo **annotations;
171 };
172
173 const gchar              *g_dbus_annotation_info_lookup          (const GDBusAnnotationInfo **annotations,
174                                                                   const gchar               *name);
175 const GDBusMethodInfo    *g_dbus_interface_info_lookup_method    (const GDBusInterfaceInfo  *info,
176                                                                   const gchar               *name);
177 const GDBusSignalInfo    *g_dbus_interface_info_lookup_signal    (const GDBusInterfaceInfo  *info,
178                                                                   const gchar               *name);
179 const GDBusPropertyInfo  *g_dbus_interface_info_lookup_property  (const GDBusInterfaceInfo  *info,
180                                                                   const gchar               *name);
181 void                      g_dbus_interface_info_generate_xml     (const GDBusInterfaceInfo  *info,
182                                                                   guint                      indent,
183                                                                   GString                   *string_builder);
184
185 GDBusNodeInfo            *g_dbus_node_info_new_for_xml           (const gchar               *xml_data,
186                                                                   GError                   **error);
187 const GDBusInterfaceInfo *g_dbus_node_info_lookup_interface      (const GDBusNodeInfo       *info,
188                                                                   const gchar               *name);
189 void                      g_dbus_node_info_generate_xml          (const GDBusNodeInfo       *info,
190                                                                   guint                      indent,
191                                                                   GString                   *string_builder);
192
193 GDBusNodeInfo            *g_dbus_node_info_ref                   (GDBusNodeInfo             *info);
194 GDBusInterfaceInfo       *g_dbus_interface_info_ref              (GDBusInterfaceInfo        *info);
195 GDBusMethodInfo          *g_dbus_method_info_ref                 (GDBusMethodInfo           *info);
196 GDBusSignalInfo          *g_dbus_signal_info_ref                 (GDBusSignalInfo           *info);
197 GDBusPropertyInfo        *g_dbus_property_info_ref               (GDBusPropertyInfo         *info);
198 GDBusArgInfo             *g_dbus_arg_info_ref                    (GDBusArgInfo              *info);
199 GDBusAnnotationInfo      *g_dbus_annotation_info_ref             (GDBusAnnotationInfo       *info);
200
201 void                      g_dbus_node_info_unref                 (GDBusNodeInfo             *info);
202 void                      g_dbus_interface_info_unref            (GDBusInterfaceInfo        *info);
203 void                      g_dbus_method_info_unref               (GDBusMethodInfo           *info);
204 void                      g_dbus_signal_info_unref               (GDBusSignalInfo           *info);
205 void                      g_dbus_property_info_unref             (GDBusPropertyInfo         *info);
206 void                      g_dbus_arg_info_unref                  (GDBusArgInfo              *info);
207 void                      g_dbus_annotation_info_unref           (GDBusAnnotationInfo       *info);
208
209
210 /**
211  * G_TYPE_DBUS_NODE_INFO:
212  *
213  * The #GType for a boxed type holding a #GDBusNodeInfo.
214  *
215  * Since: 2.26
216  */
217 #define G_TYPE_DBUS_NODE_INFO       (g_dbus_node_info_get_type ())
218
219 /**
220  * G_TYPE_DBUS_INTERFACE_INFO:
221  *
222  * The #GType for a boxed type holding a #GDBusInterfaceInfo.
223  *
224  * Since: 2.26
225  */
226 #define G_TYPE_DBUS_INTERFACE_INFO  (g_dbus_interface_info_get_type ())
227
228 /**
229  * G_TYPE_DBUS_METHOD_INFO:
230  *
231  * The #GType for a boxed type holding a #GDBusMethodInfo.
232  *
233  * Since: 2.26
234  */
235 #define G_TYPE_DBUS_METHOD_INFO     (g_dbus_method_info_get_type ())
236
237 /**
238  * G_TYPE_DBUS_SIGNAL_INFO:
239  *
240  * The #GType for a boxed type holding a #GDBusSignalInfo.
241  *
242  * Since: 2.26
243  */
244 #define G_TYPE_DBUS_SIGNAL_INFO     (g_dbus_signal_info_get_type ())
245
246 /**
247  * G_TYPE_DBUS_PROPERTY_INFO:
248  *
249  * The #GType for a boxed type holding a #GDBusPropertyInfo.
250  *
251  * Since: 2.26
252  */
253 #define G_TYPE_DBUS_PROPERTY_INFO   (g_dbus_property_info_get_type ())
254
255 /**
256  * G_TYPE_DBUS_ARG_INFO:
257  *
258  * The #GType for a boxed type holding a #GDBusArgInfo.
259  *
260  * Since: 2.26
261  */
262 #define G_TYPE_DBUS_ARG_INFO        (g_dbus_arg_info_get_type ())
263
264 /**
265  * G_TYPE_DBUS_ANNOTATION_INFO:
266  *
267  * The #GType for a boxed type holding a #GDBusAnnotationInfo.
268  *
269  * Since: 2.26
270  */
271 #define G_TYPE_DBUS_ANNOTATION_INFO (g_dbus_annotation_info_get_type ())
272
273 GType g_dbus_node_info_get_type       (void) G_GNUC_CONST;
274 GType g_dbus_interface_info_get_type  (void) G_GNUC_CONST;
275 GType g_dbus_method_info_get_type     (void) G_GNUC_CONST;
276 GType g_dbus_signal_info_get_type     (void) G_GNUC_CONST;
277 GType g_dbus_property_info_get_type   (void) G_GNUC_CONST;
278 GType g_dbus_arg_info_get_type        (void) G_GNUC_CONST;
279 GType g_dbus_annotation_info_get_type (void) G_GNUC_CONST;
280
281 G_END_DECLS
282
283 #endif /* __G_DBUS_INTROSPECTION_H__ */