[cleanup] revise file location
[platform/core/connectivity/bluetooth-share.git] / app / 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 #include <tzplatform_config.h>
29
30 /* Define Error type */
31 #define BT_SHARE_FAIL -1
32 #define BT_SHARE_ERROR_NONE 0
33
34 #define BT_DEFAULT_MEM_PHONE 0
35 #define BT_DEFAULT_MEM_MMC 1
36
37 #define STORAGE_PATH_LEN_MAX 255
38
39 #define BT_ADDRESS_STRING_SIZE 18 /**< This specifies bluetooth device address string length */
40 #define BT_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
41
42 #define BT_OBEX_PATH_PREFIX "/opt/usr/media"
43 #define BT_OBEX_DEFAULT_PATH "/opt/usr/home/owner/media"
44
45 #define BT_DOWNLOAD_DEFAULT_PHONE_FOLDER "/opt/usr/home/owner/media/Downloads"
46 #define BT_DOWNLOAD_DEFAULT_MMC_FOLDER "/opt/media/SDCardA1"
47 #define BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER "/opt/usr/home/owner/media/Downloads"
48 #define BT_DOWNLOAD_PHONE_ROOT "/opt/usr/home/owner/media/"
49 #define BT_DOWNLOAD_MMC_ROOT "/opt/media/SDCardA1"
50 #define BT_FTP_FOLDER "/opt/share/bt-ftp"
51 #define BT_FTP_FOLDER_PHONE "/opt/share/bt-ftp/Media/"
52 #define BT_FTP_FOLDER_MMC "/opt/share/bt-ftp/SD_External/"
53
54 #define BT_TMP_DIR "/opt/usr/home/owner/media/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 #define BT_CONTACT_SHARE_TMP_DIR "/opt/usr/home/owner/media/Downloads/"
62
63 #define BT_SHARE_DATA_DIR tzplatform_mkpath(TZ_SYS_GLOBALUSER_DATA, "bluetooth-share")
64
65 typedef enum {
66         BT_HTTP_FILE,
67         BT_TXT_FILE,
68 } bt_file_e;
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_e;
76
77 int _bt_share_block_sleep(gboolean is_block);
78 int _bt_set_transfer_indicator(gboolean state);
79 char *_bt_share_create_transfer_file(char *text);
80 void _bt_remove_tmp_file(char *file_path);
81 void _bt_remove_vcf_file(char *file_path);
82 char *_bt_get_time_of_the_day(void);
83 void _bt_get_default_storage(char *storage);
84 char *_bt_share_get_storage_path(int storage_type);
85 int _bt_share_get_active_uid(uid_t *uid);
86 void _bt_convert_addr_type_to_string(char *address, char *addr);
87 int _bt_get_available_int_memory(double *dAvail);
88 gboolean _bt_get_available_ext_memory(unsigned long long *available_mem_size);
89
90 #ifdef __cplusplus
91 }
92 #endif
93 #endif                          /* __DEF_BLUETOOTH_SHARE_COMMON_H_ */