4 * Copyright (C) 2012 Intel Corporation. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU Lesser General Public License,
8 * version 2.1, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 * Mark Ryan <mark.d.ryan@intel.com>
23 #ifndef MSU_DEVICE_H__
24 #define MSU_DEVICE_H__
26 #include <libgupnp/gupnp-control-point.h>
29 #include "chain-task.h"
33 typedef struct msu_device_context_t_ msu_device_context_t;
34 struct msu_device_context_t_ {
36 GUPnPDeviceProxy *device_proxy;
37 GUPnPServiceProxy *service_proxy;
43 struct msu_device_t_ {
44 GDBusConnection *connection;
50 GHashTable *upload_jobs;
52 guint system_update_id;
53 GVariant *search_caps;
55 GVariant *sort_ext_caps;
56 GVariant *feature_list;
57 gboolean shutting_down;
60 void msu_device_append_new_context(msu_device_t *device,
61 const gchar *ip_address,
62 GUPnPDeviceProxy *proxy);
63 void msu_device_delete(void *device);
64 msu_device_t *msu_device_new(GDBusConnection *connection,
65 GUPnPDeviceProxy *proxy,
66 const gchar *ip_address,
67 const GDBusSubtreeVTable *vtable,
69 GHashTable *filter_map,
71 msu_chain_task_t *chain);
73 msu_device_t *msu_device_from_path(const gchar *path, GHashTable *device_list);
74 msu_device_context_t *msu_device_get_context(msu_device_t *device,
75 msu_client_t *client);
76 void msu_device_get_children(msu_device_t *device, msu_client_t *client,
77 msu_task_t *task, msu_async_cb_data_t *cb_data,
78 const gchar *upnp_filter, const gchar *sort_by,
79 GCancellable *cancellable);
80 void msu_device_get_all_props(msu_device_t *device, msu_client_t *client,
82 msu_async_cb_data_t *cb_data,
84 GCancellable *cancellable);
85 void msu_device_get_prop(msu_device_t *device, msu_client_t *client,
86 msu_task_t *task, msu_async_cb_data_t *cb_data,
87 msu_prop_map_t *prop_map, gboolean root_object,
88 GCancellable *cancellable);
89 void msu_device_search(msu_device_t *device, msu_client_t *client,
90 msu_task_t *task, msu_async_cb_data_t *cb_data,
91 const gchar *upnp_filter, const gchar *upnp_query,
92 const gchar *sort_by, GCancellable *cancellable);
93 void msu_device_get_resource(msu_device_t *device, msu_client_t *client,
95 msu_async_cb_data_t *cb_data,
96 const gchar *upnp_filter,
97 GCancellable *cancellable);
98 void msu_device_subscribe_to_contents_change(msu_device_t *device);
99 void msu_device_upload(msu_device_t *device, msu_client_t *client,
100 msu_task_t *task, const gchar *parent_id,
101 msu_async_cb_data_t *cb_data, GCancellable *cancellable);
102 gboolean msu_device_get_upload_status(msu_device_t *device,
103 msu_task_t *task, GError **error);
104 gboolean msu_device_cancel_upload(msu_device_t *device, msu_task_t *task,
106 void msu_device_get_upload_ids(msu_device_t *device, msu_task_t *task);
107 void msu_device_delete_object(msu_device_t *device, msu_client_t *client,
109 msu_async_cb_data_t *cb_data,
110 GCancellable *cancellable);
111 void msu_device_create_container(msu_device_t *device, msu_client_t *client,
113 const gchar *parent_id,
114 msu_async_cb_data_t *cb_data,
115 GCancellable *cancellable);
116 void msu_device_update_object(msu_device_t *device, msu_client_t *client,
118 msu_async_cb_data_t *cb_data,
119 const gchar *upnp_filter,
120 GCancellable *cancellable);