Add the sender name in signal subscribe function
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / services / obex / 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         guint64 progress;
54 } bt_transfer_info_t;
55
56 typedef struct {
57         int request_id;
58         int result;
59
60         int file_count;
61         int file_offset;
62         char **file_name_array;
63         char *session_path;
64
65         char *address;
66         gboolean is_canceled;
67         bt_transfer_info_t *transfer_info;
68 } bt_sending_info_t;
69
70 typedef struct {
71         char *address;
72         char **file_path;
73         int file_count;
74         int request_id;
75 } bt_sending_data_t;
76
77
78 int _bt_opp_client_push_files(int request_id, GDBusMethodInvocation *context,
79                                 bluetooth_device_address_t *remote_address,
80                                 char **file_path, int file_count);
81
82 int _bt_opp_client_cancel_push(void);
83
84 int _bt_opp_client_cancel_all_transfers(void);
85
86 int _bt_opp_client_is_sending(gboolean *sending);
87
88 void _bt_sending_files(void);
89
90 void _bt_opc_disconnected(const char *session_path);
91
92 gboolean _bt_obex_client_progress(const char *transfer_path, guint64 transferred);
93
94 gboolean _bt_obex_client_started(const char *transfer_path);
95
96 gboolean _bt_obex_client_completed(const char *transfer_path, gboolean success);
97
98 void _bt_opp_client_check_pending_transfer(const char *address);
99
100 int _bt_opp_get_client_progress(guint8 *progress);
101
102 void _bt_cancel_queued_transfers(void);
103 #ifdef __cplusplus
104 }
105 #endif /* __cplusplus */
106 #endif /*_BT_SERVICE_OPP_CLIENT_H_*/
107