2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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
8 * http://www.tizenopensource.org/license
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.
22 #ifndef __DEF_SMARTSEARCH_DEFINE_H__
23 #define __DEF_SMARTSEARCH_DEFINE_H__
27 SEARCH_TYPE_PHONE_CONTACTS = 0,
28 SEARCH_TYPE_PHONE_MSG,
29 SEARCH_TYPE_PHONE_EMAIL,
30 SEARCH_TYPE_PHONE_IMAGES,
31 SEARCH_TYPE_PHONE_MUSIC,
32 SEARCH_TYPE_PHONE_VIDEO,
33 SEARCH_TYPE_PHONE_CALENDAR,
34 SEARCH_TYPE_PHONE_MEMO,
35 SEARCH_TYPE_PHONE_MENU,
40 SEARCH_TYPE_PHONE = 0,
44 LAUNCH_ERROR_FILE_NOT_FOUND = 1,
45 LAUNCH_ERROR_AUL_LAUNCH,
56 SEARCH_CATE_BTN_IMG_TYPE_UNPRESSED,
57 SEARCH_CATE_BTN_IMG_TYPE_PRESSED,
58 SEARCH_CATE_BTN_IMG_TYPE_MAX
62 SEARCH_RET_SEARCH_FAIL = -1,
63 SEARCH_RET_SEARCH_NONE,
64 SEARCH_RET_SEARCH_SUCCESS
73 SEARCH_STMT_GET_HISTORY_ALL = 0,
74 SEARCH_STMT_GET_HISTORY_WITH_KEYWORD,
75 SEARCH_STMT_INSERT_KEYWORD,
80 SEARCH_SQL_BIND_TYPE_SIMPLEX = 0,
81 SEARCH_SQL_BIND_TYPE_DUPLEX
84 //==============================================================================================================================
86 #define SEARCH_PACKAGE "smartsearch"
87 #define SEARCH_ICON_PATH RESDIR"/icons/"
88 #define SEARCH_EDJ EDJDIR"/smartsearch.edj"
90 #define DEF_BUF_LEN (512)
91 #define MAX_LENGTH_PER_LINE (512)
92 #define MAX_LENGTH_PER_PATH (512)
93 #define MAX_LENGTH_PER_ID (10)
94 #define MAX_SEARCH_WORD_SIZE (128)
96 #define SMARTSEARCH_KEY_KEYWORD "db/smartsearch/keyword"
98 #define PHONE_CATEGORY_LIST_CNT (SEARCH_TYPE_PHONE_MAX)
99 #define DB_QUERY_LEN (512)
101 #define NO_RESULT_BODY_LEN 7
103 #define SEARCH_CATEGORY_LIST_MORE_CNT (20)
105 #define DB_ESCAPE_CHAR "|"
108 //==============================================================================================================================
111 #define SEARCH_FREE(ptr) \
120 #define SEARCH_MALLOC(ptr, size, type) \
123 ptr = (type *)malloc(size); \
131 /* Gives comparison result of two strings and returns -1 if any of two is NULL */
132 #define SEARCH_STRCMP(str1, str2) ((str1 && str2) ? strcmp(str1, str2) : -1)
134 /* Returns string length of src and 0 if it is NULL */
135 #define SEARCH_STRLEN(src) ((src != NULL)? strlen(src): 0)
137 #define SEARCH_SCALABLED_SIZE(size, _scale_factor) (int)((size) * (_scale_factor))