3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Flora License, Version 1.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license/
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #ifndef _SETTING_SEARCH_H_
19 #define _SETTING_SEARCH_H_
21 #include <Elementary.h>
24 #include <setting-common-general-func.h>
25 #include <setting-common-draw-widget.h>
27 #include <setting-cfg.h>
29 #include <libxml/xmlmemory.h>
30 #include <libxml/parser.h>
34 #define EXPORT_PUBLIC __attribute__ ((visibility ("default")))
36 #define S_FINDER_SETTING_STR "setting_from_sfinder"
44 #define SEARCH_DB_PATH "/opt/usr/data/setting/test.db"
45 #define SEARCH_DB_QUERY "select * from setting_search indexed by search_index where locale = %Q and keystr LIKE '%%%q%%'"
46 #define SEARCH_DB_QUERY_SELECT_ALL "select * from setting_search indexed by search_index where locale = %Q"
47 #define SEARCH_COUNT_DB_QUERY "select count(*) from setting_search indexed by search_index where locale = %Q and keystr LIKE '%%%q%%'"
50 extern const Elm_Genlist_Item_Class g_search_genlist_ts;
51 extern const Elm_Genlist_Item_Class g_search_genlist_ts_toggle;
52 extern const Elm_Genlist_Item_Class g_search_genlist_ts_divided_toggle;
53 extern const Elm_Genlist_Item_Class itc_no_reult;
56 * @brief Item declaration of genlist
57 * retreive data from Database
59 typedef struct _ListItemObject
61 char* title; // tag text
62 char* title2; // plain text,
69 setting_group_style group_style;
70 void **pBack; //for pointer safety
72 Elm_Object_Item *item;
74 void (*fp_check_btn_cb)(void *data, Evas_Object *obj, void *event_info);
75 char* check_value_set;
80 * @brief add serach index for Database
82 * @param keystr keyword to be searched
83 * @param infostr additional info
84 * @param data_type 1:UGname 2:menustring 3:title
85 * @param viewname to find page
86 * @param fieldname to find field in the page
88 extern int setting_search_get_module_item_state(char* keyword, char *ug_name, Cfg_Item_State* stat, cfg_func_table* pops);
89 extern int setting_search_set_module_item_state(char* keyword, char *ug_name, Cfg_Item_State stat, cfg_func_table* pops);
91 extern void setting_add_db_search_index(sqlite3 *db, char* locale, char* keystr, char* infostr, int data_type, char* viewname, char* fieldname, char* icon_path);
92 extern int setting_searchdb_open(sqlite3** ppdb);
93 extern void setting_searchdb_close(sqlite3* db);
95 extern int __setting_init_search_index_app();
96 extern int __setting_init_search_index_module();
98 #endif // _SETTING_SEARCH_H_