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

source code of include/glib-2.0/gio/gdbusproxy.h