diff options
Diffstat (limited to 'include/smartsearch_define.h')
-rwxr-xr-x | include/smartsearch_define.h | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/include/smartsearch_define.h b/include/smartsearch_define.h new file mode 100755 index 0000000..2cf2609 --- /dev/null +++ b/include/smartsearch_define.h @@ -0,0 +1,140 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + + + + +#ifndef __DEF_SMARTSEARCH_DEFINE_H__ +#define __DEF_SMARTSEARCH_DEFINE_H__ + + +enum { + SEARCH_TYPE_PHONE_CONTACTS = 0, + SEARCH_TYPE_PHONE_MSG, + SEARCH_TYPE_PHONE_EMAIL, + SEARCH_TYPE_PHONE_IMAGES, + SEARCH_TYPE_PHONE_MUSIC, + SEARCH_TYPE_PHONE_VIDEO, + SEARCH_TYPE_PHONE_CALENDAR, + SEARCH_TYPE_PHONE_MEMO, + SEARCH_TYPE_PHONE_MENU, + SEARCH_TYPE_PHONE_MAX +}; + +enum { + SEARCH_TYPE_PHONE = 0, +}; + +enum { + LAUNCH_ERROR_FILE_NOT_FOUND = 1, + LAUNCH_ERROR_AUL_LAUNCH, + LAUNCH_ERROR_APPSVC, + LAUNCH_ERROR_MAX +}; + +enum { + BACK_BTN_TYPE_LOWER, + BACK_BTN_TYPE_CLOSE +}; + +enum { + SEARCH_CATE_BTN_IMG_TYPE_UNPRESSED, + SEARCH_CATE_BTN_IMG_TYPE_PRESSED, + SEARCH_CATE_BTN_IMG_TYPE_MAX +}; + +enum { + SEARCH_RET_SEARCH_FAIL = -1, + SEARCH_RET_SEARCH_NONE, + SEARCH_RET_SEARCH_SUCCESS +}; + +enum { + SEARCH_RET_FAIL = -1, + SEARCH_RET_SUCCESS +}; + +enum { + SEARCH_STMT_GET_HISTORY_ALL = 0, + SEARCH_STMT_GET_HISTORY_WITH_KEYWORD, + SEARCH_STMT_INSERT_KEYWORD, + SEARCH_STMT_MAX +}; + +enum { + SEARCH_SQL_BIND_TYPE_SIMPLEX = 0, + SEARCH_SQL_BIND_TYPE_DUPLEX +}; + +//============================================================================================================================== + +#define SEARCH_PACKAGE "smartsearch" +#define SEARCH_ICON_PATH RESDIR"/icons/" +#define SEARCH_EDJ EDJDIR"/smartsearch.edj" + +#define DEF_BUF_LEN (512) +#define MAX_LENGTH_PER_LINE (512) +#define MAX_LENGTH_PER_PATH (512) +#define MAX_LENGTH_PER_ID (10) +#define MAX_SEARCH_WORD_SIZE (128) + +#define SMARTSEARCH_KEY_KEYWORD "db/smartsearch/keyword" + +#define PHONE_CATEGORY_LIST_CNT (SEARCH_TYPE_PHONE_MAX) +#define DB_QUERY_LEN (512) + +#define NO_RESULT_BODY_LEN 7 + +#define SEARCH_CATEGORY_LIST_MORE_CNT (20) + +#define DB_ESCAPE_CHAR "|" + + +//============================================================================================================================== + + +#define SEARCH_FREE(ptr) \ + do { \ + if(ptr != NULL) \ + { \ + free(ptr); \ + ptr = NULL; \ + } \ + }while(0); + +#define SEARCH_MALLOC(ptr, size, type) \ + do { \ + if(size > 0) { \ + ptr = (type *)malloc(size); \ + if(ptr == NULL) \ + assert(0); \ + } else { \ + assert(0); \ + } \ + } while(0); + +/* Gives comparison result of two strings and returns -1 if any of two is NULL */ +#define SEARCH_STRCMP(str1, str2) ((str1 && str2) ? strcmp(str1, str2) : -1) + +/* Returns string length of src and 0 if it is NULL */ +#define SEARCH_STRLEN(src) ((src != NULL)? strlen(src): 0) + +#define SEARCH_SCALABLED_SIZE(size, _scale_factor) (int)((size) * (_scale_factor)) + +#endif + |