gdbusintrospection.h 12 KB

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