Remove build warning
[platform/core/uifw/inputdelegator.git] / src / w-input-emoticon.cpp
index 32a7f4c..d73b692 100755 (executable)
 
 #include "Debug.h"
 #include "w-input-selector.h"
-#include "w-input-smartreply.h"
 
 #define EMOTICON_CNT 27
 
-static int previous_icon = -1;
-
 using namespace std;
 
 typedef struct {
     int code;
-    char* name;
+    const char* name;
 }Emoticon;
 
 Emoticon emoticon_info[EMOTICON_CNT] = {
@@ -70,7 +67,7 @@ const char * get_emoticon_file_name(int index)
 
     int ipos = path.size()-9;
     char str_emoticon_code[10] = {0};
-    sprintf(str_emoticon_code, "%x", emoticon_info[index].code);
+    snprintf(str_emoticon_code, sizeof(str_emoticon_code), "%x", emoticon_info[index].code);
     path.erase(ipos, 5);
     path.insert(ipos, str_emoticon_code);
     return path.c_str();
@@ -95,21 +92,6 @@ _rotary_selector_rotary_cb(void *data, Evas_Object *obj, Eext_Rotary_Event_Info
        return ECORE_CALLBACK_PASS_ON;
 }
 
-static char *_access_info_prepend_cb(void *data, Evas_Object *obj)
-{
-   PRINTFUNC(DLOG_DEBUG, "%s", __func__);
-
-   std::string text;
-
-   if (previous_icon == 10 || previous_icon == 11){
-               text = std::string("Page") + " " +std::string(dgettext(PACKAGE, emoticon_info[previous_icon].name));
-               text = text + " " + gettext("WDS_TTS_TBBODY_DOUBLE_TAP_TO_SEND");
-   } else {
-          text = std::string("Page");
-   }
-   return strdup(text.c_str());
-}
-
 static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *event_info)
 {
     PRINTFUNC(DLOG_DEBUG, "%s", __func__);
@@ -136,11 +118,7 @@ static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *ev
     const Eina_Unicode unicode_event[2] = { emoticon_info[i].code, 0 };
     char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
 
-    input_smartreply_send_feedback(utf_8);
-       if(ad->reply_type == REPLY_APP_CONTROL)
-        reply_to_sender_by_appcontrol(data, (const char*)utf_8, "emoticon");
-       else
-        reply_to_sender_by_callback((const char*)utf_8, "emoticon");
+    reply_to_sender_by_callback((const char*)utf_8, "emoticon");
 
     PRINTFUNC(SECURE_DEBUG, "[%d]%s", i, utf_8);
     if (utf_8)
@@ -153,38 +131,6 @@ static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *ev
 static void _rotary_selector_item_selected(void *data, Evas_Object *obj, void *event_info)
 {
     PRINTFUNC(DLOG_DEBUG, "%s", __func__);
-    if (elm_config_access_get())
-    {
-        Eext_Object_Item *selected_item = (Eext_Object_Item *)event_info;
-        Eina_List *rotary_selector_list = (Eina_List *)eext_rotary_selector_items_get(obj);
-
-        int i = 0;
-        Eina_List *l = rotary_selector_list;
-        Eext_Object_Item *item = (Eext_Object_Item *)eina_list_data_get(l);
-
-        for (i = 0; l != NULL; i++) {
-            if (selected_item == item)
-                break;
-
-            l = eina_list_next(l);
-            item = (Eext_Object_Item *)eina_list_data_get(l);
-        }
-
-
-               previous_icon = i;
-
-        Evas_Object *content = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(obj), "content");
-        if (!content) return;
-
-        Evas_Object *content_access = elm_access_object_get(content);
-        if (!content_access)
-            return;
-
-        std::string text = std::string(dgettext(PACKAGE, emoticon_info[i].name));
-        PRINTFUNC(DLOG_DEBUG, "[%d]%s", i, text.c_str());
-        text = text + " " + gettext("WDS_TTS_TBBODY_DOUBLE_TAP_TO_SEND");
-        elm_access_say(text.c_str());
-    }
 }
 
 void ise_show_emoticon_popup_rotary(void *data)
@@ -194,7 +140,6 @@ void ise_show_emoticon_popup_rotary(void *data)
     if (!ad)
         return;
 
-    Eext_Object_Item *first_it;
 
     Evas_Object *rotary_selector = eext_rotary_selector_add(ad->naviframe);
 //    uxt_theme_object_replace_color(rotary_selector, "B01153", "AO0117");
@@ -204,8 +149,6 @@ void ise_show_emoticon_popup_rotary(void *data)
         Evas_Object *img = NULL;
         Eext_Object_Item *item = eext_rotary_selector_item_append(rotary_selector);
 
-        if (i == 0) first_it = item;
-
         img = elm_image_add(rotary_selector);
         elm_image_file_set(img, get_emoticon_file_name(i), NULL);
         eext_rotary_selector_item_part_content_set(item, "item,bg_image", EEXT_ROTARY_SELECTOR_ITEM_STATE_NORMAL, img);
@@ -222,13 +165,5 @@ void ise_show_emoticon_popup_rotary(void *data)
     elm_naviframe_item_pop_cb_set(nf_item, _custom_back_cb, NULL);
     eext_rotary_object_event_activated_set(rotary_selector, EINA_TRUE);
 
-    if (elm_config_access_get()){
-               Evas_Object *selector_access = elm_access_object_get(rotary_selector);
-        elm_access_highlight_set(selector_access);
-               eext_rotary_object_event_callback_add(rotary_selector, _rotary_selector_rotary_cb, first_it);
-
-//             ea_screen_reader_access_info_append_cb_set(selector_access, ELM_ACCESS_CONTEXT_INFO, _access_info_prepend_cb, NULL);
-    }
-
     PRINTFUNC(DLOG_DEBUG, "%s", __func__);
 }