cc01ed6af390a18bf29a3c695b5ece9910fc8724
[platform/core/connectivity/bluetooth-share.git] / bt-share / include / bt-share-common.h
1 /*
2  * bluetooth-share
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *              http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __DEF_BLUETOOTH_SHARE_COMMON_H_
21 #define __DEF_BLUETOOTH_SHARE_COMMON_H_
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include <glib.h>
28
29 /* Define Error type */
30 #define BT_SHARE_FAIL -1
31 #define BT_SHARE_ERROR_NONE 0
32
33 #define BT_DEFAULT_MEM_PHONE 0
34 #define BT_DEFAULT_MEM_MMC 1
35
36 #define STORAGE_PATH_LEN_MAX 255
37
38 #define BT_DOWNLOAD_DEFAULT_PHONE_FOLDER "/home/owner/content/Downloads"
39 #define BT_DOWNLOAD_DEFAULT_MMC_FOLDER "/opt/media/SDCardA1"
40 #define BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER "/home/owner/content/Downloads"
41 //#define BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER tzplatform_getenv(TZ_USER_CONTENT)
42
43 /*
44 #define BT_FTP_FOLDER tzplatform_mkpath(TZ_SYS_SHARE, "bt-ftp")
45 */
46
47 #define BT_DOWNLOAD_PHONE_ROOT "/home/owner/content/"
48 #define BT_DOWNLOAD_MMC_ROOT "/opt/media/SDCardA1"
49 #define BT_FTP_FOLDER "/opt/share/bt-ftp"
50 #define BT_FTP_FOLDER_PHONE "/opt/share/bt-ftp/Media/"
51 #define BT_FTP_FOLDER_MMC "/opt/share/bt-ftp/SD_External/"
52
53 //#define BT_TMP_DIR "/opt/home/owner/content/Downloads/.bluetooth/"
54 #define BT_TMP_DIR "/home/owner/content/Downloads/"
55 #define BT_TMP_FILE BT_TMP_DIR"bluetooth_content_share"
56 #define TXT_FILE_NAME BT_TMP_DIR"bluetooth_content_share.txt"
57 #define HTML_FILE_NAME BT_TMP_DIR"bluetooth_content_share.html"
58 #define TXT_FILE_FORMAT BT_TMP_DIR"bluetooth_content_share%s.txt"
59 #define HTML_FILE_FORMAT BT_TMP_DIR"bluetooth_content_share%s.html"
60 #define HTML_FORMAT "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"/></head><body><a href=\"%s\">%s</a></body></html>"
61
62 //#define BT_CONTACT_SHARE_TMP_DIR "/opt/home/owner/content/Downloads/.bluetooth/"
63 #define BT_CONTACT_SHARE_TMP_DIR "/home/owner/content/Downloads/"
64
65 typedef enum {
66         BT_HTTP_FILE,
67         BT_TXT_FILE,
68 } bt_file_t;
69
70 typedef enum {
71         BT_STATUS_OFF         = 0x0000,
72         BT_STATUS_ON          = 0x0001,
73         BT_STATUS_BT_VISIBLE  = 0x0002,
74         BT_STATUS_TRANSFER    = 0x0004,
75 } bt_status_t;
76
77
78 int _bt_share_block_sleep(gboolean is_block);
79 int _bt_set_transfer_indicator(gboolean state);
80 char *_bt_share_create_transfer_file(char *text);
81 void _bt_remove_tmp_file(char *file_path);
82 void _bt_remove_vcf_file(char *file_path);
83 char *_bt_share_get_storage_path(int storage_type);
84
85 #ifdef __cplusplus
86 }
87 #endif
88 #endif                          /* __DEF_BLUETOOTH_SHARE_COMMON_H_ */