Cody sync.: merge tizen 2.4 code from spin git
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-obex-agent.h
1 /*
2  *  Bluetooth-frwk
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Girishashok Joshi <girish.joshi@samsung.com>
8  *               Chanyeol Park <chanyeol.park@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *              http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24 #ifndef __BT_SERVICE_OBEX_AGENT_H
25 #define __BT_SERVICE_OBEX_AGENT_H
26
27 #include <glib-object.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 typedef enum {
34         BT_OBEX_AGENT_ERROR_REJECT,
35         BT_OBEX_AGENT_ERROR_CANCEL,
36         BT_OBEX_AGENT_ERROR_TIMEOUT,
37 } bt_agent_error_t;
38
39 G_BEGIN_DECLS
40 typedef struct {
41         GObject parent;
42 } BtObexAgent;
43
44 typedef struct {
45         GObjectClass parent_class;
46 } BtObexAgentClass;
47
48 GType bt_obex_agent_get_type(void);
49
50 #define BT_OBEX_TYPE_AGENT (bt_obex_agent_get_type())
51 #define BT_OBEX_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BT_OBEX_TYPE_AGENT, BtObexAgent))
52 #define BT_OBEX_AGENT_CLASS(agent_class) (G_TYPE_CHECK_CLASS_CAST((agent_class), BT_OBEX_TYPE_AGENT, BtObexAgentClass))
53 #define BT_OBEX_GET_AGENT_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BT_OBEX_TYPE_AGENT, BtObexAgentClass))
54
55 typedef gboolean(*bt_obex_authorize_cb)(GDBusMethodInvocation *context,
56                                            const char *path,
57                                            gpointer data);
58
59 typedef gboolean(*bt_obex_request_cb)(GDBusMethodInvocation *context,
60                                 GDBusProxy *transfer,
61                                 gpointer data);
62
63 typedef gboolean(*bt_obex_progress_cb)(GDBusMethodInvocation *context,
64                                 GDBusProxy *transfer,
65                                 guint64 transferred,
66                                 gpointer data);
67
68 typedef gboolean(*bt_obex_error_cb)(GDBusMethodInvocation *context,
69                                 GDBusProxy *transfer,
70                                 const char *message,
71                                 gpointer data);
72
73 typedef gboolean(*bt_obex_complete_cb)(GDBusMethodInvocation *context,
74                                 GDBusProxy *transfer,
75                                 gpointer data);
76
77 typedef gboolean(*bt_obex_release_cb)(GDBusMethodInvocation *context,
78                                 gpointer data);
79
80 G_END_DECLS
81
82 void _bt_obex_set_authorize_cb(char *object_path,
83                          bt_obex_authorize_cb func,
84                          gpointer data);
85
86 void _bt_obex_set_request_cb(char *object_path,
87                        bt_obex_request_cb func,
88                        gpointer data);
89
90 void _bt_obex_set_progress_cb(char *object_path,
91                         bt_obex_progress_cb func,
92                         gpointer data);
93
94 void _bt_obex_set_error_cb(char *object_path,
95                         bt_obex_error_cb func,
96                         gpointer data);
97
98 void _bt_obex_set_complete_cb(char *object_path,
99                         bt_obex_complete_cb func,
100                         gpointer data);
101
102 void _bt_obex_set_release_cb(char *object_path,
103                        bt_obex_release_cb func,
104                        gpointer data);
105
106 void _bt_obex_agent_new(char *path);
107
108 void _bt_obex_agent_destroy(char *path);
109
110 gboolean _bt_obex_setup(const char *path);
111
112 #ifdef __cplusplus
113 }
114 #endif /* __cplusplus */
115
116 #endif /* __BT_SERVICE_OBEX_AGENT_H */