Modify the genlist item style for IOT profile
[apps/native/bluetooth-share-ui.git] / src / bt-share-ui-ipc.h
1 /*
2 * bluetooth-share-ui
3 *
4 * Copyright 2012 Samsung Electronics Co., Ltd
5 *
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 *           GirishAshok Joshi <girish.joshi@samsung.com>
8 *           DoHyun Pyun <dh79.pyun@samsung.com>
9 *
10 * Licensed under the Flora License, Version 1.1 (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.tizenopensource.org/license
15 *
16 * Unless required by applicable law or agreed to in writing,
17 * software 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 #ifndef __DEF_BT_SHARE_UI_IPC_H_
25 #define __DEF_BT_SHARE_UI_IPC_H_
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #include "bluetooth-share-api.h"
32
33 #define BT_SHARE_UI_INTERFACE "User.BluetoothShare.UI"
34 #define BT_SHARE_UI_SIGNAL_OPPABORT "opp_abort"
35 #define BT_SHARE_UI_SIGNAL_SEND_FILE "send_file"
36 #define BT_SHARE_UI_SIGNAL_INFO_UPDATE "info_update"
37
38 #define BT_SHARE_ENG_INTERFACE "User.BluetoothShare.Engine"
39 #define BT_SHARE_ENG_OBJECT "/org/projectx/transfer_info"
40 #define BT_SHARE_ENG_SIGNAL_UPDATE_VIEW "update_view"
41 #define BT_INBOUND_TABLE        "inbound"
42 #define BT_OUTBOUND_TABLE       "outbound"
43
44 #define BT_EVENT_SERVICE "org.projectx.bt_event"
45 #define BT_OPP_CLIENT_PATH "/org/projectx/bt/opp_client"
46 #define BT_OPP_SERVER_PATH "/org/projectx/bt/opp_server"
47 #define BT_OPP_CONNECTED "OppConnected"
48 #define BT_OPP_CLIENT_DISCONNECTED "ShareOppClientDisconnected"
49 #define BT_OPP_SERVER_DISCONNECTED "ShareOppServerDisconnected"
50 #define BT_TRANSFER_STARTED "TransferStarted"
51 #define BT_TRANSFER_PROGRESS "TransferProgress"
52 #define BT_TRANSFER_COMPLETED "TransferCompleted"
53
54 #define BT_SHARE_UI_EVENT_BASE            ((int)(0x0000))               /**< No event */
55 #define BT_SHARE_UI_EVENT_GAP_BASE        ((int)(BT_SHARE_UI_EVENT_BASE + 0x0010))
56                                                                 /**< Base ID for GAP Event */
57 #define BT_SHARE_UI_EVENT_SDP_BASE        ((int)(BT_SHARE_UI_EVENT_GAP_BASE + 0x0020))
58                                                                 /**< Base ID for SDP events */
59 #define BT_SHARE_UI_EVENT_RFCOMM_BASE     ((int)(BT_SHARE_UI_EVENT_SDP_BASE + 0x0020))
60                                                                 /**< Base ID for RFCOMM events */
61 #define BT_SHARE_UI_EVENT_NETWORK_BASE     ((int)(BT_SHARE_UI_EVENT_RFCOMM_BASE + 0x0020))
62                                                                 /**< Base ID for NETWORK events */
63 #define BT_SHARE_UI_EVENT_HDP_BASE     ((int)(BT_SHARE_UI_EVENT_NETWORK_BASE + 0x0020))
64                                                                 /**< Base ID for HDP events */
65 #define BT_SHARE_UI_EVENT_OPC_BASE  ((int)(BT_SHARE_UI_EVENT_HDP_BASE + 0x0020))
66                                                                 /**< Base ID for OPC events */
67 #define BT_SHARE_UI_EVENT_OBEX_SERVER_BASE ((int)(BT_SHARE_UI_EVENT_OPC_BASE + 0x0020))
68                                                                 /**< Base ID for Obex Server events */
69
70 #define BT_SHARE_UI_ERROR_BASE                   ((int)0)               /**< Error code base */
71 #define BT_SHARE_UI_ERROR_NONE                   ((int)0)               /**< No error #0 */
72 #define BT_SHARE_UI_ERROR_CANCEL                 ((int)BT_SHARE_UI_ERROR_BASE - 0x01)
73 #define BT_SHARE_UI_ERROR_NOT_CONNECTED          ((int)BT_SHARE_UI_ERROR_BASE - 0x15)
74 #define BT_SHARE_UI_ERROR_CANCEL_BY_USER         ((int)BT_SHARE_UI_ERROR_BASE - 0x1b)
75
76 /**
77  * Bluetooth share event type
78  */
79 typedef enum {
80         BT_SHARE_UI_EVENT_OPC_CONNECTED = BT_SHARE_UI_EVENT_OPC_BASE,
81                                                                 /* OPC Connected event */
82         BT_SHARE_UI_EVENT_OPC_DISCONNECTED,             /* OPC Disonnected event */
83         BT_SHARE_UI_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
84         BT_SHARE_UI_EVENT_OPC_TRANSFER_PROGRESS,        /* OPC Transfer progress event */
85         BT_SHARE_UI_EVENT_OPC_TRANSFER_COMPLETE,        /* OPC Transfer Complete event */
86
87         BT_SHARE_UI_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BT_SHARE_UI_EVENT_OBEX_SERVER_BASE,
88                                                                 /* Obex server authorize event*/
89         BT_SHARE_UI_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
90         BT_SHARE_UI_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
91         BT_SHARE_UI_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
92         BT_SHARE_UI_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
93         BT_SHARE_UI_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
94         BT_SHARE_UI_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
95 } bt_share_ui_event_type_t;
96
97 /**
98  * Server type
99  */
100 typedef enum {
101         OPP_SERVER = 0x0,
102         FTP_SERVER
103 } bt_share_server_type_t;
104
105 /**
106  * Stucture to hold event information
107  */
108 typedef struct {
109         int event;      /**< event type */
110         int result;     /**< Success or error value */
111         void *param_data;
112                         /**<parameter data pointer */
113         void *user_data;
114 } bt_share_event_param_t;
115
116 /**
117  * Stucture to OPP client transfer information
118  */
119 typedef struct {
120         char *device_addr;
121         char *filename;
122         unsigned long size;
123         int percentage;
124 } bt_share_transfer_info_t;
125
126 /**
127  * Stucture to OPP/FTP server transfer information
128  */
129 typedef struct {
130         char *filename;
131         char *device_name;
132         char *file_path;
133         char *type;
134         int transfer_id;
135         unsigned long file_size;
136         int percentage;
137         bt_share_server_type_t server_type;
138         char *address;
139         unsigned char *contact_auth_info;
140 } bt_share_server_transfer_info_t;
141
142
143 void _bt_signal_init(bt_share_appdata_t *ad);
144 void _bt_signal_deinit(bt_share_appdata_t *ad);
145 int _bt_share_ui_ipc_info_update(bt_share_appdata_t *ad, int uid);
146 int _bt_abort_signal_send(bt_share_appdata_t *ad,
147                 bt_share_abort_data_t *abort_data);
148 void _bt_share_ui_event_handler(int event, bt_share_event_param_t *param,
149                                void *user_data);
150 void  _bt_share_ui_handle_update_view(bt_share_appdata_t *ad,
151                                                 char *table);
152 int _bt_share_ui_retry_failed(bt_share_appdata_t *ad);
153 void _bt_set_opc_launched_session(gboolean value);
154 #ifdef __cplusplus
155 }
156 #endif
157 #endif                          /* __DEF_BT_SHARE_UI_IPC_H_ */