Add the privilege check for GATT SERVER APIs
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-opp-client.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
19 #ifndef _BT_SERVICE_OPP_CLIENT_H_
20 #define _BT_SERVICE_OPP_CLIENT_H_
21
22 #include <glib.h>
23 #include <sys/types.h>
24 #include <gio/gio.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 enum {
35         BT_TRANSFER_STATUS_QUEUED = 0x00,
36         BT_TRANSFER_STATUS_STARTED,
37         BT_TRANSFER_STATUS_PROGRESS,
38         BT_TRANSFER_STATUS_COMPLETED,
39 } bt_transfer_status_t;
40
41 typedef struct {
42         char path[BT_FILE_PATH_MAX];
43 } bt_file_path_t;
44
45 typedef struct {
46         GDBusProxy *proxy;
47         GDBusProxy *properties_proxy;
48         char *transfer_name;
49         char *file_name;
50         char *transfer_path;
51         bt_transfer_status_t transfer_status;
52         gint64 size;
53 } bt_transfer_info_t;
54
55 typedef struct {
56         int request_id;
57         int result;
58
59         int file_count;
60         int file_offset;
61         char **file_name_array;
62         char *session_path;
63
64         char *address;
65         gboolean is_canceled;
66         bt_transfer_info_t *transfer_info;
67 } bt_sending_info_t;
68
69 typedef struct {
70         char *address;
71         char **file_path;
72         int file_count;
73         int request_id;
74 } bt_sending_data_t;
75
76
77 int _bt_opp_client_push_files(int request_id, GDBusMethodInvocation *context,
78                                 bluetooth_device_address_t *remote_address,
79                                 char **file_path, int file_count);
80
81 int _bt_opp_client_cancel_push(void);
82
83 int _bt_opp_client_cancel_all_transfers(void);
84
85 int _bt_opp_client_is_sending(gboolean *sending);
86
87 void _bt_sending_files(void);
88
89 void _bt_opc_disconnected(const char *session_path);
90
91 gboolean _bt_obex_client_progress(const char *transfer_path, int transferred);
92
93 gboolean _bt_obex_client_started(const char *transfer_path);
94
95 gboolean _bt_obex_client_completed(const char *transfer_path, gboolean success);
96
97 void _bt_opp_client_check_pending_transfer(const char *address);
98
99 #ifdef __cplusplus
100 }
101 #endif /* __cplusplus */
102 #endif /*_BT_SERVICE_OPP_CLIENT_H_*/
103