1 /* GDBus - GLib D-Bus Library
3 * Copyright (C) 2008-2009 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 #include <gio/giotypes.h>
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.
37 * Information about an annotation.
41 struct _GDBusAnnotationInfo
43 volatile gint ref_count;
46 GDBusAnnotationInfo **annotations;
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.
56 * Information about an argument for a method or a signal.
62 volatile gint ref_count;
65 GDBusAnnotationInfo **annotations;
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.
76 * Information about a method on an D-Bus interface.
80 struct _GDBusMethodInfo
82 volatile gint ref_count;
84 GDBusArgInfo **in_args;
85 GDBusArgInfo **out_args;
86 GDBusAnnotationInfo **annotations;
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.
96 * Information about a signal on a D-Bus interface.
100 struct _GDBusSignalInfo
102 volatile gint ref_count;
105 GDBusAnnotationInfo **annotations;
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.
116 * Information about a D-Bus property on a D-Bus interface.
120 struct _GDBusPropertyInfo
122 volatile gint ref_count;
125 GDBusPropertyInfoFlags flags;
126 GDBusAnnotationInfo **annotations;
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.
138 * Information about a D-Bus interface.
142 struct _GDBusInterfaceInfo
144 volatile gint ref_count;
146 GDBusMethodInfo **methods;
147 GDBusSignalInfo **signals;
148 GDBusPropertyInfo **properties;
149 GDBusAnnotationInfo **annotations;
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.
160 * Information about nodes in a remote object hierarchy.
164 struct _GDBusNodeInfo
166 volatile gint ref_count;
168 GDBusInterfaceInfo **interfaces;
169 GDBusNodeInfo **nodes;
170 GDBusAnnotationInfo **annotations;
173 const gchar *g_dbus_annotation_info_lookup (const GDBusAnnotationInfo **annotations,
175 const GDBusMethodInfo *g_dbus_interface_info_lookup_method (const GDBusInterfaceInfo *info,
177 const GDBusSignalInfo *g_dbus_interface_info_lookup_signal (const GDBusInterfaceInfo *info,
179 const GDBusPropertyInfo *g_dbus_interface_info_lookup_property (const GDBusInterfaceInfo *info,
181 void g_dbus_interface_info_generate_xml (const GDBusInterfaceInfo *info,
183 GString *string_builder);
185 GDBusNodeInfo *g_dbus_node_info_new_for_xml (const gchar *xml_data,
187 const GDBusInterfaceInfo *g_dbus_node_info_lookup_interface (const GDBusNodeInfo *info,
189 void g_dbus_node_info_generate_xml (const GDBusNodeInfo *info,
191 GString *string_builder);
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);
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);
211 * G_TYPE_DBUS_NODE_INFO:
213 * The #GType for a boxed type holding a #GDBusNodeInfo.
217 #define G_TYPE_DBUS_NODE_INFO (g_dbus_node_info_get_type ())
220 * G_TYPE_DBUS_INTERFACE_INFO:
222 * The #GType for a boxed type holding a #GDBusInterfaceInfo.
226 #define G_TYPE_DBUS_INTERFACE_INFO (g_dbus_interface_info_get_type ())
229 * G_TYPE_DBUS_METHOD_INFO:
231 * The #GType for a boxed type holding a #GDBusMethodInfo.
235 #define G_TYPE_DBUS_METHOD_INFO (g_dbus_method_info_get_type ())
238 * G_TYPE_DBUS_SIGNAL_INFO:
240 * The #GType for a boxed type holding a #GDBusSignalInfo.
244 #define G_TYPE_DBUS_SIGNAL_INFO (g_dbus_signal_info_get_type ())
247 * G_TYPE_DBUS_PROPERTY_INFO:
249 * The #GType for a boxed type holding a #GDBusPropertyInfo.
253 #define G_TYPE_DBUS_PROPERTY_INFO (g_dbus_property_info_get_type ())
256 * G_TYPE_DBUS_ARG_INFO:
258 * The #GType for a boxed type holding a #GDBusArgInfo.
262 #define G_TYPE_DBUS_ARG_INFO (g_dbus_arg_info_get_type ())
265 * G_TYPE_DBUS_ANNOTATION_INFO:
267 * The #GType for a boxed type holding a #GDBusAnnotationInfo.
271 #define G_TYPE_DBUS_ANNOTATION_INFO (g_dbus_annotation_info_get_type ())
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;
283 #endif /* __G_DBUS_INTROSPECTION_H__ */