4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 * GirishAshok Joshi <girish.joshi@samsung.com>
8 * DoHyun Pyun <dh79.pyun@samsung.com>
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
14 * http://www.tizenopensource.org/license
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.
24 #ifndef __DEF_BT_SHARE_UI_IPC_H_
25 #define __DEF_BT_SHARE_UI_IPC_H_
31 #include "bluetooth-share-api.h"
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"
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"
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"
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 */
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)
77 * Bluetooth share event type
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 */
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;
103 } bt_share_server_type_t;
106 * Stucture to hold event information
109 int event; /**< event type */
110 int result; /**< Success or error value */
112 /**<parameter data pointer */
114 } bt_share_event_param_t;
117 * Stucture to OPP client transfer information
124 } bt_share_transfer_info_t;
127 * Stucture to OPP/FTP server transfer information
135 unsigned long file_size;
137 bt_share_server_type_t server_type;
139 unsigned char *contact_auth_info;
140 } bt_share_server_transfer_info_t;
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,
150 void _bt_share_ui_handle_update_view(bt_share_appdata_t *ad,
152 int _bt_share_ui_retry_failed(bt_share_appdata_t *ad);
153 void _bt_set_opc_launched_session(gboolean value);
157 #endif /* __DEF_BT_SHARE_UI_IPC_H_ */