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>
29 typedef struct msu_upnp_t_ msu_upnp_t;
31 enum msu_interface_type_ {
32 MSU_INTERFACE_INFO_PROPERTIES,
33 MSU_INTERFACE_INFO_OBJECT,
34 MSU_INTERFACE_INFO_CONTAINER,
35 MSU_INTERFACE_INFO_ITEM,
36 MSU_INTERFACE_INFO_DEVICE,
37 MSU_INTERFACE_INFO_MAX
40 typedef struct msu_interface_info_t_ msu_interface_info_t;
41 struct msu_interface_info_t_ {
42 GDBusInterfaceInfo *interface;
43 const GDBusInterfaceVTable *vtable;
46 typedef void (*msu_upnp_callback_t)(const gchar *path, void *user_data);
47 typedef void (*msu_upnp_task_complete_t)(msu_task_t *task, GVariant *result,
50 msu_upnp_t *msu_upnp_new(GDBusConnection *connection,
51 msu_interface_info_t *interface_info,
52 msu_upnp_callback_t found_server,
53 msu_upnp_callback_t lost_server,
55 void msu_upnp_delete(msu_upnp_t *upnp);
56 GVariant *msu_upnp_get_server_ids(msu_upnp_t *upnp);
57 void msu_upnp_get_children(msu_upnp_t *upnp, msu_client_t *client,
59 GCancellable *cancellable,
60 msu_upnp_task_complete_t cb);
61 void msu_upnp_get_all_props(msu_upnp_t *upnp, msu_client_t *client,
63 GCancellable *cancellable,
64 msu_upnp_task_complete_t cb);
65 void msu_upnp_get_prop(msu_upnp_t *upnp, msu_client_t *client,
67 GCancellable *cancellable,
68 msu_upnp_task_complete_t cb);
69 void msu_upnp_search(msu_upnp_t *upnp, msu_client_t *client,
71 GCancellable *cancellable,
72 msu_upnp_task_complete_t cb);
73 void msu_upnp_get_resource(msu_upnp_t *upnp, msu_client_t *client,
75 GCancellable *cancellable,
76 msu_upnp_task_complete_t cb);
77 void msu_upnp_upload_to_any(msu_upnp_t *upnp, msu_client_t *client,
79 GCancellable *cancellable,
80 msu_upnp_task_complete_t cb);
81 void msu_upnp_upload(msu_upnp_t *upnp, msu_client_t *client,
83 GCancellable *cancellable,
84 msu_upnp_task_complete_t cb);
85 void msu_upnp_get_upload_status(msu_upnp_t *upnp, msu_task_t *task);
86 void msu_upnp_get_upload_ids(msu_upnp_t *upnp, msu_task_t *task);
87 void msu_upnp_cancel_upload(msu_upnp_t *upnp, msu_task_t *task);
88 void msu_upnp_delete_object(msu_upnp_t *upnp, msu_client_t *client,
90 GCancellable *cancellable,
91 msu_upnp_task_complete_t cb);
92 void msu_upnp_create_container(msu_upnp_t *upnp, msu_client_t *client,
94 GCancellable *cancellable,
95 msu_upnp_task_complete_t cb);
96 void msu_upnp_create_container_in_any(msu_upnp_t *upnp, msu_client_t *client,
98 GCancellable *cancellable,
99 msu_upnp_task_complete_t cb);
100 void msu_upnp_update_object(msu_upnp_t *upnp, msu_client_t *client,
102 GCancellable *cancellable,
103 msu_upnp_task_complete_t cb);