Add Language Popup& Location View 83/55983/1 accepted/tizen/tv/20151231.072247 submit/tizen/20151231.004911
authorkiso.chang <kiso.chang@samsung.com>
Wed, 30 Dec 2015 14:55:37 +0000 (23:55 +0900)
committerkiso.chang <kiso.chang@samsung.com>
Thu, 31 Dec 2015 00:24:40 +0000 (09:24 +0900)
- add Language popup
- add Location View (Contry selection)

Change-Id: I876346eb7e688f74442eff03e152c8f1e0895fd7
Signed-off-by: kiso.chang <kiso.chang@samsung.com>
CMakeLists.txt
include/define.h
include/layout/system.h
include/view_location.h [new file with mode: 0644]
res/layout/system.edc
res/settings.edc
res/view/location.edc [new file with mode: 0644]
src/layout/layout_system.c
src/main.c
src/view/view_location.c [new file with mode: 0644]

index 3dc8f40..fff442d 100644 (file)
@@ -59,6 +59,7 @@ SET(SRCS
        src/main.c
        src/view/view_base.c
        src/view/view_clock.c
+       src/view/view_location.c
        src/common/utils.c
        src/common/viewmgr.c
        src/common/layoutmgr.c
index 13b877b..5864d75 100644 (file)
@@ -27,6 +27,7 @@
 /* View ID */
 #define VIEW_BASE "VIEW_BASE"
 #define VIEW_CLOCK "VIEW_CLOCK"
+#define VIEW_LOCATION "VIEW_LOCATION"
 
 /* Layout ID */
 #define LAYOUT_ID_PICTURE "LAYOUT_ID_PICTURE"
@@ -41,6 +42,7 @@
 /* Group for EDC */
 #define GRP_VIEW_BASE "grp.view.base"
 #define GRP_VIEW_CLOCK "grp.view.clock"
+#define GRP_VIEW_LOCATION "grp.view.location"
 
 /* Part for EDC */
 #define PART_TOP_TITLE "part.top.title"
index 997712c..77159fc 100644 (file)
 
 /* group */
 #define GRP_LAYOUT_SYSTEM "grp.layout.system"
+#define GRP_POPUP_LANGUAGE "grp.popup.language"
 
 /* part */
 #define PART_SYSTEM "part.system"
 
+#define PART_LANG_BUTTON1 "part.langpopup.btn1"
+#define PART_LANG_BUTTON2 "part.langpopup.btn2"
+#define PART_LANG_NAME "part.langpopup.name"
+
+#define PART_LOCATION_TEXT  "part.location.text"
+#define PART_LOCATION_MENU1  "part.location.menu1"
+#define PART_LOCATION_MENU2  "part.location.menu2"
+#define PART_LOCATION_BTN1  "part.location.btn1"
+#define PART_LOCATION_BTN2  "part.location.btn2"
+
 #endif
diff --git a/include/view_location.h b/include/view_location.h
new file mode 100644 (file)
index 0000000..10042cb
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 __AIR_SETTINGS_VIEW_LOCATION_H__
+#define __AIR_SETTINGS_VIEW_LOCATION_H__
+
+view_class *view_location_get_vclass(void);
+
+#endif /* __AIR_SETTINGS_VIEW_LOCATION_H__ */
index b425495..8d7eab7 100644 (file)
@@ -84,3 +84,136 @@ group {
                }
        }
 }
+
+
+
+group {
+       name, GRP_POPUP_LANGUAGE;
+       parts {
+               part {
+                       name, "area";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               visible, 0;
+                       }
+               }
+
+               part {
+                       name, "padding.title";
+                       type, SPACER;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 24;
+                               rel1.to, "area";
+                               rel2 {
+                                       to, "area";
+                                       relative, 1.0 0.0;
+                               }
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+
+               part {
+                       name, PART_LANG_NAME;
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 32;
+                               rel1 {
+                                       to, "padding.title";
+                                       relative, 0.0 1.0;
+                               }
+                               rel2.to, "padding.title";
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                               color, COLOR_TEXT_POPUP;
+                               text {
+                                       font, FONT_LIGHT;
+                                       size, 32;
+                               }
+                       }
+               }
+
+               part {
+                       name, "padding.lang1";
+                       type, SPACER;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 32;
+                               rel1 {
+                                       to, PART_LANG_NAME;
+                                       relative, 0.0 1.0;
+                               }
+                               rel2.to, PART_LANG_NAME;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+
+               part {
+                       name, PART_LANG_BUTTON1;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 488 68;
+                               rel1 {
+                                       to, "padding.lang1";
+                                       relative, 0.5 1.0;
+                               }
+                               rel2 {
+                                       to, "padding.lang1";
+                                       relative, 0.5 1.0;
+                               }
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                               color, 0 0 0 255;
+                       }
+               }
+
+               part {
+                       name, "padding.lang2";
+                       type, SPACER;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 32;
+                               rel1 {
+                                       to, PART_LANG_BUTTON1;
+                                       relative, 0.0 1.0;
+                               }
+                               rel2.to, PART_LANG_BUTTON1;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+
+               part {
+                       name, PART_LANG_BUTTON2;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 488 68;
+
+                               rel1 {
+                                       to, "padding.lang2";
+                                       relative, 0.0 1.0;
+                               }
+                               rel2.to, "padding.lang2";
+
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                               color, 0 0 0 255;
+                       }
+               }
+
+       }
+}
+
index cdf5d64..687915f 100644 (file)
@@ -20,6 +20,7 @@ collections {
        base_scale: 2.0;
        #include "view/base.edc"
        #include "view/clock.edc"
+       #include "view/location.edc"
        #include "layout/picture.edc"
        #include "layout/channel.edc"
        #include "layout/support.edc"
diff --git a/res/view/location.edc b/res/view/location.edc
new file mode 100644 (file)
index 0000000..4f9e916
--- /dev/null
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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, GRP_VIEW_LOCATION;
+       parts {
+               part {
+                       name, "bg";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 244 244 24 255;
+                       }
+               }
+
+               part {
+                       name, "bg.title";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 255 255 255 255;
+                               min, 0 104;
+                               rel2.relative, 1.0 0.0;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+
+               part {
+                       name, "bg.bottom";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 255 255 255 255;
+                               min, 0 104;
+                               rel1 {
+                                       relative, 0.0 1.0;
+                                       offset, 0 -104;
+                               }
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+
+
+               part {
+                       name, "bg.contents";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 244 244 244 255;
+                               min, 0 104;
+                               rel1 {
+                                       to, "bg.title";
+                                       relative, 0.0 1.0;
+                               }
+                               rel2 {
+                                       to, "bg.bottom";
+                                       relative, 1.0 0.0;
+                               }
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+               
+               /////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+               part {
+                       name, "padding.title";
+                       type, SPACER;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 24;
+                               rel1.to, "bg.title";
+                               rel2 {
+                                       to, "bg.title";
+                                       relative, 1.0 0.0;
+                               }
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+
+               part {
+                       name, PART_TOP_TITLE;
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 51 51 51 255;
+                               min, 0 32;
+                               rel1 {
+                                       to, "padding.title";
+                                       relative, 0.0 1.0;
+                               }
+                               rel2.to, "padding.title";
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                               text {
+                                       font, FONT_REGULAR;
+                                       size, 32;
+                                       align, 0.5 0.5;
+                               }
+                       }
+               }
+
+
+               /////////////////////////////////////////////////////////////////////////////////////////////////
+
+               part {
+                       name, "padding.bottom";
+                       type, SPACER;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 32;
+                               rel1 {
+                                       to, "bg.bottom";
+                                       relative, 0.0 0.0;
+                               }
+                               rel2 {
+                                       to, "bg.bottom";
+                                       relative, 1.0 0.0;
+                               }
+
+
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+//                             color, 0 0 0 255;
+                       }
+               }
+
+
+               part {
+                       name, PART_LOCATION_BTN1;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 0 255 255 255;
+                               min, 0 72;
+                               rel1 {
+                                       to, "padding.bottom";
+                                       relative, 0.2 1.0;
+                               }
+                               rel2 {
+                                       to, "padding.bottom";
+                                       relative, 0.4 1.0;
+                               }
+
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+
+               part {
+                       name, PART_LOCATION_BTN2;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 0 255 255 255;
+                               min, 0 72;
+                               rel1 {
+                                       to, "padding.bottom";
+                                       relative, 0.6 1.0;
+                               }
+                               rel2 {
+                                       to, "padding.bottom";
+                                       relative, 0.8 1.0;
+                               }
+
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+
+
+
+               ///////////////////////////////////////////////////////
+               
+               part {
+                       name, PART_LOCATION_TEXT;
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 0 0 0 178;
+                               rel1 {
+                                       to, "bg.contents";
+                                       relative, 0.0 0.0;
+                               }
+                               rel2 {
+                                       to, "bg.contents";
+                                       relative, 1.0 0.3;
+                               }
+                               text {
+                                       font, FONT_LIGHT;
+                                       size, 32;
+                                       align, 0.5 0.5;
+                               }
+                       }
+
+               }
+
+               part {
+                       name, PART_LOCATION_MENU1;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 200;
+                               rel1 {
+                                       to, PART_LOCATION_TEXT;
+                                       relative, 0.1 1.0;
+                               }
+                               rel2 {
+                                       to, PART_LOCATION_TEXT;
+                                       relative, 0.4 1.0;
+                               }
+
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+
+                               color, 0 255 255 255;
+
+                       }
+               }
+
+               part {
+                       name, PART_LOCATION_MENU2;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 200;
+                               rel1 {
+                                       to, PART_LOCATION_TEXT;
+                                       relative, 0.6 1.0;
+                               }
+                               rel2 {
+                                       to, PART_LOCATION_TEXT;
+                                       relative, 0.9 1.0;
+                               }
+
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                               color, 0 255 255 255;
+                       }
+               }
+
+
+
+       }
+
+}
index 4ede6b7..c7f3b23 100644 (file)
@@ -27,6 +27,7 @@
 #include "menumgr.h"
 #include "viewmgr.h"
 #include "view_clock.h"
+#include "view_location.h"
 
 #define PADDING_X 26
 #define PADDING_Y 26
@@ -43,6 +44,10 @@ struct _priv {
        Evas_Object *table;
        layoutmgr *lmgr;
        struct menumgr *menu;
+
+       Evas_Object *   lang_popup;
+       Evas_Object *popup_btn1;
+       Evas_Object *popup_btn2;
 };
 
 enum {
@@ -56,12 +61,24 @@ enum {
        MENU_RESET
 };
 
+
+enum object_type {
+       EO_BTN_LANG_ENG=0,
+       EO_BTN_LANG_KOR,
+};
+
+
+
 static char *_get_status(void *data, int id);
 static char *_get_clock_mode(void *data, int id);
 static char *_get_sleep_timer(void *data, int id);
 static char *_get_language(void *data, int id);
 static char *_get_location(void *data, int id);
+
 static void _selected(void *data, int id);
+static void _language_selected(void *data, int id);
+static void _location_selected(void *data, int id);
+
 
 static struct menumgr_info menu_info[] = {
        {
@@ -101,7 +118,7 @@ static struct menumgr_info menu_info[] = {
                .style = STYLE_STATUS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_language,
-               .selected = _selected,
+               .selected = _language_selected,
        },
        {
                .id = MENU_SUBTITLE,
@@ -117,7 +134,7 @@ static struct menumgr_info menu_info[] = {
                .style = STYLE_STATUS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_location,
-               .selected = _selected,
+               .selected = _location_selected,
        },
        {
                .id = MENU_RESET,
@@ -228,6 +245,189 @@ static void _selected(void *data, int id)
        }
 }
 
+
+
+
+
+static void _remove_language_popup(struct _priv *priv);
+static void _popup_clicked_cb(int id, void *data, Evas_Object *obj);
+static void _popup_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,  Evas_Event_Key_Down *ev);
+
+
+
+static input_handler _popup_input_handler = {
+//     .mouse_move = _mouse_move_cb,
+       .clicked = _popup_clicked_cb,
+       .key_down = _popup_key_down_cb
+};
+
+
+static void _remove_language_popup(struct _priv *priv)
+{
+       if (!priv) {
+               _ERR("Invalid popup data !");
+               return;
+       }
+
+       if (priv->popup_btn1) {
+               inputmgr_remove_callback(priv->popup_btn1, &_popup_input_handler);
+               evas_object_del(priv->popup_btn1);
+               priv->popup_btn1 = NULL;
+       }
+       if (priv->popup_btn2) {
+               inputmgr_remove_callback(priv->popup_btn2, &_popup_input_handler);
+               evas_object_del(priv->popup_btn2);
+               priv->popup_btn2 = NULL;
+       }
+
+       evas_object_del(priv->lang_popup);
+       priv->lang_popup = NULL;
+}
+
+
+
+static void _popup_clicked_cb(int id, void *data, Evas_Object *obj)
+{
+       struct _priv *priv;
+
+       if (!data || !obj) {
+               _ERR("Invalid argument.");
+               return;
+       }
+
+       priv = data;
+
+       switch (id) {
+       case EO_BTN_LANG_ENG:
+               system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, "en_US");
+               menumgr_update(priv->menu);             
+               
+               _remove_language_popup(priv);
+               break;
+
+       case EO_BTN_LANG_KOR:
+               system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, "ko_KR");
+               menumgr_update(priv->menu);             
+
+               _remove_language_popup(priv);
+               break;
+
+       default:
+               _ERR("Unhandled object type.");
+               return;
+       }
+}
+
+
+static void _popup_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+               Evas_Event_Key_Down *ev)
+{
+       struct _priv *priv;
+
+       if (!ev || !data) {
+               _ERR("Invalid argument.");
+               return;
+       }
+
+       priv = data;
+
+       if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_ESC)) {
+               _remove_language_popup(priv);
+       } 
+}
+
+
+
+
+
+#define STR_LANGUAGE "Language"
+
+static bool _draw_language_select_popup(struct _priv *priv)
+{
+       Evas_Object *popup, *ly, *btn1, *btn2;
+
+       popup = utils_add_popup(priv->base, NULL, STR_LANGUAGE, NULL);
+       if (!popup) {
+               _ERR("Add popup failed");
+               return false;
+       }
+
+       ly = utils_add_layout(popup, GRP_POPUP_LANGUAGE, EINA_FALSE);
+       if (!ly) {
+               _ERR("Add layout failed.");
+               evas_object_del(popup);
+               return false;
+       }
+
+       elm_object_part_text_set(ly, PART_LANG_NAME, "Select language.");
+       evas_object_show(ly);
+
+
+       btn1 = utils_add_button(ly, PART_LANG_BUTTON1, NULL, "English");
+       if (!btn1) {
+               _ERR("Add button failed.");
+               evas_object_del(popup);
+               return false;
+       }
+
+       btn2 = utils_add_button(ly, PART_LANG_BUTTON2, NULL, "Korean");
+       if (!btn2) {
+               _ERR("Add button failed.");
+               evas_object_del(popup);
+               return false;
+       }
+
+       elm_object_content_set(popup, ly);
+
+       priv->lang_popup = popup;
+       priv->popup_btn1 = btn1;
+       priv->popup_btn2 = btn2;
+
+       inputmgr_add_callback(btn1, EO_BTN_LANG_ENG, &_popup_input_handler, priv);
+       inputmgr_add_callback(btn2, EO_BTN_LANG_KOR, &_popup_input_handler, priv);
+
+
+       elm_object_focus_set(btn1, EINA_TRUE);
+
+       return true;
+}
+
+
+static void _language_selected(void *data, int id)
+{
+       SETTING_TRACE_BEGIN;
+       struct _priv *priv = (struct _priv *)data;
+
+
+       if (!_draw_language_select_popup(priv)) {
+               _ERR("Draw language select popup failed.");
+               return;
+       }
+
+}
+
+static void _location_selected(void *data, int id)
+{
+       SETTING_TRACE_BEGIN;
+
+
+       viewmgr_hide_view(VIEW_LOCATION);
+       viewmgr_remove_view(VIEW_LOCATION);
+
+
+       SETTING_TRACE("1 - location");
+       if (!viewmgr_add_view(view_location_get_vclass(), NULL)) {
+               _ERR("Add view failed.");
+       }
+       if (!viewmgr_push_view(VIEW_LOCATION))
+               _ERR("Push view failed.");
+
+       SETTING_TRACE("2 - location");
+
+       if (!viewmgr_show_view(VIEW_LOCATION))
+               _ERR("viewmgr_show_view failed.");
+}
+
 static bool _add_layout_contents(struct _priv *priv)
 {
        Evas_Object *table;
index cb3e7dd..c7501cb 100644 (file)
@@ -22,6 +22,7 @@
 #include "define.h"
 #include "view_base.h"
 #include "view_clock.h"
+#include "view_location.h"
 
 #include <system_settings.h>
 
@@ -72,6 +73,12 @@ static bool _create(void *data)
                return false;
        }
 
+       if (!viewmgr_add_view(view_location_get_vclass(), NULL)) {
+               _ERR("Add view failed.");
+               evas_object_del(win);
+               return false;
+       }
+
        ad->win = win;
 
        return true;
@@ -93,6 +100,9 @@ static void _terminate(void *data)
        if (!viewmgr_remove_view(VIEW_CLOCK))
                _ERR("Remove view failed.");
 
+       if (!viewmgr_remove_view(VIEW_LOCATION))
+               _ERR("Remove view failed.");
+
        if (!viewmgr_destroy())
                _ERR("Destroy viewmgr failed.");
 
diff --git a/src/view/view_location.c b/src/view/view_location.c
new file mode 100644 (file)
index 0000000..31d4832
--- /dev/null
@@ -0,0 +1,372 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include <app.h>
+#include <Elementary.h>
+#include <system_settings.h>
+#include <utils_i18n.h>
+
+#include "viewmgr.h"
+#include "layoutmgr.h"
+#include "inputmgr.h"
+#include "app_debug.h"
+#include "app_string.h"
+#include "define.h"
+#include "layout.h"
+#include "utils.h"
+#include "view_base.h"
+
+
+struct _priv {
+       Evas_Object *win;
+       Evas_Object *base;
+       Evas_Object *menu[LAYOUT_MAX];
+       int cur_menu;
+       layoutmgr *lmgr;
+
+       Evas_Object *_btn1;
+       Evas_Object *_btn2;
+};
+
+
+
+enum object_type {
+       EO_BTN_LOCATION_CANCEL=0,
+       EO_BTN_LOCATION_OK,
+       EO_BTN_LOCATION_US,
+       EO_BTN_LOCATION_KR
+};
+
+
+static void _close_location_view(struct _priv *priv);
+static void _popup_clicked_cb(int id, void *data, Evas_Object *obj);
+static void _popup_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,  Evas_Event_Key_Down *ev);
+
+
+
+static input_handler _input_handler = {
+//     .mouse_move = _mouse_move_cb,
+       .clicked = _popup_clicked_cb,
+       .key_down = _popup_key_down_cb
+};
+
+
+static void _close_location_view(struct _priv *priv)
+{
+       if (!priv) {
+               _ERR("Invalid popup data !");
+               return;
+       }
+
+       if (priv->_btn1) {
+               inputmgr_remove_callback(priv->_btn1, &_input_handler);
+               evas_object_del(priv->_btn1);
+               priv->_btn1 = NULL;
+       }
+       if (priv->_btn2 ) {
+               inputmgr_remove_callback(priv->_btn2, &_input_handler);
+               evas_object_del(priv->_btn2);
+               priv->_btn2 = NULL;
+       }
+
+
+//     viewmgr_hide_view(VIEW_LOCATION);
+//     viewmgr_remove_view(VIEW_LOCATION);
+       viewmgr_pop_view();
+
+}
+
+
+
+static void _popup_clicked_cb(int id, void *data, Evas_Object *obj)
+{
+       struct _priv *priv;
+
+       if (!data || !obj) {
+               _ERR("Invalid argument.");
+               return;
+       }
+
+       priv = data;
+
+       switch (id) {
+       case EO_BTN_LOCATION_CANCEL:
+               _close_location_view(priv);
+               break;
+
+       case EO_BTN_LOCATION_OK:
+               _close_location_view(priv);
+               break;
+
+       case EO_BTN_LOCATION_US:
+               system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, "en_US");
+
+       case EO_BTN_LOCATION_KR:
+               system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, "ko_KR");
+               
+       default:
+               _ERR("Unhandled object type.");
+               return;
+       }
+}
+
+
+static void _popup_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+               Evas_Event_Key_Down *ev)
+{
+       struct _priv *priv;
+
+       if (!ev || !data) {
+               _ERR("Invalid argument.");
+               return;
+       }
+
+       priv = data;
+
+       if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_ESC)) {
+               _close_location_view(priv);
+       } 
+}
+
+
+
+#define STR_LANGUAGE "Location"
+
+static bool _draw_menu_area(struct _priv *priv)
+{
+       SETTING_TRACE_BEGIN;
+//     Evas_Object *box;
+
+       Evas_Object *btn1, *btn2;
+       Evas_Object *menu1, *menu2;
+       
+       if (!priv || !priv->base) {
+               _ERR("Invalid argument.");
+               return false;
+       }
+
+       elm_object_part_text_set(priv->base, PART_TOP_TITLE, _(STR_LANGUAGE));
+
+       elm_object_part_text_set(priv->base, PART_LOCATION_TEXT, _("Select your Contry."));
+
+
+
+       btn1 = utils_add_button(priv->base, PART_LOCATION_BTN1, NULL, _("Cancel"));
+       if (!btn1) {
+               _ERR("Add button failed.");
+               return false;
+       }
+
+       btn2 = utils_add_button(priv->base, PART_LOCATION_BTN2, NULL, _("Location"));
+       if (!btn2) {
+               _ERR("Add button failed.");
+               return false;
+       }
+
+       menu1 = utils_add_button(priv->base, PART_LOCATION_MENU1, STYLE_STATUS_BTN, "United States");
+       if (!menu1) {
+               _ERR("Add button failed.");
+               return false;
+       }
+
+       menu2 = utils_add_button(priv->base, PART_LOCATION_MENU2, STYLE_STATUS_BTN, "Public of Korea");
+       if (!menu2) {
+               _ERR("Add button failed.");
+               return false;
+       }
+
+       elm_object_focus_next_object_set(btn1, btn1, ELM_FOCUS_LEFT);
+       elm_object_focus_next_object_set(btn2, btn2, ELM_FOCUS_RIGHT);
+
+
+
+       priv->_btn1 = btn1;
+       priv->_btn2 = btn2;
+
+
+       inputmgr_add_callback(btn1, EO_BTN_LOCATION_CANCEL, &_input_handler, priv);
+       inputmgr_add_callback(btn2, EO_BTN_LOCATION_OK, &_input_handler, priv);
+
+#if 0
+       box = utils_add_box(priv->base, PART_MENU, EINA_TRUE,
+                       SIZE_MENU_BOX_PAD_H, SIZE_MENU_BOX_PAD_V);
+       if (!box) {
+               _ERR("Add box failed.");
+               return false;
+       }
+
+       for (i = 0; i < LAYOUT_MAX; i++) {
+               btn = utils_add_button(box, NULL, STYLE_MENU_BTN,
+                               _mdata[i].name);
+               if (!btn) {
+                       _ERR("elm_button_add failed.");
+                       evas_object_del(box);
+                       return false;
+               }
+
+               elm_box_pack_end(box, btn);
+
+               inputmgr_add_callback(btn, i, &_menu_input_handler, priv);
+
+               priv->menu[i] = btn;
+       }
+
+       elm_object_focus_next_object_set(priv->menu[0], priv->menu[0],
+                       ELM_FOCUS_LEFT);
+       elm_object_focus_next_object_set(priv->menu[LAYOUT_MAX - 1],
+                       priv->menu[LAYOUT_MAX - 1], ELM_FOCUS_RIGHT);
+
+#endif
+       elm_object_focus_set(menu1, EINA_TRUE);
+       return true;
+}
+
+static Evas_Object *_create(Evas_Object *win, void *data)
+{
+       SETTING_TRACE_BEGIN;
+       struct _priv *priv;
+       Evas_Object *base;
+       layoutmgr *lmgr;
+
+       if (!win) {
+               _ERR("Get window object failed.");
+               return NULL;
+       }
+
+       priv = calloc(1, sizeof(*priv));
+       if (!priv) {
+               _ERR("Calloc failed.");
+               return NULL;
+       }
+
+       base = utils_add_layout(win, GRP_VIEW_LOCATION, EINA_TRUE);
+       if (!base) {
+               _ERR("Add layout failed.");
+               free(priv);
+               return NULL;
+       }
+
+       lmgr = layoutmgr_create(base);
+       if (!lmgr) {
+               _ERR("Create layoutmgr failed.");
+               evas_object_del(base);
+               free(priv);
+               return NULL;
+       }
+       //for (i = 0; i < LAYOUT_MAX; i++)
+       //      layoutmgr_add_layout(lmgr, _mdata[i].get_lclass(), NULL);
+
+       priv->win = win;
+       priv->base = base;
+       priv->lmgr = lmgr;
+       priv->cur_menu = LAYOUT_MAX;
+
+       if (!viewmgr_set_view_data(VIEW_LOCATION, priv)) {
+               _ERR("Set view data failed.");
+               evas_object_del(base);
+               free(priv);
+               return NULL;
+       }
+       return base;
+}
+
+static void _show(void *data)
+{
+       SETTING_TRACE_BEGIN;
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Get data failed.");
+               return;
+       }
+       priv = data;
+
+       if (priv->base)
+               evas_object_show(priv->base);
+
+       _draw_menu_area(priv);
+}
+
+static void _hide(void *data)
+{
+       SETTING_TRACE_BEGIN;
+
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Get data failed.");
+               return;
+       }
+       priv = data;
+
+       if (priv->base)
+               evas_object_hide(priv->base);
+}
+
+static void _update(void *view_data, int update_type, void *data)
+{
+       SETTING_TRACE_BEGIN;
+
+//     struct _priv *priv;
+
+       if (!view_data) {
+               _ERR("Get data failed.");
+               return;
+       }
+//     priv = view_data;
+
+//     if (update_type == UPDATE_FOCUS)
+//             elm_object_focus_set(priv->menu[priv->cur_menu], EINA_TRUE);
+}
+
+static void _destroy(void *data)
+{
+       SETTING_TRACE_BEGIN;
+
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Get data failed.");
+               return;
+       }
+       priv = data;
+
+#if 0
+       for (i = 0; i < LAYOUT_MAX; i++)
+               layoutmgr_remove_layout(priv->lmgr, _mdata[i].layout_id);
+#endif
+       layoutmgr_destroy(priv->lmgr);
+
+       if (priv->base)
+               evas_object_del(priv->base);
+
+       free(priv);
+}
+// VIEW_BASE
+static view_class _vclass = {
+       .view_id = VIEW_LOCATION,
+       .create = _create,
+       .show = _show,
+       .hide = _hide,
+       .update = _update,
+       .destroy = _destroy,
+};
+
+view_class *view_location_get_vclass(void)
+{
+       SETTING_TRACE_BEGIN;
+       return &_vclass;
+}