summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunghyun Kim <jh1114.kim@samsung.com>2012-08-28 11:48:17 (GMT)
committerJunghyun Kim <jh1114.kim@samsung.com>2012-08-28 11:48:17 (GMT)
commit6af47a7328f6c4fd468890757eb18b2a6197eea6 (patch)
tree5bcb48274121c3132d4579423ed8b9905dce9d68
parent705b925c45567f2fc5a002fd3fd89d94e66bc2f6 (diff)
downloadsmartsearch-6af47a7328f6c4fd468890757eb18b2a6197eea6.zip
smartsearch-6af47a7328f6c4fd468890757eb18b2a6197eea6.tar.gz
smartsearch-6af47a7328f6c4fd468890757eb18b2a6197eea6.tar.bz2
Update changed code
-rwxr-xr-xdata/groups/search_bar.edc124
-rwxr-xr-xdata/groups/search_result.edc114
-rwxr-xr-xdata/smartsearch.edc1
-rwxr-xr-xinclude/smartsearch.h3
-rwxr-xr-xsrc/ps_app_interface.cpp11
-rwxr-xr-xsrc/ps_makeupviews.cpp14
-rwxr-xr-xsrc/search_bar.cpp142
7 files changed, 214 insertions, 195 deletions
diff --git a/data/groups/search_bar.edc b/data/groups/search_bar.edc
new file mode 100755
index 0000000..db0bfa9
--- /dev/null
+++ b/data/groups/search_bar.edc
@@ -0,0 +1,124 @@
+/*
+ * 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.
+ */
+
+group {
+ name: "smartsearch/search_bar";
+ parts {
+ part {
+ name: "bg";
+ mouse_events: 0;
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1 { relative: 0.0 0.0;}
+ rel2 { relative: 1.0 1.0;}
+ 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 0.0; to: "bg";}
+ rel2 { relative: 0.0 1.0; to: "bg";}
+ color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+ }
+ }
+ part {
+ name: "searchbar_area_category_top";
+ type: RECT;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 80 16;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 { relative: 1.0 0.0; to: "searchbar_area_category_pad_left";}
+ rel2 { relative: 1.0 0.0; to: "searchbar_area_category_pad_left";}
+ color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+ }
+ }
+ part {
+ name: "searchbar_area_category_bottom";
+ type: RECT;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 80 16;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 { relative: 0.0 1.0; to: "searchbar_area_category_top";}
+ rel2 { relative: 1.0 1.0;
+ to_x: "searchbar_area_category_top";
+ to_y: "bg";}
+ 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 0;
+ //max: 0 106;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 { relative: 1.0 1.0;
+ to_x: "searchbar_area_category_pad_left";
+ to_y: "searchbar_area_category_top";}
+ rel2 { relative: 1.0 0.0;
+ to_x: "searchbar_area_category_pad_left";
+ to_y: "searchbar_area_category_bottom";}
+ }
+ }
+ part {
+ name: "searchbar_area_entry";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 107;
+ fixed: 0 1;
+ align: 0.0 1.0;
+ rel1 { relative: 1.0 0.0;
+ to_x: "searchbar_area_category";
+ to_y: "bg";
+ }
+ rel2 { relative: 1.0 1.0;
+ to_x: "bg";
+ to_y: "bg";}
+ }
+ }
+ } //end parts
+} //end group
+
diff --git a/data/groups/search_result.edc b/data/groups/search_result.edc
index fe4a03d..e3a17f7 100755
--- a/data/groups/search_result.edc
+++ b/data/groups/search_result.edc
@@ -34,116 +34,6 @@ group {
}
}
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.5 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";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- min: 0 74;
- fixed: 0 1;
- align: 0.5 0.0;
- rel1 { relative: 0.0 1.0; to: "searchbar_pad_top";}
- rel2 { relative: 1.0 1.0; to: "searchbar_pad_top";}
- 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: 1 0;
- align: 0 0.5;
- rel1 { relative: 0.0 0.0; to: "searchbar_area";}
- rel2 { relative: 0.0 1.0; to: "searchbar_area";}
- 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: 1 1;
- align: 0.0 0.0;
- rel1 { relative: 1.0 0.0; to: "searchbar_area_category_pad_left";}
- rel2 { relative: 1.0 1.0; to: "searchbar_area_category_pad_left";}
- }
- }
- part {
- name: "searchbar_area_category_pad_right";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- min: 0 0;
- fixed: 1 0;
- align: 0 0.5;
- rel1 { relative: 1.0 0.0; to: "searchbar_area_category";}
- rel2 { relative: 1.0 1.0; to: "searchbar_area_category";}
- color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
- }
- }
- part {
- name: "searchbar_area_entry";
- type: SWALLOW;
- mouse_events: 1;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 608 72;
- fixed: 1 1;
- align: 0.0 0.5;
- rel1 { relative: 1.0 0.0; to: "searchbar_area_category_pad_right";}
- rel2 { relative: 1.0 1.0; to: "searchbar_area";}
- }
- }
- 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.5 0.0;
- rel1 { relative: 0.0 1.0; to: "searchbar_area";}
- rel2 { relative: 1.0 1.0; to: "searchbar_area";}
- color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
- }
- }
- part {
name: "list";
type: SWALLOW;
mouse_events: 1;
@@ -152,7 +42,7 @@ group {
state: "default" 0.0;
//min: 720 1024;
align: 0.0 0.0;
- rel1 { relative: 0.0 1.0; to: "searchbar_pad_bottom"; }
+ rel1 { relative: 0.0 0.0; to: "bg"; }
rel2 { relative: 1.0 1.0; to: "bg"; }
}
}
@@ -165,7 +55,7 @@ group {
state: "default" 0.0;
//min: 720 1024;
align: 0.0 0.0;
- rel1 { relative: 0.0 1.0; to: "searchbar_pad_bottom"; }
+ rel1 { relative: 0.0 0.0; to: "bg"; }
rel2 { relative: 1.0 1.0; to: "bg"; }
}
}
diff --git a/data/smartsearch.edc b/data/smartsearch.edc
index e4872a9..643fabd 100755
--- a/data/smartsearch.edc
+++ b/data/smartsearch.edc
@@ -20,5 +20,6 @@
collections {
#include "smartsearch-color.edc"
#include "groups/search_result.edc"
+#include "groups/search_bar.edc"
#include "groups/ug_effect.edc"
}
diff --git a/include/smartsearch.h b/include/smartsearch.h
index 5c80cbf..4277e34 100755
--- a/include/smartsearch.h
+++ b/include/smartsearch.h
@@ -122,6 +122,9 @@ struct appdata {
Evas_Object *search_gl;
Evas_Object *noresult_view;
Evas_Object *sb_layout;
+ Evas_Object *search_layout;
+ Evas_Object *result_layout;
+
Evas_Object *back_btn;
Evas_Object *ctxpopup;
diff --git a/src/ps_app_interface.cpp b/src/ps_app_interface.cpp
index b4c277f..a65157d 100755
--- a/src/ps_app_interface.cpp
+++ b/src/ps_app_interface.cpp
@@ -301,7 +301,7 @@ void search_launch_email_view(void *data, void *record_info)
} else if (i == 1) {
bundle_add(b, "MAIL_ID", token_param); //mail_id
} else if (i == 2) {
- bundle_add(b, "MAILBOX", token_param); //mailbox
+ bundle_add(b, "MAILBOX_ID", token_param); //mailbox
} else {
break;
}
@@ -462,13 +462,20 @@ void search_launch_calendar_view(void *data, void *record_info)
goto out_func;
}
- ret = service_add_extra_data(service, "index", cur_category_mem->main_id);
+ ret = service_add_extra_data(service, "itemType", "event");
if (ret != SERVICE_ERROR_NONE) {
SEARCH_DEBUG_ERROR("Fail to add service extra data : parameter 1!");
goto out_func;
}
+ ret = service_add_extra_data(service, "eventID", cur_category_mem->main_id);
+
+ if (ret != SERVICE_ERROR_NONE) {
+ SEARCH_DEBUG_ERROR("Fail to add service extra data : parameter 2!");
+ goto out_func;
+ }
+
#ifdef ENABLE_UG_EFFECT
__search_create_effect_layout(ad->win_main, ad);
#endif
diff --git a/src/ps_makeupviews.cpp b/src/ps_makeupviews.cpp
index 26eee50..107955c 100755
--- a/src/ps_makeupviews.cpp
+++ b/src/ps_makeupviews.cpp
@@ -1039,12 +1039,12 @@ void search_layout_set_search_list(void* data)
struct appdata *ad = (struct appdata *)data;
- if (elm_object_part_content_get(ad->sb_layout,"list_noresult")) {
- elm_object_part_content_unset(ad->sb_layout,"list_noresult");
+ if (elm_object_part_content_get(ad->result_layout,"list_noresult")) {
+ elm_object_part_content_unset(ad->result_layout,"list_noresult");
evas_object_hide(ad->noresult_view);
if (ad->search_gl) {
- elm_object_part_content_set(ad->sb_layout, "list", ad->search_gl);
+ elm_object_part_content_set(ad->result_layout, "list", ad->search_gl);
evas_object_show(ad->search_gl);
}
}
@@ -1062,13 +1062,13 @@ void search_layout_set_search_no_result(void* data)
struct appdata *ad = (struct appdata *)data;
- if (elm_object_part_content_get(ad->sb_layout,"list")) {
- elm_object_part_content_unset(ad->sb_layout, "list");
+ if (elm_object_part_content_get(ad->result_layout, "list")) {
+ elm_object_part_content_unset(ad->result_layout, "list");
if (ad->search_gl)
evas_object_hide(ad->search_gl);
- elm_object_part_content_set(ad->sb_layout,"list_noresult", ad->noresult_view);
+ elm_object_part_content_set(ad->result_layout,"list_noresult", ad->noresult_view);
evas_object_show(ad->noresult_view);
}
@@ -1084,7 +1084,7 @@ int search_layout_get_content_list_set_status(void* data)
struct appdata *ad = (struct appdata *)data;
int ret;
- if (elm_object_part_content_get(ad->sb_layout,"list")) {
+ if (elm_object_part_content_get(ad->result_layout, "list")) {
ret = SEARCH_RET_SUCCESS;
} else {
ret = SEARCH_RET_FAIL;
diff --git a/src/search_bar.cpp b/src/search_bar.cpp
index bcb3978..a8e93fd 100755
--- a/src/search_bar.cpp
+++ b/src/search_bar.cpp
@@ -208,24 +208,25 @@ __search_searchbar_state_event_cb(void *data, Ecore_IMF_Context *imf_context, in
SEARCH_FUNC_END;
}
-static void __search_searchbar_create(void *data)
+static Evas_Object* __search_searchbar_create(void *data)
{
SEARCH_FUNC_START;
struct appdata *ad = (struct appdata *)data;
+ int err = 0;
+ int category = 0;
+ Evas_Object *search_layout = NULL;
+ Evas_Object *cate_btn;
+ Evas_Object *cate_icon;
+ char *imgpath = NULL;
+
if (!ad)
- return;
+ return NULL;
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);
@@ -233,21 +234,13 @@ static void __search_searchbar_create(void *data)
}
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);
@@ -255,16 +248,38 @@ static void __search_searchbar_create(void *data)
}
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;
}
- ad->search_bar = elm_layout_add(ad->navi_bar);
- elm_layout_theme_set(ad->search_bar , "layout", "searchbar", "cancel_button");
+ 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_smart_callback_add(cate_btn, "clicked",
+ __search_searchbar_category_btn_clicked_cb,
+ data);
+ evas_object_smart_callback_add(cate_btn, "unpressed",
+ __search_searchbar_category_btn_unpressed_cb,
+ data);
+ evas_object_smart_callback_add(cate_btn, "pressed",
+ __search_searchbar_category_btn_pressed_cb,
+ data);
+
+ evas_object_show(cate_btn);
+ ad->cate_btn = cate_btn;
+
+ elm_object_part_content_set(search_layout, "searchbar_area_category", cate_btn);
ad->search_cancel_btn = elm_button_add(ad->search_bar);
elm_object_part_content_set(ad->search_bar, "button_cancel", ad->search_cancel_btn);
@@ -278,8 +293,8 @@ static void __search_searchbar_create(void *data)
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, 0);
- evas_object_size_hint_align_set(ad->search_bar, EVAS_HINT_FILL, 0.0);
+ 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);
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);
@@ -288,57 +303,43 @@ static void __search_searchbar_create(void *data)
__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;
}
@@ -398,34 +399,27 @@ void search_searchbar_cb(void *data, Evas_Object * obj, void *event_info)
/* create layout */
ad->sb_layout = elm_layout_add(ad->navi_bar);
- 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);
+ elm_layout_theme_set(ad->sb_layout, "layout", "application", "searchbar_base");
+ elm_object_signal_emit(ad->sb_layout, "elm,state,show,searchbar", "elm");
/* set search bar area */
- __search_searchbar_create(ad);
- elm_object_part_content_set(ad->sb_layout, "searchbar_area_entry", ad->search_bar);
+ 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");
/* set search result area */
ad->noresult_view = __search_init_noresult_view(ad);
- elm_object_part_content_set(ad->sb_layout,
+ elm_object_part_content_set(ad->result_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,