/*
* 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.
group {
name: "smartsearch/search_result";
parts {
- part {
+ part {
name: "bg";
mouse_events: 0;
type: RECT;
scale: 1;
- description {
+ description {
state: "default" 0.0;
visible: 1;
rel1 { relative: 0.0 0.0;}
rel2 { relative: 1.0 1.0;}
- color: 0 0 0 0;
+ color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
}
}
part {
+ name: "searchbar_pad_top";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 0 16;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 { relative: 0.0 0.0; to: "bg";}
+ rel2 { relative: 1.0 0.0; to: "bg";}
+ color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+ }
+ }
+
+ part {
+ name: "searchbar_area_category_pad_left";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 16 0;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 { relative: 0.0 1.0;
+ to_x: "searchbar_pad_top";
+ to_y: "searchbar_pad_top";}
+ rel2 { relative: 0.0 1.0;
+ to_x: "searchbar_pad_top";
+ to_y: "searchbar_pad_top";}
+ color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+ }
+ }
+
+ part {
+ name: "searchbar_category_area";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 80 0;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 { relative: 1.0 1.0;
+ to_x: "searchbar_area_category_pad_left";
+ to_y: "searchbar_pad_top";}
+ rel2 { relative: 1.0 1.0;
+ to_x: "searchbar_area_category_pad_left";
+ to_y: "searchbar_pad_top";}
+ color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+ }
+ }
+
+ part {
+ name: "searchbar_area_entry";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 72;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 { relative: 1.0 1.0;
+ to_x: "searchbar_category_area";
+ to_y: "searchbar_pad_top";}
+ rel2 { relative: 1.0 1.0;
+ to_x: "searchbar_pad_top";
+ to_y: "searchbar_pad_top";}
+ }
+ }
+
+ part {
+ name: "searchbar_pad_bottom";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 0 16;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 { relative: 0.0 1.0;
+ to_x: "searchbar_pad_top";
+ to_y: "searchbar_area_entry";}
+ rel2 { relative: 0.0 1.0;
+ to_x: "searchbar_area_entry";
+ to_y: "searchbar_area_entry";}
+ color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+ }
+ }
+
+ part {
+ name: "searchbar_area_category_bg";
+ type: RECT;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 0 0;
+ fixed: 0 1;
+ align: 0.0 0.5;
+ rel1 { relative: 0.0 0.0;
+ to_x: "searchbar_area_category_pad_left";
+ to_y: "searchbar_area_entry";}
+ rel2 { relative: 0.0 1.0;
+ to_x: "searchbar_area_entry";
+ to_y: "searchbar_area_entry";}
+ color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+ }
+ }
+
+ part {
+ name: "searchbar_area_category";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 80 74;
+ //max: 0 106;
+ fixed: 0 1;
+ align: 0.0 0.5;
+ rel1 { relative: 0.0 0.5;
+ to_x: "searchbar_category_area";
+ to_y: "searchbar_area_entry";}
+ rel2 { relative: 1.0 0.5;
+ to_x: "searchbar_category_area";
+ to_y: "searchbar_area_entry";}
+ }
+ }
+
+ part {
+ name: "result_bg";
+ type: RECT;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 0 0;
+ fixed: 0 1;
+ rel1 { relative: 0.0 1.0;
+ to_x: "searchbar_pad_bottom";
+ to_y: "searchbar_pad_bottom";}
+ rel2 { relative: 1.0 1.0;
+ to_x: "bg";
+ to_y: "bg";}
+ color: 255 255 255 255;
+ }
+ }
+
+ part {
name: "list";
type: SWALLOW;
mouse_events: 1;
state: "default" 0.0;
//min: 720 1024;
align: 0.0 0.0;
- rel1 { relative: 0.0 0.0; to: "bg"; }
+ rel1 { relative: 0.0 1.0; to: "searchbar_pad_bottom"; }
rel2 { relative: 1.0 1.0; to: "bg"; }
}
}
state: "default" 0.0;
//min: 720 1024;
align: 0.0 0.0;
- rel1 { relative: 0.0 0.0; to: "bg"; }
+ rel1 { relative: 0.0 1.0; to: "searchbar_pad_bottom"; }
rel2 { relative: 1.0 1.0; to: "bg"; }
}
}
SEARCH_FUNC_END;
}
-static Evas_Object* __search_searchbar_create(void *data)
+static void __search_searchbar_create(void *data)
{
SEARCH_FUNC_START;
struct appdata *ad = (struct appdata *)data;
- int category = 0;
- Evas_Object *search_layout = NULL;
- Evas_Object *cate_btn;
- Evas_Object *cate_icon;
- char *imgpath = NULL;
-
if (!ad)
- return NULL;
+ return;
if (ad->search_bar) {
- elm_object_signal_callback_del(ad->search_bar, "elm,bg,clicked", "elm",
+ elm_object_signal_callback_del(
+ ad->search_bar,
+ "elm,bg,clicked",
+ "elm",
__search_searchbar_bg_clicked_cb);
- elm_object_signal_callback_del(ad->search_bar, "elm,eraser,clicked", "elm",
+ elm_object_signal_callback_del(
+ ad->search_bar,
+ "elm,eraser,clicked",
+ "elm",
__search_searchbar_eraser_clicked_cb);
evas_object_del(ad->search_bar);
}
if (ad->search_entry) {
- evas_object_smart_callback_del(ad->search_entry, "changed",
+ evas_object_smart_callback_del(
+ ad->search_entry,
+ "changed",
__search_searchbar_entry_changed_cb);
- evas_object_smart_callback_del(ad->search_entry, "preedit,changed",
+ evas_object_smart_callback_del(
+ ad->search_entry,
+ "preedit,changed",
__search_searchbar_entry_changed_cb);
- evas_object_smart_callback_del(ad->search_entry, "focused",
+ evas_object_smart_callback_del(
+ ad->search_entry,
+ "focused",
__search_searchbar_entry_focused_cb);
- evas_object_smart_callback_del(ad->search_entry, "unfocused",
+ evas_object_smart_callback_del(
+ ad->search_entry,
+ "unfocused",
__search_searchbar_entry_unfocused_cb);
evas_object_del(ad->search_entry);
}
if (ad->search_cancel_btn) {
- evas_object_smart_callback_del(ad->search_cancel_btn, "clicked",
+ evas_object_smart_callback_del(
+ ad->search_cancel_btn,
+ "clicked",
__search_searchbar_cancel_clicked_cb);
evas_object_del(ad->search_cancel_btn);
ad->search_cancel_btn = NULL;
}
- search_layout = elm_layout_add(ad->sb_layout);
- elm_layout_file_set(search_layout,
- SEARCH_EDJ,
- "smartsearch/search_bar");
-
- imgpath = ad->category_info[ad->search_category].btn_icon_path;
- cate_icon = search_searchbar_category_icon_add(imgpath, search_layout);
- cate_btn = elm_button_add(search_layout);
-
- elm_object_style_set(cate_btn, "icon");
- elm_object_content_set(ad->cate_btn, cate_icon);
-
- evas_object_show(cate_btn);
- ad->cate_btn = cate_btn;
-
- elm_object_part_content_set(search_layout, "searchbar_area_category", cate_btn);
-
- /* Make Search entry with cancel button */
- ad->search_bar = elm_layout_add(search_layout);
+ ad->search_bar = elm_layout_add(ad->navi_bar);
elm_layout_theme_set(ad->search_bar , "layout", "searchbar", "cancel_button");
ad->search_cancel_btn = elm_button_add(ad->search_bar);
elm_object_part_text_set(ad->search_bar, "elm.guidetext", dgettext("sys_string", "IDS_COM_BODY_SEARCH"));
elm_entry_cnp_mode_set(ad->search_entry, ELM_CNP_MODE_PLAINTEXT);
- evas_object_size_hint_weight_set(ad->search_bar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ad->search_bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(ad->search_bar, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(ad->search_bar, EVAS_HINT_FILL, 0.0);
elm_entry_input_panel_layout_set(ad->search_entry, ELM_INPUT_PANEL_LAYOUT_NORMAL);
Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(ad->search_entry);
__search_searchbar_state_event_cb,
data);
- elm_object_part_content_set(search_layout, "searchbar_area_entry", ad->search_bar);
-
/* Set Searchbar Callback */
- elm_object_signal_callback_add(ad->search_bar, "elm,bg,clicked", "elm",
+ elm_object_signal_callback_add(
+ ad->search_bar,
+ "elm,bg,clicked",
+ "elm",
__search_searchbar_bg_clicked_cb,
ad);
- elm_object_signal_callback_add(ad->search_bar, "elm,eraser,clicked", "elm",
+ elm_object_signal_callback_add(
+ ad->search_bar,
+ "elm,eraser,clicked",
+ "elm",
__search_searchbar_eraser_clicked_cb,
ad);
/* Set Search-Entry Callback */
- evas_object_smart_callback_add(ad->search_entry, "changed",
+ evas_object_smart_callback_add(
+ ad->search_entry,
+ "changed",
__search_searchbar_entry_changed_cb,
ad);
- evas_object_smart_callback_add(ad->search_entry, "preedit,changed",
+ evas_object_smart_callback_add(
+ ad->search_entry,
+ "preedit,changed",
__search_searchbar_entry_changed_cb,
ad);
- evas_object_smart_callback_add(ad->search_entry, "focused",
+ evas_object_smart_callback_add(
+ ad->search_entry,
+ "focused",
__search_searchbar_entry_focused_cb,
ad);
- evas_object_smart_callback_add(ad->search_entry, "unfocused",
+ evas_object_smart_callback_add(
+ ad->search_entry,
+ "unfocused",
__search_searchbar_entry_unfocused_cb,
ad);
- evas_object_event_callback_add(ad->search_entry, EVAS_CALLBACK_KEY_DOWN,
+ evas_object_event_callback_add(
+ ad->search_entry,
+ EVAS_CALLBACK_KEY_DOWN,
__search_searchbar_key_down_cb,
ad);
/* Set Searchbar Cancel Button Callback */
- evas_object_smart_callback_add(ad->search_cancel_btn, "clicked",
+ evas_object_smart_callback_add(
+ ad->search_cancel_btn,
+ "clicked",
__search_searchbar_cancel_clicked_cb,
ad);
evas_object_show(ad->search_bar);
- return search_layout;
-
SEARCH_FUNC_END;
}
struct appdata *ad = (struct appdata *)data;
- /* create layout */
+ Evas_Object *cate_btn;
+ Evas_Object *cate_icon;
+ int category = 0;
+ char *imgpath = NULL;
+ /* create layout */
ad->sb_layout = elm_layout_add(ad->navi_bar);
- elm_layout_theme_set(ad->sb_layout, "layout", "application", "searchbar_base");
- elm_object_signal_emit(ad->sb_layout, "elm,state,show,searchbar", "elm");
+ elm_layout_file_set(ad->sb_layout,
+ SEARCH_EDJ,
+ "smartsearch/search_result");
+
+ category = SEARCH_CATE_PHONE;
+
+ imgpath = ad->category_info[ad->search_category].btn_icon_path;
+ cate_icon = search_searchbar_category_icon_add(imgpath, ad->sb_layout);
+ cate_btn = elm_button_add(ad->sb_layout);
+ elm_object_content_set(ad->cate_btn, cate_icon);
+
+ evas_object_show(cate_btn);
+ ad->cate_btn = cate_btn;
+
+ elm_object_part_content_set(ad->sb_layout, "searchbar_area_category", cate_btn);
/* set search bar area */
- ad->search_layout = __search_searchbar_create(ad);
- elm_object_part_content_set(ad->sb_layout, "searchbar", ad->search_layout);
- /* set search result area */
- ad->result_layout = elm_layout_add(ad->sb_layout);
- elm_layout_file_set(ad->result_layout,
- SEARCH_EDJ,
- "smartsearch/search_result");
+ __search_searchbar_create(ad);
+
+ elm_object_part_content_set(ad->sb_layout, "searchbar_area_entry", ad->search_bar);
/* set search result area */
+
ad->noresult_view = __search_init_noresult_view(ad);
- elm_object_part_content_set(ad->result_layout,
+ elm_object_part_content_set(ad->sb_layout,
"list_noresult",
ad->noresult_view);
- elm_object_part_content_set(ad->sb_layout, "elm.swallow.content", ad->result_layout);
evas_object_size_hint_weight_set(
ad->sb_layout,
EVAS_HINT_EXPAND,