8f6b5a62e7452b14cbaeac239df3ed6b8a80df01
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-opp-client.h
1 /*
2  * bluetooth-frwk
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *              http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef _BT_SERVICE_OPP_CLIENT_H_
21 #define _BT_SERVICE_OPP_CLIENT_H_
22
23 #include <glib.h>
24 #include <sys/types.h>
25 #include "bluetooth-api.h"
26 #include "bt-internal-types.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #define BT_OBEX_CLIENT_AGENT_PATH "/org/obex/client_agent"
33
34 typedef struct {
35         char path[BT_FILE_PATH_MAX];
36 } bt_file_path_t;
37
38 typedef struct {
39         DBusGProxy *proxy;
40         char *transfer_name;
41         char *file_name;
42         gint64 size;
43 } bt_transfer_info_t;
44
45 typedef struct {
46         int request_id;
47         int result;
48         int file_count;
49         int file_offset;
50         char **file_name_array;
51         char *session_path;
52         char *address;
53         gboolean is_canceled;
54         DBusGProxyCall *sending_proxy;
55         bt_transfer_info_t *transfer_info;
56 } bt_sending_info_t;
57
58 typedef struct {
59         char *address;
60         char **file_path;
61         int file_count;
62         int request_id;
63 } bt_sending_data_t;
64
65 int _bt_opp_client_push_files(int request_id, DBusGMethodInvocation *context,
66                                 bluetooth_device_address_t *remote_address,
67                                 char **file_path, int file_count);
68
69 int _bt_opp_client_cancel_push(void);
70
71 int _bt_opp_client_cancel_all_transfers(void);
72
73 int _bt_opp_client_is_sending(gboolean *sending);
74
75 void _bt_sending_files();
76
77 gboolean _bt_obex_client_progress(int transferred);
78
79 gboolean _bt_obex_client_started(const char *transfer_path);
80
81 gboolean _bt_obex_client_completed(gboolean success);
82
83 #ifdef __cplusplus
84 }
85 #endif /* __cplusplus */
86 #endif /*_BT_SERVICE_OPP_CLIENT_H_*/
87