summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/common_util.h6
-rwxr-xr-xinclude/ps_app_interface.h7
-rwxr-xr-xinclude/ps_debug_util.h8
-rwxr-xr-xinclude/ps_makeupviews.h16
-rwxr-xr-xinclude/ps_searcher.h60
-rwxr-xr-xinclude/search_bar.h8
-rwxr-xr-xinclude/smartsearch.h95
-rwxr-xr-xinclude/smartsearch_define.h102
8 files changed, 201 insertions, 101 deletions
diff --git a/include/common_util.h b/include/common_util.h
index 6ccea16..f30bf95 100755
--- a/include/common_util.h
+++ b/include/common_util.h
@@ -1,12 +1,12 @@
/*
* 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.
diff --git a/include/ps_app_interface.h b/include/ps_app_interface.h
index 2a1e044..b2029b3 100755
--- a/include/ps_app_interface.h
+++ b/include/ps_app_interface.h
@@ -1,12 +1,12 @@
/*
* 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.
@@ -33,5 +33,6 @@ void search_launch_document_view(void *data, void *record_info);
void search_launch_calendar_view(void *data, void *record_info);
void search_launch_memo_view(void *data, void *record_info);
void search_launch_menu_view(void *data, void *record_info);
+void search_launch_browser_view(void *data, void *record_info);
void search_launch_popup_error(int error_type, void *data);
#endif
diff --git a/include/ps_debug_util.h b/include/ps_debug_util.h
index eb6b800..bfdd5e3 100755
--- a/include/ps_debug_util.h
+++ b/include/ps_debug_util.h
@@ -1,12 +1,12 @@
/*
* 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.
@@ -162,7 +162,7 @@
return ret;\
}\
}while(0)
-
+
#endif
#else
diff --git a/include/ps_makeupviews.h b/include/ps_makeupviews.h
index ae8d64f..5d7d8fa 100755
--- a/include/ps_makeupviews.h
+++ b/include/ps_makeupviews.h
@@ -1,12 +1,12 @@
/*
* 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.
@@ -26,9 +26,15 @@ void search_result_gl_init(void *data);
void search_result_gl_deinit(void *data);
void search_gl_phone_result_sel(void *data, Evas_Object * obj, void *event_info);
void search_gl_result_more_item_append_cb(void *data, Evas_Object * obj, void *event_info);
-Eina_Bool search_set_result_list(void *data);
+int search_app_connect(void *data);
+int search_app_disconnect(void *data);
+void search_set_result_list(void *data);
+void search_stop_search(void *data);
void search_layout_set_search_list(void* data);
void search_layout_set_search_no_result(void* data);
int search_layout_get_content_list_set_status(void* data);
-
+Ecore_Thread* search_make_result_thread(void *data);
+struct search_genlist_item_info* search_add_genlist_item(int type,
+ struct search_content_object *obj, Elm_Genlist_Item_Class *itc_style, void *data,
+ Elm_Object_Item *parent);
#endif // __DEF_PS_MAKEUPVIEWS_H__
diff --git a/include/ps_searcher.h b/include/ps_searcher.h
index f190739..df3e55e 100755
--- a/include/ps_searcher.h
+++ b/include/ps_searcher.h
@@ -1,12 +1,12 @@
/*
* 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.
@@ -15,12 +15,10 @@
*/
+#ifndef __SEARCHSEARCHER_HEADER_H__
+#define __SEARCHSEARCHER_HEADER_H__
-
-
-
-#ifndef __SEARCHSERVER_HEADER_H__
-#define __SEARCHSERVER_HEADER_H__
+#include "smartsearch.h"
int search_sql_stmt_init(sqlite3_stmt * sql_stmt);
@@ -29,31 +27,41 @@ int search_sql_stmt_finalize(sqlite3_stmt * stmt);
int search_sql_prepare_stmt(sqlite3 *db_handle, const char *query,
sqlite3_stmt ** stmt_out);
-int search_sql_contact_search_result_by_api(int type, int offset, int limit,
- void *data);
+int search_sql_bind_text(sqlite3 *db_handle, sqlite3_stmt *sql_stmt, int col, char *data);
+
+int search_sql_bind_int(sqlite3 *db_handle, sqlite3_stmt *sql_stmt, int col, int data);
+
+int search_sql_contact_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
+
+int search_sql_msg_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
+
+int search_sql_email_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
+
+int search_sql_calendar_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
-int search_sql_msg_search_result_by_api(int type, int offset, int limit,
- void *data);
+int search_sql_memo_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
-int search_sql_email_search_result_by_api(int type, int offset, int limit,
- void *data);
+int search_sql_image_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
-int search_sql_calendar_search_result_by_api(int type, int offset, int limit,
- void *data);
+int search_sql_video_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
-int search_sql_memo_search_result_by_api(int type, int offset, int limit,
- void *data);
+int search_sql_music_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
-int search_sql_image_search_result_by_api(int type, int offset, int limit,
- void *data);
+int search_sql_menu_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
-int search_sql_video_search_result_by_api(int type, int offset, int limit,
- void *data);
+int search_sql_browser_search_result_by_api(struct search_content_object *obj,
+ int offset, int limit, char *keyword, void *data, struct search_genlist_info *result_info);
-int search_sql_music_search_result_by_api(int type, int offset, int limit,
- void *data);
-int search_sql_menu_search_result_by_api(int type, int offset, int limit,
- char *keyword, void *data);
+void search_sql_update_result_object(struct search_content_object* result_obj, sqlite3* db_handle, sqlite3_stmt** db_sql);
#endif // __SEARCHSERVER_HEADER_H__
diff --git a/include/search_bar.h b/include/search_bar.h
index 035e9f5..de71d2d 100755
--- a/include/search_bar.h
+++ b/include/search_bar.h
@@ -1,12 +1,12 @@
/*
* 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.
@@ -29,6 +29,6 @@ void search_searchbar_cb(void *data, Evas_Object * obj, void *event_info);
void search_searchbar_entry_changed_cb(void *data, Evas_Object * obj,
void *event_info);
-Evas_Object *search_searchbar_category_icon_add(int cate_type, int press_type, Evas_Object *parent);
+Evas_Object *search_searchbar_category_icon_add(char *img, Evas_Object *parent);
#endif /* __DEF_SEARCH_BAR_H__ */
diff --git a/include/smartsearch.h b/include/smartsearch.h
index 1edd84e..5c80cbf 100755
--- a/include/smartsearch.h
+++ b/include/smartsearch.h
@@ -1,12 +1,12 @@
/*
* 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.
@@ -32,14 +32,8 @@
#include <aul.h>
#include <ui-gadget.h>
#include <malloc.h>
-extern "C" {
-}
#include <sqlite3.h>
-#include <media-svc.h>
-#include <MapiControl.h>
-#include <MapiStorage.h>
-#include <MapiMessage.h>
-#include <MsgStorageTypes.h>
+#include <msg_types.h>
#include "smartsearch_define.h"
#include "ps_debug_util.h"
@@ -50,26 +44,75 @@ extern "C" {
#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 {
- unsigned char type;
+ int type;
char path[MAX_LENGTH_PER_PATH];
- char main_id[MAX_LENGTH_PER_ID];
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;
@@ -87,33 +130,41 @@ struct appdata {
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_2line;
+ 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;
- search_more_result cate_info[SEARCH_TYPE_PHONE_MAX];
+ 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 *detail_ug;
-
- Elm_Object_Item *gl_result_group_item[PHONE_CATEGORY_LIST_CNT];
+ ui_gadget_h detail_ug;
sqlite3 *search_db_hd;
- sqlite3_stmt *search_db_sql_stmt[SEARCH_STMT_MAX];
+ 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;
- MediaSvcHandle *media_handle;
+ msg_handle_t msg_handle;
};
#endif
diff --git a/include/smartsearch_define.h b/include/smartsearch_define.h
index 2cf2609..c6bf078 100755
--- a/include/smartsearch_define.h
+++ b/include/smartsearch_define.h
@@ -1,12 +1,12 @@
/*
* 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.
@@ -15,29 +15,41 @@
*/
-
-
-
-
#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
+ SEARCH_OBJ_PHONE_CONTENTS = 0,
+ SEARCH_OBJ_APPLICATION,
+ SEARCH_OBJ_TYPE_MAX
+};
+
+enum {
+ SEARCH_CONT_PHONE_MIN = 0,
+ SEARCH_CONT_PHONE_CONTACTS = SEARCH_CONT_PHONE_MIN,
+ SEARCH_CONT_PHONE_MSG,
+ SEARCH_CONT_PHONE_EMAIL,
+ SEARCH_CONT_PHONE_IMAGES,
+ SEARCH_CONT_PHONE_MUSIC,
+ SEARCH_CONT_PHONE_VIDEO,
+ SEARCH_CONT_PHONE_CALENDAR,
+ SEARCH_CONT_PHONE_MEMO,
+ SEARCH_CONT_PHONE_MENU,
+ SEARCH_CONT_PHONE_BROWSER,
+ SEARCH_CONT_PHONE_MAX = SEARCH_CONT_PHONE_BROWSER,
+ SEARCH_CONT_MAX
+};
+
+enum {
+ SEARCH_CATE_PHONE = 0,
+ SEARCH_CATE_MAX
};
enum {
- SEARCH_TYPE_PHONE = 0,
+ SEARCH_GENLIST_GROUP = 0,
+ SEARCH_GENLIST_ITEM,
+ SEARCH_GENLIST_MORE
};
enum {
@@ -53,12 +65,6 @@ enum {
};
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
@@ -70,22 +76,40 @@ enum {
};
enum {
- SEARCH_STMT_GET_HISTORY_ALL = 0,
- SEARCH_STMT_GET_HISTORY_WITH_KEYWORD,
- SEARCH_STMT_INSERT_KEYWORD,
+ SEARCH_STMT_GET_CATEGORY_LIST_ALL = 0,
+ SEARCH_STMT_INSERT_OBJECT_INFO,
+ SEARCH_STMT_UPDATE_OBJECT_INFO,
SEARCH_STMT_MAX
};
enum {
SEARCH_SQL_BIND_TYPE_SIMPLEX = 0,
SEARCH_SQL_BIND_TYPE_DUPLEX
-};
+};
+
+enum {
+ SEARCH_PIPE_CMD_CLEAR_GENLIST = 0,
+ SEARCH_PIPE_CMD_ADD_GENLIST_PHONE,
+ SEARCH_PIPE_CMD_SET_LAYOUT,
+};
+
+enum {
+ SEARCH_STR_TYPE_APP_STRING = 0,
+ SEARCH_STR_TYPE_SYSTEM_STRING,
+};
//==============================================================================================================================
#define SEARCH_PACKAGE "smartsearch"
#define SEARCH_ICON_PATH RESDIR"/icons/"
#define SEARCH_EDJ EDJDIR"/smartsearch.edj"
+#define SEARCH_DB_PATH "/opt/apps/org.tizen.smartsearch/data/.search.db"
+
+#define SEARCH_FAVORITE_ICON SEARCH_ICON_PATH"B10_icon_list_favorite.png"
+#define SEARCH_SDCARD_ICON SEARCH_ICON_PATH"B10_icon_list_memorycard.png"
+
+#define SEARCH_THUMBNAIL_SIZE 96
+#define SEARCH_ICON_SIZE 64
#define DEF_BUF_LEN (512)
#define MAX_LENGTH_PER_LINE (512)
@@ -93,17 +117,27 @@ enum {
#define MAX_LENGTH_PER_ID (10)
#define MAX_SEARCH_WORD_SIZE (128)
-#define SMARTSEARCH_KEY_KEYWORD "db/smartsearch/keyword"
+#define SMARTSEARCH_KEY_KEYWORD "file/private/org.tizen.smartsearch/keyword"
-#define PHONE_CATEGORY_LIST_CNT (SEARCH_TYPE_PHONE_MAX)
+#define PHONE_CATEGORY_LIST_CNT (SEARCH_CONT_PHONE_MAX)
#define DB_QUERY_LEN (512)
#define NO_RESULT_BODY_LEN 7
-#define SEARCH_CATEGORY_LIST_MORE_CNT (20)
+#define SEARCH_CATEGORY_LIST_MORE_CNT (100)
#define DB_ESCAPE_CHAR "|"
+#define SEARCH_DB_SQL_GET_CATEGORY_LIST_ALL "SELECT item_name, item_string, item_visible, item_order, item_contents_type, item_object_type, " \
+ "def_pkg_name FROM search_category ORDER by item_order asc;"
+#define SEARCH_DB_SQL_INSERT_OBJECT_IFNO "REPLACE INTO search_category" \
+ "(item_name, item_string, item_visible, item_order, item_contents_type, item_object_type, def_pkg_name) " \
+ "VALUES(?,?,?,?,?,?,?);"
+
+#define SEARCH_DB_SQL_UPDATE_OBJECT_INFO "UPDATE search_category SET " \
+ "item_name = ?, item_string = ?, item_visible = ?, item_order = ?, item_contents_type = ?, item_object_type = ?, " \
+ "def_pkg_name = ? WHERE item_contents_type = ?;"
+
//==============================================================================================================================
@@ -126,15 +160,15 @@ enum {
} else { \
assert(0); \
} \
- } while(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)
+#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))
+#define SEARCH_SCALABLED_SIZE(size, _scale_factor) (int)((size) * (_scale_factor))
#endif