adopt the return type for caller to send button in keyboard mode
[platform/core/uifw/inputdelegator.git] / src / MoreOption.cpp
index 5693264..5159e0c 100755 (executable)
@@ -16,6 +16,7 @@
 
 #include "Debug.h"
 
+#include <string>
 #include <assert.h>
 #include <iostream>
 #include <stdexcept>
@@ -28,6 +29,8 @@
 #include "w-input-stt-ise.h"
 #include "w-input-stt-voice.h"
 
+using namespace std;
+
 extern Evas_Object *g_setting_window;
 
 MoreOption::MoreOption(Evas_Object *naviframe, void* voicedata)
@@ -116,7 +119,10 @@ void MoreOption::SetContentLayout(Evas_Object *content) {
        elm_object_part_content_set(more_option_layout, "elm.swallow.content", content);
 
        Elm_Object_Item *nit = NULL;
-       nit = elm_naviframe_item_push(nf, NULL, NULL, NULL, more_option_layout, "empty");
+       const char *item_style = NULL;
+       if (_WEARABLE)
+               item_style = "empty";
+       nit = elm_naviframe_item_push(nf, NULL, NULL, NULL, more_option_layout, item_style);
        elm_naviframe_item_title_enabled_set(nit, EINA_FALSE, EINA_FALSE);
 
        elm_naviframe_item_pop_cb_set(nit,
@@ -211,7 +217,7 @@ void MoreOption::Update()
        char lang[6] = {0, };
        strncpy(lang, ((VoiceData *)voicedata)->kbd_lang , 5);
 
-       char* display_lang = get_lang_label(lang);
+       const char* display_lang = get_lang_label(lang);
        eext_more_option_item_part_text_set(item, "selector,sub_text", display_lang);
 }
 
@@ -221,12 +227,13 @@ Evas_Object* MoreOption::AddLanguageIcon(Evas_Object *parent) {
                PRINTFUNC(DLOG_ERROR, "It's failed to add image.");
        }
 
-       std::string res_path;
-       char *tmp_path = app_get_resource_path();
-       if (tmp_path) {
-               res_path = tmp_path;
-               free(tmp_path);
-       }
+       string res_path = get_resource_path();
+       if (_WEARABLE)
+               res_path = res_path + "wearable/";
+       else if (_TV)
+               res_path = res_path + "tv/";
+       else
+               res_path = res_path + "mobile/";
 
        std::string image_path = res_path + "images/prompt_ic_languages.png";
 
@@ -262,36 +269,6 @@ void MoreOption::AddMorePage() {
        [](void *data, Evas_Object *obj, void *event_info)
        {
                PRINTFUNC(DLOG_DEBUG, "item,selected");
-
-               Eext_Object_Item *selected_item = (Eext_Object_Item *)event_info;
-
-               //for custom accessibility
-               if (elm_config_access_get())
-               {
-                       Evas_Object *panel = elm_object_part_content_get(obj, "elm.swallow.right");
-                       if (!panel) return;
-
-                       Evas_Object *rotary_selector = elm_object_content_get(panel);
-                       if (!rotary_selector) return;
-
-                       Evas_Object *content = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(rotary_selector), "content");
-                       if (!content) return;
-
-                       Evas_Object *content_access = elm_access_object_get(content);
-                       if (!content_access) return;
-
-                       if (eext_more_option_item_part_text_get(selected_item, "selector,main_text"))
-                       {
-                               std::string text;
-                               if(eext_more_option_item_part_text_get(selected_item, "selector,main_text"))
-                                       text = text + std::string(eext_more_option_item_part_text_get(selected_item, "selector,main_text")) + " ";
-
-                               if(eext_more_option_item_part_text_get(selected_item, "selector,main_text"))
-                                       text = text + std::string(eext_more_option_item_part_text_get(selected_item, "selector,sub_text"));
-
-                               elm_access_info_set(content_access, ELM_ACCESS_INFO, text.c_str());
-                       }
-               }
        }, NULL);
 }