1 /* GDBus - GLib D-Bus Library
3 * Copyright (C) 2008-2010 Red Hat, Inc.
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.
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.
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.
20 * Author: David Zeuthen <davidz@redhat.com>
23 #ifndef __G_DBUS_INTROSPECTION_H__
24 #define __G_DBUS_INTROSPECTION_H__
26 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27 #error "Only <gio/gio.h> can be included directly."
30 #include <gio/giotypes.h>
35 * GDBusAnnotationInfo:
36 * @ref_count: The reference count or -1 if statically allocated.
37 * @key: The name of the annotation, e.g. "org.freedesktop.DBus.Deprecated".
38 * @value: The value of the annotation.
39 * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
41 * Information about an annotation.
45 struct _GDBusAnnotationInfo
48 volatile gint ref_count;
51 GDBusAnnotationInfo **annotations;
56 * @ref_count: The reference count or -1 if statically allocated.
57 * @name: Name of the argument, e.g. @unix_user_id.
58 * @signature: D-Bus signature of the argument (a single complete type).
59 * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
61 * Information about an argument for a method or a signal.
68 volatile gint ref_count;
71 GDBusAnnotationInfo **annotations;
76 * @ref_count: The reference count or -1 if statically allocated.
77 * @name: The name of the D-Bus method, e.g. @RequestName.
78 * @in_args: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no in arguments.
79 * @out_args: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no out arguments.
80 * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
82 * Information about a method on an D-Bus interface.
86 struct _GDBusMethodInfo
89 volatile gint ref_count;
91 GDBusArgInfo **in_args;
92 GDBusArgInfo **out_args;
93 GDBusAnnotationInfo **annotations;
98 * @ref_count: The reference count or -1 if statically allocated.
99 * @name: The name of the D-Bus signal, e.g. "NameOwnerChanged".
100 * @args: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no arguments.
101 * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
103 * Information about a signal on a D-Bus interface.
107 struct _GDBusSignalInfo
110 volatile gint ref_count;
113 GDBusAnnotationInfo **annotations;
118 * @ref_count: The reference count or -1 if statically allocated.
119 * @name: The name of the D-Bus property, e.g. "SupportedFilesystems".
120 * @signature: The D-Bus signature of the property (a single complete type).
121 * @flags: Access control flags for the property.
122 * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
124 * Information about a D-Bus property on a D-Bus interface.
128 struct _GDBusPropertyInfo
131 volatile gint ref_count;
134 GDBusPropertyInfoFlags flags;
135 GDBusAnnotationInfo **annotations;
139 * GDBusInterfaceInfo:
140 * @ref_count: The reference count or -1 if statically allocated.
141 * @name: The name of the D-Bus interface, e.g. "org.freedesktop.DBus.Properties".
142 * @methods: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusMethodInfo structures or %NULL if there are no methods.
143 * @signals: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusSignalInfo structures or %NULL if there are no signals.
144 * @properties: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusPropertyInfo structures or %NULL if there are no properties.
145 * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
147 * Information about a D-Bus interface.
151 struct _GDBusInterfaceInfo
154 volatile gint ref_count;
156 GDBusMethodInfo **methods;
157 GDBusSignalInfo **signals;
158 GDBusPropertyInfo **properties;
159 GDBusAnnotationInfo **annotations;
164 * @ref_count: The reference count or -1 if statically allocated.
165 * @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.
166 * @interfaces: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusInterfaceInfo structures or %NULL if there are no interfaces.
167 * @nodes: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusNodeInfo structures or %NULL if there are no nodes.
168 * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
170 * Information about nodes in a remote object hierarchy.
174 struct _GDBusNodeInfo
177 volatile gint ref_count;
179 GDBusInterfaceInfo **interfaces;
180 GDBusNodeInfo **nodes;
181 GDBusAnnotationInfo **annotations;
184 GLIB_AVAILABLE_IN_ALL
185 const gchar *g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations,
187 GLIB_AVAILABLE_IN_ALL
188 GDBusMethodInfo *g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,
190 GLIB_AVAILABLE_IN_ALL
191 GDBusSignalInfo *g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,
193 GLIB_AVAILABLE_IN_ALL
194 GDBusPropertyInfo *g_dbus_interface_info_lookup_property (GDBusInterfaceInfo *info,
196 GLIB_AVAILABLE_IN_ALL
197 void g_dbus_interface_info_cache_build (GDBusInterfaceInfo *info);
198 GLIB_AVAILABLE_IN_ALL
199 void g_dbus_interface_info_cache_release (GDBusInterfaceInfo *info);
201 GLIB_AVAILABLE_IN_ALL
202 void g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info,
204 GString *string_builder);
206 GLIB_AVAILABLE_IN_ALL
207 GDBusNodeInfo *g_dbus_node_info_new_for_xml (const gchar *xml_data,
209 GLIB_AVAILABLE_IN_ALL
210 GDBusInterfaceInfo *g_dbus_node_info_lookup_interface (GDBusNodeInfo *info,
212 GLIB_AVAILABLE_IN_ALL
213 void g_dbus_node_info_generate_xml (GDBusNodeInfo *info,
215 GString *string_builder);
217 GLIB_AVAILABLE_IN_ALL
218 GDBusNodeInfo *g_dbus_node_info_ref (GDBusNodeInfo *info);
219 GLIB_AVAILABLE_IN_ALL
220 GDBusInterfaceInfo *g_dbus_interface_info_ref (GDBusInterfaceInfo *info);
221 GLIB_AVAILABLE_IN_ALL
222 GDBusMethodInfo *g_dbus_method_info_ref (GDBusMethodInfo *info);
223 GLIB_AVAILABLE_IN_ALL
224 GDBusSignalInfo *g_dbus_signal_info_ref (GDBusSignalInfo *info);
225 GLIB_AVAILABLE_IN_ALL
226 GDBusPropertyInfo *g_dbus_property_info_ref (GDBusPropertyInfo *info);
227 GLIB_AVAILABLE_IN_ALL
228 GDBusArgInfo *g_dbus_arg_info_ref (GDBusArgInfo *info);
229 GLIB_AVAILABLE_IN_ALL
230 GDBusAnnotationInfo *g_dbus_annotation_info_ref (GDBusAnnotationInfo *info);
232 GLIB_AVAILABLE_IN_ALL
233 void g_dbus_node_info_unref (GDBusNodeInfo *info);
234 GLIB_AVAILABLE_IN_ALL
235 void g_dbus_interface_info_unref (GDBusInterfaceInfo *info);
236 GLIB_AVAILABLE_IN_ALL
237 void g_dbus_method_info_unref (GDBusMethodInfo *info);
238 GLIB_AVAILABLE_IN_ALL
239 void g_dbus_signal_info_unref (GDBusSignalInfo *info);
240 GLIB_AVAILABLE_IN_ALL
241 void g_dbus_property_info_unref (GDBusPropertyInfo *info);
242 GLIB_AVAILABLE_IN_ALL
243 void g_dbus_arg_info_unref (GDBusArgInfo *info);
244 GLIB_AVAILABLE_IN_ALL
245 void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info);
248 * G_TYPE_DBUS_NODE_INFO:
250 * The #GType for a boxed type holding a #GDBusNodeInfo.
254 #define G_TYPE_DBUS_NODE_INFO (g_dbus_node_info_get_type ())
257 * G_TYPE_DBUS_INTERFACE_INFO:
259 * The #GType for a boxed type holding a #GDBusInterfaceInfo.
263 #define G_TYPE_DBUS_INTERFACE_INFO (g_dbus_interface_info_get_type ())
266 * G_TYPE_DBUS_METHOD_INFO:
268 * The #GType for a boxed type holding a #GDBusMethodInfo.
272 #define G_TYPE_DBUS_METHOD_INFO (g_dbus_method_info_get_type ())
275 * G_TYPE_DBUS_SIGNAL_INFO:
277 * The #GType for a boxed type holding a #GDBusSignalInfo.
281 #define G_TYPE_DBUS_SIGNAL_INFO (g_dbus_signal_info_get_type ())
284 * G_TYPE_DBUS_PROPERTY_INFO:
286 * The #GType for a boxed type holding a #GDBusPropertyInfo.
290 #define G_TYPE_DBUS_PROPERTY_INFO (g_dbus_property_info_get_type ())
293 * G_TYPE_DBUS_ARG_INFO:
295 * The #GType for a boxed type holding a #GDBusArgInfo.
299 #define G_TYPE_DBUS_ARG_INFO (g_dbus_arg_info_get_type ())
302 * G_TYPE_DBUS_ANNOTATION_INFO:
304 * The #GType for a boxed type holding a #GDBusAnnotationInfo.
308 #define G_TYPE_DBUS_ANNOTATION_INFO (g_dbus_annotation_info_get_type ())
310 GLIB_AVAILABLE_IN_ALL
311 GType g_dbus_node_info_get_type (void) G_GNUC_CONST;
312 GLIB_AVAILABLE_IN_ALL
313 GType g_dbus_interface_info_get_type (void) G_GNUC_CONST;
314 GLIB_AVAILABLE_IN_ALL
315 GType g_dbus_method_info_get_type (void) G_GNUC_CONST;
316 GLIB_AVAILABLE_IN_ALL
317 GType g_dbus_signal_info_get_type (void) G_GNUC_CONST;
318 GLIB_AVAILABLE_IN_ALL
319 GType g_dbus_property_info_get_type (void) G_GNUC_CONST;
320 GLIB_AVAILABLE_IN_ALL
321 GType g_dbus_arg_info_get_type (void) G_GNUC_CONST;
322 GLIB_AVAILABLE_IN_ALL
323 GType g_dbus_annotation_info_get_type (void) G_GNUC_CONST;
327 #endif /* __G_DBUS_INTROSPECTION_H__ */