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