Update media-service-upnp to version 0.3.0 ( ca17a69 )
[profile/ivi/media-service-upnp.git] / src / chain-task.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  * Ludovic Ferrandis <ludovic.ferrandis@intel.com>
20  *
21  */
22
23 #ifndef MSU_CHAIN_TASK_H__
24 #define MSU_CHAIN_TASK_H__
25
26 #include <libgupnp/gupnp-service-proxy.h>
27 #include "async.h"
28
29 typedef struct msu_chain_task_t_ msu_chain_task_t;
30
31 typedef GUPnPServiceProxyAction * (*msu_chain_task_action)
32                                 (msu_chain_task_t *chain, gboolean *failed);
33
34 typedef void (*msu_chain_task_end)(msu_chain_task_t *chain, gpointer data);
35
36 msu_chain_task_t *msu_chain_task_new(msu_chain_task_end end_func,
37                                      gpointer end_data);
38
39 void msu_chain_task_delete(msu_chain_task_t *chain);
40
41 void msu_chain_task_add(msu_chain_task_t *chain,
42                         msu_chain_task_action action,
43                         msu_device_t *device,
44                         GUPnPServiceProxyActionCallback action_cb,
45                         GDestroyNotify free_func,
46                         gpointer cb_user_data);
47
48 void msu_chain_task_start(msu_chain_task_t *chain);
49
50 void msu_chain_task_begin_action_cb(GUPnPServiceProxy *proxy,
51                                     GUPnPServiceProxyAction *action,
52                                     gpointer user_data);
53
54 void msu_chain_task_cancel(msu_chain_task_t *chain);
55 gboolean msu_chain_task_is_canceled(msu_chain_task_t *chain);
56
57 msu_device_t *msu_chain_task_get_device(msu_chain_task_t *chain);
58 gpointer *msu_chain_task_get_user_data(msu_chain_task_t *chain);
59
60 #endif /* MSU_CHAIN_TASK_H__ */