apply FSL(Flora Software License)
[apps/home/smartsearch.git] / include / smartsearch.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  * 
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
7  * 
8  *     http://www.tizenopensource.org/license
9  * 
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.
15  */
16
17
18
19
20
21
22 #ifndef __DEF_SMARTSEARCH_H__
23 #define __DEF_SMARTSEARCH_H__
24
25 #include <glib.h>
26 #include <time.h>
27 #include <Elementary.h>
28 #include <Ecore_X.h>
29 #include <appcore-efl.h>
30 #include <Ecore_IMF.h>
31 #include <vconf.h>
32 #include <aul.h>
33 #include <ui-gadget.h>
34 #include <malloc.h>
35 extern "C" {
36 }
37 #include <sqlite3.h>
38 #include <media-svc.h>
39 #include <MapiControl.h>
40 #include <MapiStorage.h>
41 #include <MapiMessage.h>
42 #include <MsgStorageTypes.h>
43
44 #include "smartsearch_define.h"
45 #include "ps_debug_util.h"
46 #include "search_bar.h"
47 #include "ps_makeupviews.h"
48 #include "ps_app_interface.h"
49 #include "common_util.h"
50 #include "util-func.h"
51
52 #define _EDJ(x)    elm_layout_edje_get(x)
53  
54 struct search_more_result{
55         int next_point;
56         int offset;
57         int loop_cnt;
58         int result_cnt;
59 };
60
61 struct search_item_sel {
62         unsigned char type;
63         char path[MAX_LENGTH_PER_PATH];
64         char main_id[MAX_LENGTH_PER_ID];
65         char main_buf[MAX_LENGTH_PER_LINE];
66         char sub_buf[MAX_LENGTH_PER_LINE];
67 };
68
69 struct appdata {
70         Evas_Object *win_main;
71         Evas_Object *layout_main;
72         Evas_Object *navi_bar;
73
74         double scale_factor;
75
76         Evas_Object *search_entry;
77         Evas_Object *search_bar;
78         Evas_Object *search_cancel_btn;
79         Evas_Object *search_gl;
80         Evas_Object *noresult_view;
81         Evas_Object *sb_layout;
82         Evas_Object *back_btn;
83
84         Evas_Object *ctxpopup;
85         Evas_Object *cate_ctxpopup;
86
87         Evas_Object *cate_btn;
88         Ecore_Idler *idler_search;
89         Ecore_Idler *idler_create_ui;
90         
91         int touch_x;
92         int touch_y;
93
94         Elm_Genlist_Item_Class *itc_pslist_1line;
95         Elm_Genlist_Item_Class *itc_pslist_2line;
96         Elm_Genlist_Item_Class *itc_grouptitle;
97         Elm_Genlist_Item_Class *itc_listmore;
98
99         search_more_result cate_info[SEARCH_TYPE_PHONE_MAX];
100
101         char *search_word;
102         char *not_markup_search_word;
103
104         int back_btn_type;
105
106         Evas_Object *effect_layout;
107         ui_gadget *detail_ug;
108
109         Elm_Object_Item *gl_result_group_item[PHONE_CATEGORY_LIST_CNT];
110
111         sqlite3 *search_db_hd;
112         sqlite3_stmt *search_db_sql_stmt[SEARCH_STMT_MAX];
113
114         /* Handle List */
115         MSG_HANDLE_T msg_handle;
116         MediaSvcHandle *media_handle;
117 };
118
119 #endif