GDBus: Use GVariant instead of GHashTable for GDBusProxy::g-properties-changed
[platform/upstream/glib.git] / gio / gdbusproxy.h
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
23 #ifndef __G_DBUS_PROXY_H__
24 #define __G_DBUS_PROXY_H__
25
26 #include <gio/giotypes.h>
27 #include <gio/gdbusintrospection.h>
28
29 G_BEGIN_DECLS
30
31 #define G_TYPE_DBUS_PROXY         (g_dbus_proxy_get_type ())
32 #define G_DBUS_PROXY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_PROXY, GDBusProxy))
33 #define G_DBUS_PROXY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_PROXY, GDBusProxyClass))
34 #define G_DBUS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_PROXY, GDBusProxyClass))
35 #define G_IS_DBUS_PROXY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_PROXY))
36 #define G_IS_DBUS_PROXY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_PROXY))
37
38 typedef struct _GDBusProxyClass   GDBusProxyClass;
39 typedef struct _GDBusProxyPrivate GDBusProxyPrivate;
40
41 /**
42  * GDBusProxy:
43  *
44  * The #GDBusProxy structure contains only private data and
45  * should only be accessed using the provided API.
46  *
47  * Since: 2.26
48  */
49 struct _GDBusProxy
50 {
51   /*< private >*/
52   GObject parent_instance;
53   GDBusProxyPrivate *priv;
54 };
55
56 /**
57  * GDBusProxyClass:
58  * @g_properties_changed: Signal class handler for the #GDBusProxy::g-properties-changed signal.
59  * @g_signal: Signal class handler for the #GDBusProxy::g-signal signal.
60  *
61  * Class structure for #GDBusProxy.
62  *
63  * Since: 2.26
64  */
65 struct _GDBusProxyClass
66 {
67   /*< private >*/
68   GObjectClass parent_class;
69
70   /*< public >*/
71   /* Signals */
72   void (*g_properties_changed) (GDBusProxy   *proxy,
73                                 GVariant     *changed_properties);
74   void (*g_signal)             (GDBusProxy   *proxy,
75                                 const gchar  *sender_name,
76                                 const gchar  *signal_name,
77                                 GVariant     *parameters);
78
79   /*< private >*/
80   /* Padding for future expansion */
81   void (*_g_reserved1) (void);
82   void (*_g_reserved2) (void);
83   void (*_g_reserved3) (void);
84   void (*_g_reserved4) (void);
85   void (*_g_reserved5) (void);
86   void (*_g_reserved6) (void);
87   void (*_g_reserved7) (void);
88   void (*_g_reserved8) (void);
89 };
90
91 GType            g_dbus_proxy_get_type                  (void) G_GNUC_CONST;
92 void             g_dbus_proxy_new                       (GDBusConnection     *connection,
93                                                          GType                object_type,
94                                                          GDBusProxyFlags      flags,
95                                                          GDBusInterfaceInfo *info,
96                                                          const gchar         *unique_bus_name,
97                                                          const gchar         *object_path,
98                                                          const gchar         *interface_name,
99                                                          GCancellable        *cancellable,
100                                                          GAsyncReadyCallback  callback,
101                                                          gpointer             user_data);
102 GDBusProxy      *g_dbus_proxy_new_finish                (GAsyncResult        *res,
103                                                          GError             **error);
104 GDBusProxy      *g_dbus_proxy_new_sync                  (GDBusConnection     *connection,
105                                                          GType                object_type,
106                                                          GDBusProxyFlags      flags,
107                                                          GDBusInterfaceInfo *info,
108                                                          const gchar         *unique_bus_name,
109                                                          const gchar         *object_path,
110                                                          const gchar         *interface_name,
111                                                          GCancellable        *cancellable,
112                                                          GError             **error);
113 GDBusConnection *g_dbus_proxy_get_connection            (GDBusProxy          *proxy);
114 GDBusProxyFlags  g_dbus_proxy_get_flags                 (GDBusProxy          *proxy);
115 const gchar     *g_dbus_proxy_get_unique_bus_name       (GDBusProxy          *proxy);
116 const gchar     *g_dbus_proxy_get_object_path           (GDBusProxy          *proxy);
117 const gchar     *g_dbus_proxy_get_interface_name        (GDBusProxy          *proxy);
118 gint             g_dbus_proxy_get_default_timeout       (GDBusProxy          *proxy);
119 void             g_dbus_proxy_set_default_timeout       (GDBusProxy          *proxy,
120                                                          gint                 timeout_msec);
121 GDBusInterfaceInfo *g_dbus_proxy_get_interface_info     (GDBusProxy          *proxy);
122 void             g_dbus_proxy_set_interface_info        (GDBusProxy           *proxy,
123                                                          GDBusInterfaceInfo   *info);
124 GVariant        *g_dbus_proxy_get_cached_property       (GDBusProxy          *proxy,
125                                                          const gchar         *property_name,
126                                                          GError             **error);
127 gchar          **g_dbus_proxy_get_cached_property_names (GDBusProxy          *proxy,
128                                                          GError             **error);
129 void             g_dbus_proxy_call                      (GDBusProxy          *proxy,
130                                                          const gchar         *method_name,
131                                                          GVariant            *parameters,
132                                                          GDBusCallFlags       flags,
133                                                          gint                 timeout_msec,
134                                                          GCancellable        *cancellable,
135                                                          GAsyncReadyCallback  callback,
136                                                          gpointer             user_data);
137 GVariant        *g_dbus_proxy_call_finish               (GDBusProxy          *proxy,
138                                                          GAsyncResult        *res,
139                                                          GError             **error);
140 GVariant        *g_dbus_proxy_call_sync                 (GDBusProxy          *proxy,
141                                                          const gchar         *method_name,
142                                                          GVariant            *parameters,
143                                                          GDBusCallFlags       flags,
144                                                          gint                 timeout_msec,
145                                                          GCancellable        *cancellable,
146                                                          GError             **error);
147
148 G_END_DECLS
149
150 #endif /* __G_DBUS_PROXY_H__ */