2 * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd.
4 * Author: Jorn Baayen <jorn@openedhand.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef __GUPNP_SERVICE_PROXY_H__
23 #define __GUPNP_SERVICE_PROXY_H__
25 #include "gupnp-error.h"
26 #include "gupnp-service-info.h"
31 gupnp_service_proxy_get_type (void) G_GNUC_CONST;
33 #define GUPNP_TYPE_SERVICE_PROXY \
34 (gupnp_service_proxy_get_type ())
35 #define GUPNP_SERVICE_PROXY(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
37 GUPNP_TYPE_SERVICE_PROXY, \
39 #define GUPNP_SERVICE_PROXY_CLASS(obj) \
40 (G_TYPE_CHECK_CLASS_CAST ((obj), \
41 GUPNP_TYPE_SERVICE_PROXY, \
42 GUPnPServiceProxyClass))
43 #define GUPNP_IS_SERVICE_PROXY(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
45 GUPNP_TYPE_SERVICE_PROXY))
46 #define GUPNP_IS_SERVICE_PROXY_CLASS(obj) \
47 (G_TYPE_CHECK_CLASS_TYPE ((obj), \
48 GUPNP_TYPE_SERVICE_PROXY))
49 #define GUPNP_SERVICE_PROXY_GET_CLASS(obj) \
50 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
51 GUPNP_TYPE_SERVICE_PROXY, \
52 GUPnPServiceProxyClass))
54 typedef struct _GUPnPServiceProxyPrivate GUPnPServiceProxyPrivate;
55 typedef struct _GUPnPServiceProxy GUPnPServiceProxy;
56 typedef struct _GUPnPServiceProxyClass GUPnPServiceProxyClass;
61 * This struct contains private data only, and should be accessed using the
64 struct _GUPnPServiceProxy {
65 GUPnPServiceInfo parent;
67 GUPnPServiceProxyPrivate *priv;
70 struct _GUPnPServiceProxyClass {
71 GUPnPServiceInfoClass parent_class;
74 void (* subscription_lost) (GUPnPServiceProxy *proxy,
75 const GError *reason);
78 void (* _gupnp_reserved1) (void);
79 void (* _gupnp_reserved2) (void);
80 void (* _gupnp_reserved3) (void);
81 void (* _gupnp_reserved4) (void);
85 * GUPnPServiceProxyAction:
87 * Opaque structure for holding in-progress action data.
89 typedef struct _GUPnPServiceProxyAction GUPnPServiceProxyAction;
92 * GUPnPServiceProxyActionCallback:
93 * @proxy: The #GUPnPServiceProxy @action is called from
94 * @action: The #GUPnPServiceProxyAction in progress
95 * @user_data: User data
97 * Callback notifying that @action on @proxy has returned and
98 * gupnp_service_proxy_end_action() etc can be called.
100 typedef void (* GUPnPServiceProxyActionCallback) (
101 GUPnPServiceProxy *proxy,
102 GUPnPServiceProxyAction *action,
106 * GUPnPServiceProxyNotifyCallback:
107 * @proxy: The #GUPnPServiceProxy the notification originates from
108 * @variable: The name of the variable being notified
109 * @value: The #GValue of the variable being notified
110 * @user_data: User data
112 * Callback notifying that the state variable @variable on @proxy has changed to
115 typedef void (* GUPnPServiceProxyNotifyCallback) (GUPnPServiceProxy *proxy,
116 const char *variable,
121 gupnp_service_proxy_send_action (GUPnPServiceProxy *proxy,
124 ...) G_GNUC_NULL_TERMINATED;
127 gupnp_service_proxy_send_action_valist
128 (GUPnPServiceProxy *proxy,
134 gupnp_service_proxy_send_action_hash
135 (GUPnPServiceProxy *proxy,
139 GHashTable *out_hash);
143 gupnp_service_proxy_send_action_list (GUPnPServiceProxy *proxy,
153 GUPnPServiceProxyAction *
154 gupnp_service_proxy_begin_action (GUPnPServiceProxy *proxy,
156 GUPnPServiceProxyActionCallback callback,
158 ...) G_GNUC_NULL_TERMINATED;
160 GUPnPServiceProxyAction *
161 gupnp_service_proxy_begin_action_valist
162 (GUPnPServiceProxy *proxy,
164 GUPnPServiceProxyActionCallback callback,
168 GUPnPServiceProxyAction *
169 gupnp_service_proxy_begin_action_list
170 (GUPnPServiceProxy *proxy,
174 GUPnPServiceProxyActionCallback callback,
177 GUPnPServiceProxyAction *
178 gupnp_service_proxy_begin_action_hash
179 (GUPnPServiceProxy *proxy,
181 GUPnPServiceProxyActionCallback callback,
186 gupnp_service_proxy_end_action (GUPnPServiceProxy *proxy,
187 GUPnPServiceProxyAction *action,
189 ...) G_GNUC_NULL_TERMINATED;
192 gupnp_service_proxy_end_action_valist
193 (GUPnPServiceProxy *proxy,
194 GUPnPServiceProxyAction *action,
199 gupnp_service_proxy_end_action_list
200 (GUPnPServiceProxy *proxy,
201 GUPnPServiceProxyAction *action,
208 gupnp_service_proxy_end_action_hash
209 (GUPnPServiceProxy *proxy,
210 GUPnPServiceProxyAction *action,
215 gupnp_service_proxy_cancel_action (GUPnPServiceProxy *proxy,
216 GUPnPServiceProxyAction *action);
219 gupnp_service_proxy_add_notify (GUPnPServiceProxy *proxy,
220 const char *variable,
222 GUPnPServiceProxyNotifyCallback callback,
226 gupnp_service_proxy_remove_notify (GUPnPServiceProxy *proxy,
227 const char *variable,
228 GUPnPServiceProxyNotifyCallback callback,
232 gupnp_service_proxy_set_subscribed (GUPnPServiceProxy *proxy,
233 gboolean subscribed);
236 gupnp_service_proxy_get_subscribed (GUPnPServiceProxy *proxy);
240 #endif /* __GUPNP_SERVICE_PROXY_H__ */