Update media-service-upnp to version 0.3.0 ( ca17a69 )
[profile/ivi/media-service-upnp.git] / src / upnp.h
1 /*
2  * media-service-upnp
3  *
4  * Copyright (C) 2012 Intel Corporation. All rights reserved.
5  *
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.
9  *
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
13  * for more details.
14  *
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.
18  *
19  * Mark Ryan <mark.d.ryan@intel.com>
20  *
21  */
22
23 #ifndef MSU_UPNP_H__
24 #define MSU_UPNP_H__
25
26 #include "client.h"
27 #include "task.h"
28
29 typedef struct msu_upnp_t_ msu_upnp_t;
30
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
38 };
39
40 typedef struct msu_interface_info_t_ msu_interface_info_t;
41 struct msu_interface_info_t_ {
42         GDBusInterfaceInfo *interface;
43         const GDBusInterfaceVTable *vtable;
44 };
45
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,
48                                          GError *error);
49
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,
54                          void *user_data);
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,
58                            msu_task_t *task,
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,
62                             msu_task_t *task,
63                             GCancellable *cancellable,
64                             msu_upnp_task_complete_t cb);
65 void msu_upnp_get_prop(msu_upnp_t *upnp, msu_client_t *client,
66                        msu_task_t *task,
67                        GCancellable *cancellable,
68                        msu_upnp_task_complete_t cb);
69 void msu_upnp_search(msu_upnp_t *upnp, msu_client_t *client,
70                      msu_task_t *task,
71                      GCancellable *cancellable,
72                      msu_upnp_task_complete_t cb);
73 void msu_upnp_get_resource(msu_upnp_t *upnp, msu_client_t *client,
74                            msu_task_t *task,
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,
78                             msu_task_t *task,
79                             GCancellable *cancellable,
80                             msu_upnp_task_complete_t cb);
81 void msu_upnp_upload(msu_upnp_t *upnp, msu_client_t *client,
82                      msu_task_t *task,
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,
89                             msu_task_t *task,
90                             GCancellable *cancellable,
91                             msu_upnp_task_complete_t cb);
92 void msu_upnp_create_container(msu_upnp_t *upnp, msu_client_t *client,
93                                msu_task_t *task,
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,
97                                       msu_task_t *task,
98                                       GCancellable *cancellable,
99                                       msu_upnp_task_complete_t cb);
100 void msu_upnp_update_object(msu_upnp_t *upnp, msu_client_t *client,
101                             msu_task_t *task,
102                             GCancellable *cancellable,
103                             msu_upnp_task_complete_t cb);
104 #endif