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., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, 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;
59 * This struct contains private data only, and should be accessed using the
63 GUPnPServiceInfo parent;
65 GUPnPServiceProxyPrivate *priv;
69 GUPnPServiceInfoClass parent_class;
72 void (* subscription_lost) (GUPnPServiceProxy *proxy,
73 const GError *reason);
76 void (* _gupnp_reserved1) (void);
77 void (* _gupnp_reserved2) (void);
78 void (* _gupnp_reserved3) (void);
79 void (* _gupnp_reserved4) (void);
80 } GUPnPServiceProxyClass;
83 * GUPnPServiceProxyAction
85 * Opaque structure for holding in-progress action data.
87 typedef struct _GUPnPServiceProxyAction GUPnPServiceProxyAction;
90 * GUPnPServiceProxyActionCallback:
91 * @proxy: The #GUPnPServiceProxy @action is called from
92 * @action: The #GUPnPServiceProxyAction in progress
93 * @user_data: User data
95 * Callback notifying that @action on @proxy has returned and
96 * gupnp_service_proxy_end_action() etc can be called.
98 typedef void (* GUPnPServiceProxyActionCallback) (
99 GUPnPServiceProxy *proxy,
100 GUPnPServiceProxyAction *action,
104 * GUPnPServiceProxyNotifyCallback:
105 * @proxy: The #GUPnPServiceProxy the notification originates from
106 * @variable: The name of the variable being notified
107 * @value: The #GValue of the variable being notified
108 * @user_data: User data
110 * Callback notifying that the state variable @variable on @proxy has changed to
113 typedef void (* GUPnPServiceProxyNotifyCallback) (GUPnPServiceProxy *proxy,
114 const char *variable,
119 gupnp_service_proxy_send_action (GUPnPServiceProxy *proxy,
122 ...) G_GNUC_NULL_TERMINATED;
125 gupnp_service_proxy_send_action_valist
126 (GUPnPServiceProxy *proxy,
132 gupnp_service_proxy_send_action_hash
133 (GUPnPServiceProxy *proxy,
137 GHashTable *out_hash);
141 gupnp_service_proxy_send_action_list (GUPnPServiceProxy *proxy,
151 GUPnPServiceProxyAction *
152 gupnp_service_proxy_begin_action (GUPnPServiceProxy *proxy,
154 GUPnPServiceProxyActionCallback callback,
156 ...) G_GNUC_NULL_TERMINATED;
158 GUPnPServiceProxyAction *
159 gupnp_service_proxy_begin_action_valist
160 (GUPnPServiceProxy *proxy,
162 GUPnPServiceProxyActionCallback callback,
166 GUPnPServiceProxyAction *
167 gupnp_service_proxy_begin_action_list
168 (GUPnPServiceProxy *proxy,
172 GUPnPServiceProxyActionCallback callback,
175 GUPnPServiceProxyAction *
176 gupnp_service_proxy_begin_action_hash
177 (GUPnPServiceProxy *proxy,
179 GUPnPServiceProxyActionCallback callback,
184 gupnp_service_proxy_end_action (GUPnPServiceProxy *proxy,
185 GUPnPServiceProxyAction *action,
187 ...) G_GNUC_NULL_TERMINATED;
190 gupnp_service_proxy_end_action_valist
191 (GUPnPServiceProxy *proxy,
192 GUPnPServiceProxyAction *action,
197 gupnp_service_proxy_end_action_list
198 (GUPnPServiceProxy *proxy,
199 GUPnPServiceProxyAction *action,
206 gupnp_service_proxy_end_action_hash
207 (GUPnPServiceProxy *proxy,
208 GUPnPServiceProxyAction *action,
213 gupnp_service_proxy_cancel_action (GUPnPServiceProxy *proxy,
214 GUPnPServiceProxyAction *action);
217 gupnp_service_proxy_add_notify (GUPnPServiceProxy *proxy,
218 const char *variable,
220 GUPnPServiceProxyNotifyCallback callback,
224 gupnp_service_proxy_remove_notify (GUPnPServiceProxy *proxy,
225 const char *variable,
226 GUPnPServiceProxyNotifyCallback callback,
230 gupnp_service_proxy_set_subscribed (GUPnPServiceProxy *proxy,
231 gboolean subscribed);
234 gupnp_service_proxy_get_subscribed (GUPnPServiceProxy *proxy);
238 #endif /* __GUPNP_SERVICE_PROXY_H__ */