gdbusproxy.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: David Zeuthen <davidz@redhat.com>
  19. */
  20. #ifndef __G_DBUS_PROXY_H__
  21. #define __G_DBUS_PROXY_H__
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #include <gio/giotypes.h>
  26. #include <gio/gdbusintrospection.h>
  27. G_BEGIN_DECLS
  28. #define G_TYPE_DBUS_PROXY (g_dbus_proxy_get_type ())
  29. #define G_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_PROXY, GDBusProxy))
  30. #define G_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_PROXY, GDBusProxyClass))
  31. #define G_DBUS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_PROXY, GDBusProxyClass))
  32. #define G_IS_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_PROXY))
  33. #define G_IS_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_PROXY))
  34. typedef struct _GDBusProxyClass GDBusProxyClass;
  35. typedef struct _GDBusProxyPrivate GDBusProxyPrivate;
  36. /**
  37. * GDBusProxy:
  38. *
  39. * The #GDBusProxy structure contains only private data and
  40. * should only be accessed using the provided API.
  41. *
  42. * Since: 2.26
  43. */
  44. struct _GDBusProxy
  45. {
  46. /*< private >*/
  47. GObject parent_instance;
  48. GDBusProxyPrivate *priv;
  49. };
  50. /**
  51. * GDBusProxyClass:
  52. * @g_properties_changed: Signal class handler for the #GDBusProxy::g-properties-changed signal.
  53. * @g_signal: Signal class handler for the #GDBusProxy::g-signal signal.
  54. *
  55. * Class structure for #GDBusProxy.
  56. *
  57. * Since: 2.26
  58. */
  59. struct _GDBusProxyClass
  60. {
  61. /*< private >*/
  62. GObjectClass parent_class;
  63. /*< public >*/
  64. /* Signals */
  65. void (*g_properties_changed) (GDBusProxy *proxy,
  66. GVariant *changed_properties,
  67. const gchar* const *invalidated_properties);
  68. void (*g_signal) (GDBusProxy *proxy,
  69. const gchar *sender_name,
  70. const gchar *signal_name,
  71. GVariant *parameters);
  72. /*< private >*/
  73. /* Padding for future expansion */
  74. gpointer padding[32];
  75. };
  76. GLIB_AVAILABLE_IN_ALL
  77. GType g_dbus_proxy_get_type (void) G_GNUC_CONST;
  78. GLIB_AVAILABLE_IN_ALL
  79. void g_dbus_proxy_new (GDBusConnection *connection,
  80. GDBusProxyFlags flags,
  81. GDBusInterfaceInfo *info,
  82. const gchar *name,
  83. const gchar *object_path,
  84. const gchar *interface_name,
  85. GCancellable *cancellable,
  86. GAsyncReadyCallback callback,
  87. gpointer user_data);
  88. GLIB_AVAILABLE_IN_ALL
  89. GDBusProxy *g_dbus_proxy_new_finish (GAsyncResult *res,
  90. GError **error);
  91. GLIB_AVAILABLE_IN_ALL
  92. GDBusProxy *g_dbus_proxy_new_sync (GDBusConnection *connection,
  93. GDBusProxyFlags flags,
  94. GDBusInterfaceInfo *info,
  95. const gchar *name,
  96. const gchar *object_path,
  97. const gchar *interface_name,
  98. GCancellable *cancellable,
  99. GError **error);
  100. GLIB_AVAILABLE_IN_ALL
  101. void g_dbus_proxy_new_for_bus (GBusType bus_type,
  102. GDBusProxyFlags flags,
  103. GDBusInterfaceInfo *info,
  104. const gchar *name,
  105. const gchar *object_path,
  106. const gchar *interface_name,
  107. GCancellable *cancellable,
  108. GAsyncReadyCallback callback,
  109. gpointer user_data);
  110. GLIB_AVAILABLE_IN_ALL
  111. GDBusProxy *g_dbus_proxy_new_for_bus_finish (GAsyncResult *res,
  112. GError **error);
  113. GLIB_AVAILABLE_IN_ALL
  114. GDBusProxy *g_dbus_proxy_new_for_bus_sync (GBusType bus_type,
  115. GDBusProxyFlags flags,
  116. GDBusInterfaceInfo *info,
  117. const gchar *name,
  118. const gchar *object_path,
  119. const gchar *interface_name,
  120. GCancellable *cancellable,
  121. GError **error);
  122. GLIB_AVAILABLE_IN_ALL
  123. GDBusConnection *g_dbus_proxy_get_connection (GDBusProxy *proxy);
  124. GLIB_AVAILABLE_IN_ALL
  125. GDBusProxyFlags g_dbus_proxy_get_flags (GDBusProxy *proxy);
  126. GLIB_AVAILABLE_IN_ALL
  127. const gchar *g_dbus_proxy_get_name (GDBusProxy *proxy);
  128. GLIB_AVAILABLE_IN_ALL
  129. gchar *g_dbus_proxy_get_name_owner (GDBusProxy *proxy);
  130. GLIB_AVAILABLE_IN_ALL
  131. const gchar *g_dbus_proxy_get_object_path (GDBusProxy *proxy);
  132. GLIB_AVAILABLE_IN_ALL
  133. const gchar *g_dbus_proxy_get_interface_name (GDBusProxy *proxy);
  134. GLIB_AVAILABLE_IN_ALL
  135. gint g_dbus_proxy_get_default_timeout (GDBusProxy *proxy);
  136. GLIB_AVAILABLE_IN_ALL
  137. void g_dbus_proxy_set_default_timeout (GDBusProxy *proxy,
  138. gint timeout_msec);
  139. GLIB_AVAILABLE_IN_ALL
  140. GDBusInterfaceInfo *g_dbus_proxy_get_interface_info (GDBusProxy *proxy);
  141. GLIB_AVAILABLE_IN_ALL
  142. void g_dbus_proxy_set_interface_info (GDBusProxy *proxy,
  143. GDBusInterfaceInfo *info);
  144. GLIB_AVAILABLE_IN_ALL
  145. GVariant *g_dbus_proxy_get_cached_property (GDBusProxy *proxy,
  146. const gchar *property_name);
  147. GLIB_AVAILABLE_IN_ALL
  148. void g_dbus_proxy_set_cached_property (GDBusProxy *proxy,
  149. const gchar *property_name,
  150. GVariant *value);
  151. GLIB_AVAILABLE_IN_ALL
  152. gchar **g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy);
  153. GLIB_AVAILABLE_IN_ALL
  154. void g_dbus_proxy_call (GDBusProxy *proxy,
  155. const gchar *method_name,
  156. GVariant *parameters,
  157. GDBusCallFlags flags,
  158. gint timeout_msec,
  159. GCancellable *cancellable,
  160. GAsyncReadyCallback callback,
  161. gpointer user_data);
  162. GLIB_AVAILABLE_IN_ALL
  163. GVariant *g_dbus_proxy_call_finish (GDBusProxy *proxy,
  164. GAsyncResult *res,
  165. GError **error);
  166. GLIB_AVAILABLE_IN_ALL
  167. GVariant *g_dbus_proxy_call_sync (GDBusProxy *proxy,
  168. const gchar *method_name,
  169. GVariant *parameters,
  170. GDBusCallFlags flags,
  171. gint timeout_msec,
  172. GCancellable *cancellable,
  173. GError **error);
  174. GLIB_AVAILABLE_IN_ALL
  175. void g_dbus_proxy_call_with_unix_fd_list (GDBusProxy *proxy,
  176. const gchar *method_name,
  177. GVariant *parameters,
  178. GDBusCallFlags flags,
  179. gint timeout_msec,
  180. GUnixFDList *fd_list,
  181. GCancellable *cancellable,
  182. GAsyncReadyCallback callback,
  183. gpointer user_data);
  184. GLIB_AVAILABLE_IN_ALL
  185. GVariant *g_dbus_proxy_call_with_unix_fd_list_finish (GDBusProxy *proxy,
  186. GUnixFDList **out_fd_list,
  187. GAsyncResult *res,
  188. GError **error);
  189. GLIB_AVAILABLE_IN_ALL
  190. GVariant *g_dbus_proxy_call_with_unix_fd_list_sync (GDBusProxy *proxy,
  191. const gchar *method_name,
  192. GVariant *parameters,
  193. GDBusCallFlags flags,
  194. gint timeout_msec,
  195. GUnixFDList *fd_list,
  196. GUnixFDList **out_fd_list,
  197. GCancellable *cancellable,
  198. GError **error);
  199. G_END_DECLS
  200. #endif /* __G_DBUS_PROXY_H__ */