Code Sync [Tizen3.0]: Merged the tizen_2.4 Spin code to tizen.org
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-opp-client.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
25 #ifndef _BT_SERVICE_OPP_CLIENT_H_
26 #define _BT_SERVICE_OPP_CLIENT_H_
27
28 #include <glib.h>
29 #include <sys/types.h>
30 #include "bluetooth-api.h"
31 #include "bt-internal-types.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define BT_OBEX_CLIENT_AGENT_PATH "/org/obex/client_agent"
38
39 typedef enum {
40         BT_TRANSFER_STATUS_QUEUED = 0x00,
41         BT_TRANSFER_STATUS_STARTED,
42         BT_TRANSFER_STATUS_PROGRESS,
43         BT_TRANSFER_STATUS_COMPLETED,
44 } bt_transfer_status_t;
45
46 typedef struct {
47         char path[BT_FILE_PATH_MAX];
48 } bt_file_path_t;
49
50 typedef struct {
51         DBusGProxy *proxy;
52         DBusGProxy *properties_proxy;
53         char *transfer_name;
54         char *file_name;
55         char *transfer_path;
56         bt_transfer_status_t transfer_status;
57         gint64 size;
58 } bt_transfer_info_t;
59
60 typedef struct {
61         int request_id;
62         int result;
63
64         int file_count;
65         int file_offset;
66         char **file_name_array;
67         char *session_path;
68
69         char *address;
70         gboolean is_canceled;
71         DBusGProxyCall *sending_proxy;
72         bt_transfer_info_t *transfer_info;
73 } bt_sending_info_t;
74
75 typedef struct {
76         char *address;
77         char **file_path;
78         int file_count;
79         int request_id;
80 } bt_sending_data_t;
81
82
83 int _bt_opp_client_push_files(int request_id, DBusGMethodInvocation *context,
84                                 bluetooth_device_address_t *remote_address,
85                                 char **file_path, int file_count);
86
87 int _bt_opp_client_cancel_push(void);
88
89 int _bt_opp_client_cancel_all_transfers(void);
90
91 int _bt_opp_client_is_sending(gboolean *sending);
92
93 void _bt_sending_files(void);
94
95 void _bt_opc_disconnected(const char *session_path);
96
97 gboolean _bt_obex_client_progress(const char *transfer_path, int transferred);
98
99 gboolean _bt_obex_client_started(const char *transfer_path);
100
101 gboolean _bt_obex_client_completed(const char *transfer_path, gboolean success);
102
103 void _bt_opp_client_check_pending_transfer(const char *address);
104
105 #ifdef __cplusplus
106 }
107 #endif /* __cplusplus */
108 #endif /*_BT_SERVICE_OPP_CLIENT_H_*/
109