gdbusproxy.h 12 KB

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