您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

168 行
9.3 KiB

  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, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. *
  20. * Author: David Zeuthen <davidz@redhat.com>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_DBUS_PROXY_H__
  26. #define __G_DBUS_PROXY_H__
  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. /**
  39. * GDBusProxy:
  40. *
  41. * The #GDBusProxy structure contains only private data and
  42. * should only be accessed using the provided API.
  43. *
  44. * Since: 2.26
  45. */
  46. struct _GDBusProxy
  47. {
  48. /*< private >*/
  49. GObject parent_instance;
  50. GDBusProxyPrivate *priv;
  51. };
  52. /**
  53. * GDBusProxyClass:
  54. * @g_properties_changed: Signal class handler for the #GDBusProxy::g-properties-changed signal.
  55. * @g_signal: Signal class handler for the #GDBusProxy::g-signal signal.
  56. *
  57. * Class structure for #GDBusProxy.
  58. *
  59. * Since: 2.26
  60. */
  61. struct _GDBusProxyClass
  62. {
  63. /*< private >*/
  64. GObjectClass parent_class;
  65. /*< public >*/
  66. /* Signals */
  67. void (*g_properties_changed) (GDBusProxy *proxy,
  68. GVariant *changed_properties,
  69. const gchar* const *invalidated_properties);
  70. void (*g_signal) (GDBusProxy *proxy,
  71. const gchar *sender_name,
  72. const gchar *signal_name,
  73. GVariant *parameters);
  74. /*< private >*/
  75. /* Padding for future expansion */
  76. gpointer padding[32];
  77. };
  78. GType g_dbus_proxy_get_type (void) G_GNUC_CONST;
  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. GDBusProxy *g_dbus_proxy_new_finish (GAsyncResult *res,
  89. GError **error);
  90. GDBusProxy *g_dbus_proxy_new_sync (GDBusConnection *connection,
  91. GDBusProxyFlags flags,
  92. GDBusInterfaceInfo *info,
  93. const gchar *name,
  94. const gchar *object_path,
  95. const gchar *interface_name,
  96. GCancellable *cancellable,
  97. GError **error);
  98. void g_dbus_proxy_new_for_bus (GBusType bus_type,
  99. GDBusProxyFlags flags,
  100. GDBusInterfaceInfo *info,
  101. const gchar *name,
  102. const gchar *object_path,
  103. const gchar *interface_name,
  104. GCancellable *cancellable,
  105. GAsyncReadyCallback callback,
  106. gpointer user_data);
  107. GDBusProxy *g_dbus_proxy_new_for_bus_finish (GAsyncResult *res,
  108. GError **error);
  109. GDBusProxy *g_dbus_proxy_new_for_bus_sync (GBusType bus_type,
  110. GDBusProxyFlags flags,
  111. GDBusInterfaceInfo *info,
  112. const gchar *name,
  113. const gchar *object_path,
  114. const gchar *interface_name,
  115. GCancellable *cancellable,
  116. GError **error);
  117. GDBusConnection *g_dbus_proxy_get_connection (GDBusProxy *proxy);
  118. GDBusProxyFlags g_dbus_proxy_get_flags (GDBusProxy *proxy);
  119. const gchar *g_dbus_proxy_get_name (GDBusProxy *proxy);
  120. gchar *g_dbus_proxy_get_name_owner (GDBusProxy *proxy);
  121. const gchar *g_dbus_proxy_get_object_path (GDBusProxy *proxy);
  122. const gchar *g_dbus_proxy_get_interface_name (GDBusProxy *proxy);
  123. gint g_dbus_proxy_get_default_timeout (GDBusProxy *proxy);
  124. void g_dbus_proxy_set_default_timeout (GDBusProxy *proxy,
  125. gint timeout_msec);
  126. GDBusInterfaceInfo *g_dbus_proxy_get_interface_info (GDBusProxy *proxy);
  127. void g_dbus_proxy_set_interface_info (GDBusProxy *proxy,
  128. GDBusInterfaceInfo *info);
  129. GVariant *g_dbus_proxy_get_cached_property (GDBusProxy *proxy,
  130. const gchar *property_name);
  131. void g_dbus_proxy_set_cached_property (GDBusProxy *proxy,
  132. const gchar *property_name,
  133. GVariant *value);
  134. gchar **g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy);
  135. void g_dbus_proxy_call (GDBusProxy *proxy,
  136. const gchar *method_name,
  137. GVariant *parameters,
  138. GDBusCallFlags flags,
  139. gint timeout_msec,
  140. GCancellable *cancellable,
  141. GAsyncReadyCallback callback,
  142. gpointer user_data);
  143. GVariant *g_dbus_proxy_call_finish (GDBusProxy *proxy,
  144. GAsyncResult *res,
  145. GError **error);
  146. GVariant *g_dbus_proxy_call_sync (GDBusProxy *proxy,
  147. const gchar *method_name,
  148. GVariant *parameters,
  149. GDBusCallFlags flags,
  150. gint timeout_msec,
  151. GCancellable *cancellable,
  152. GError **error);
  153. G_END_DECLS
  154. #endif /* __G_DBUS_PROXY_H__ */