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.
39 struct _GDBusAnnotationInfo
41 volatile gint ref_count;
44 GDBusAnnotationInfo **annotations;
49 * @ref_count: The reference count or -1 if statically allocated.
50 * @name: Name of the argument, e.g. @unix_user_id.
51 * @signature: D-Bus signature of the argument (a single complete type).
52 * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
54 * Information about an argument for a method or a signal.
58 volatile gint ref_count;
61 GDBusAnnotationInfo **annotations;
66 * @ref_count: The reference count or -1 if statically allocated.
67 * @name: The name of the D-Bus method, e.g. @RequestName.
68 * @in_args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no in arguments.
69 * @out_args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no out arguments.
70 * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
72 * Information about a method on an D-Bus interface.
74 struct _GDBusMethodInfo
76 volatile gint ref_count;
78 GDBusArgInfo **in_args;
79 GDBusArgInfo **out_args;
80 GDBusAnnotationInfo **annotations;
85 * @ref_count: The reference count or -1 if statically allocated.
86 * @name: The name of the D-Bus signal, e.g. "NameOwnerChanged".
87 * @args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no arguments.
88 * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
90 * Information about a signal on a D-Bus interface.
92 struct _GDBusSignalInfo
94 volatile gint ref_count;
97 GDBusAnnotationInfo **annotations;
102 * @ref_count: The reference count or -1 if statically allocated.
103 * @name: The name of the D-Bus property, e.g. "SupportedFilesystems".
104 * @signature: The D-Bus signature of the property (a single complete type).
105 * @flags: Access control flags for the property.
106 * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
108 * Information about a D-Bus property on a D-Bus interface.
110 struct _GDBusPropertyInfo
112 volatile gint ref_count;
115 GDBusPropertyInfoFlags flags;
116 GDBusAnnotationInfo **annotations;
120 * GDBusInterfaceInfo:
121 * @ref_count: The reference count or -1 if statically allocated.
122 * @name: The name of the D-Bus interface, e.g. "org.freedesktop.DBus.Properties".
123 * @methods: A pointer to a %NULL-terminated array of pointers to #GDBusMethodInfo structures or %NULL if there are no methods.
124 * @signals: A pointer to a %NULL-terminated array of pointers to #GDBusSignalInfo structures or %NULL if there are no signals.
125 * @properties: A pointer to a %NULL-terminated array of pointers to #GDBusPropertyInfo structures or %NULL if there are no properties.
126 * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
128 * Information about a D-Bus interface.
130 struct _GDBusInterfaceInfo
132 volatile gint ref_count;
134 GDBusMethodInfo **methods;
135 GDBusSignalInfo **signals;
136 GDBusPropertyInfo **properties;
137 GDBusAnnotationInfo **annotations;
142 * @ref_count: The reference count or -1 if statically allocated.
143 * @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.
144 * @interfaces: A pointer to a %NULL-terminated array of pointers to #GDBusInterfaceInfo structures or %NULL if there are no interfaces.
145 * @nodes: A pointer to a %NULL-terminated array of pointers to #GDBusNodeInfo structures or %NULL if there are no nodes.
146 * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
148 * Information about nodes in a remote object hierarchy.
150 struct _GDBusNodeInfo
152 volatile gint ref_count;
154 GDBusInterfaceInfo **interfaces;
155 GDBusNodeInfo **nodes;
156 GDBusAnnotationInfo **annotations;
159 const gchar *g_dbus_annotation_info_lookup (const GDBusAnnotationInfo **annotations,
161 const GDBusMethodInfo *g_dbus_interface_info_lookup_method (const GDBusInterfaceInfo *info,
163 const GDBusSignalInfo *g_dbus_interface_info_lookup_signal (const GDBusInterfaceInfo *info,
165 const GDBusPropertyInfo *g_dbus_interface_info_lookup_property (const GDBusInterfaceInfo *info,
167 void g_dbus_interface_info_generate_xml (const GDBusInterfaceInfo *info,
169 GString *string_builder);
171 GDBusNodeInfo *g_dbus_node_info_new_for_xml (const gchar *xml_data,
173 const GDBusInterfaceInfo *g_dbus_node_info_lookup_interface (const GDBusNodeInfo *info,
175 void g_dbus_node_info_generate_xml (const GDBusNodeInfo *info,
177 GString *string_builder);
179 GDBusNodeInfo *g_dbus_node_info_ref (GDBusNodeInfo *info);
180 GDBusInterfaceInfo *g_dbus_interface_info_ref (GDBusInterfaceInfo *info);
181 GDBusMethodInfo *g_dbus_method_info_ref (GDBusMethodInfo *info);
182 GDBusSignalInfo *g_dbus_signal_info_ref (GDBusSignalInfo *info);
183 GDBusPropertyInfo *g_dbus_property_info_ref (GDBusPropertyInfo *info);
184 GDBusArgInfo *g_dbus_arg_info_ref (GDBusArgInfo *info);
185 GDBusAnnotationInfo *g_dbus_annotation_info_ref (GDBusAnnotationInfo *info);
187 void g_dbus_node_info_unref (GDBusNodeInfo *info);
188 void g_dbus_interface_info_unref (GDBusInterfaceInfo *info);
189 void g_dbus_method_info_unref (GDBusMethodInfo *info);
190 void g_dbus_signal_info_unref (GDBusSignalInfo *info);
191 void g_dbus_property_info_unref (GDBusPropertyInfo *info);
192 void g_dbus_arg_info_unref (GDBusArgInfo *info);
193 void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info);
197 * G_TYPE_DBUS_NODE_INFO:
199 * The #GType for a boxed type holding a #GDBusNodeInfo.
201 #define G_TYPE_DBUS_NODE_INFO (g_dbus_node_info_get_type ())
204 * G_TYPE_DBUS_INTERFACE_INFO:
206 * The #GType for a boxed type holding a #GDBusInterfaceInfo.
208 #define G_TYPE_DBUS_INTERFACE_INFO (g_dbus_interface_info_get_type ())
211 * G_TYPE_DBUS_METHOD_INFO:
213 * The #GType for a boxed type holding a #GDBusMethodInfo.
215 #define G_TYPE_DBUS_METHOD_INFO (g_dbus_method_info_get_type ())
218 * G_TYPE_DBUS_SIGNAL_INFO:
220 * The #GType for a boxed type holding a #GDBusSignalInfo.
222 #define G_TYPE_DBUS_SIGNAL_INFO (g_dbus_signal_info_get_type ())
225 * G_TYPE_DBUS_PROPERTY_INFO:
227 * The #GType for a boxed type holding a #GDBusPropertyInfo.
229 #define G_TYPE_DBUS_PROPERTY_INFO (g_dbus_property_info_get_type ())
232 * G_TYPE_DBUS_ARG_INFO:
234 * The #GType for a boxed type holding a #GDBusArgInfo.
236 #define G_TYPE_DBUS_ARG_INFO (g_dbus_arg_info_get_type ())
239 * G_TYPE_DBUS_ANNOTATION_INFO:
241 * The #GType for a boxed type holding a #GDBusAnnotationInfo.
243 #define G_TYPE_DBUS_ANNOTATION_INFO (g_dbus_annotation_info_get_type ())
245 GType g_dbus_node_info_get_type (void) G_GNUC_CONST;
246 GType g_dbus_interface_info_get_type (void) G_GNUC_CONST;
247 GType g_dbus_method_info_get_type (void) G_GNUC_CONST;
248 GType g_dbus_signal_info_get_type (void) G_GNUC_CONST;
249 GType g_dbus_property_info_get_type (void) G_GNUC_CONST;
250 GType g_dbus_arg_info_get_type (void) G_GNUC_CONST;
251 GType g_dbus_annotation_info_get_type (void) G_GNUC_CONST;
255 #endif /* __G_DBUS_INTROSPECTION_H__ */