summaryrefslogtreecommitdiff
path: root/include/smartsearch.h
blob: 5c80cbf1d360e114f0f01987035f19adb4b5e869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/*
 * 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_H__
#define __DEF_SMARTSEARCH_H__

#include <glib.h>
#include <time.h>
#include <Elementary.h>
#include <Ecore_X.h>
#include <appcore-efl.h>
#include <Ecore_IMF.h>
#include <vconf.h>
#include <aul.h>
#include <ui-gadget.h>
#include <malloc.h>
#include <sqlite3.h>
#include <msg_types.h>

#include "smartsearch_define.h"
#include "ps_debug_util.h"
#include "search_bar.h"
#include "ps_makeupviews.h"
#include "ps_app_interface.h"
#include "common_util.h"
#include "util-func.h"

#define _EDJ(x)    elm_layout_edje_get(x)

struct search_more_result{
	int next_point;
	int offset;
	int loop_cnt;
	int result_cnt;
	struct appdata *ad;
};

struct search_content_object {
	int order;
	Eina_Bool visible;
	char *name;
	int string_type;
	int contents_type;
	int category_type;
	char *def_pkg_name;
	char *obj_icon_path;
	Elm_Object_Item *gl_result_grp;
	struct search_more_result mr_info;
};

struct search_category_info {
	char *btn_icon_path;
	char *btn_icon_press_path;
	char *popup_icon_path;
	char *popup_press_icon_path;
};

struct search_genlist_item_info {
	int type;
	struct search_content_object *obj;
	Elm_Genlist_Item_Class *itc_style;
	void *data;
	Elm_Object_Item *parent;
};

struct search_genlist_info {
	struct search_genlist_item_info *group;
	GList *itemlist;
	struct search_genlist_item_info *more;
};

struct search_pipe_data {
	int cmd;
	struct search_genlist_info *result_list;
	int search_ret;
	struct search_content_object *obj;
};

struct search_item_sel {
	int type;
	char path[MAX_LENGTH_PER_PATH];
	char main_buf[MAX_LENGTH_PER_LINE];
	char sub_buf[MAX_LENGTH_PER_LINE];
	char main_id[MAX_LENGTH_PER_ID];
	char icon1_path[MAX_LENGTH_PER_PATH];
	char icon2_path[MAX_LENGTH_PER_PATH];
};

struct search_item_more_sel {
	struct search_content_object *obj;
};

struct appdata {
	Evas_Object *win_main;
	Evas_Object *layout_main;
	Evas_Object *navi_bar;
	Elm_Object_Item *navi_it;

	double scale_factor;

	Evas_Object *search_entry;
	Evas_Object *search_bar;
	Evas_Object *search_cancel_btn;
	Evas_Object *search_gl;
	Evas_Object *noresult_view;
	Evas_Object *sb_layout;
	Evas_Object *back_btn;

	Evas_Object *ctxpopup;
	Evas_Object *cate_ctxpopup;

	Evas_Object *cate_btn;
	Ecore_Idler *idler_search;
	Ecore_Idler *idler_create_ui;
	Ecore_Timer *search_timer;

	int touch_x;
	int touch_y;

	Elm_Genlist_Item_Class *itc_pslist_1line;
	Elm_Genlist_Item_Class *itc_pslist_1line_1icon;
	Elm_Genlist_Item_Class *itc_pslist_1line_2icon;
	Elm_Genlist_Item_Class *itc_pslist_2line_1icon;
	Elm_Genlist_Item_Class *itc_pslist_2line_2icon;
	Elm_Genlist_Item_Class *itc_grouptitle;
	Elm_Genlist_Item_Class *itc_label;
	Elm_Genlist_Item_Class *itc_listmore;

	Ecore_Pipe *pipe;
	Ecore_Thread *search_thread;
	Eina_Condition condition;
	Eina_Lock mutex;

	char *search_word;
	char *not_markup_search_word;

	int back_btn_type;
	int search_category;

	Evas_Object *effect_layout;
	ui_gadget_h detail_ug;

	sqlite3 *search_db_hd;
	sqlite3_stmt *search_db_sql[SEARCH_STMT_MAX];
	struct search_content_object result_obj[SEARCH_CONT_MAX];
	struct search_category_info category_info[SEARCH_CATE_MAX];

	/* Handle List */
	msg_handle_t msg_handle;
};

#endif