Remove clipboard feature
[platform/core/uifw/ise-default.git] / src / ise.cpp
index 23f6d31..e8eb514 100644 (file)
@@ -32,7 +32,6 @@
 #include <app_preference.h>
 #include <ode/internal-encryption.h>
 #include <notification.h>
-#include "clipboard.h"
 #include "autofill.h"
 #include "ise.h"
 #include "utils.h"
@@ -212,7 +211,6 @@ static CandidateEventListener g_candidate_event_listener;
 #define MULTITAP_TIMEOUT         3.0
 #define USER_KEYSTRING_OPTION    "OPTION"
 #define USER_KEYSTRING_EMOTICON  "EMOTICON_LAYOUT"
-#define USER_KEYSTRING_CLIPBOARD "CLIPBOARD"
 #define USER_KEYSTRING_VOICE     "STT_3X4"
 #define USER_KEYSTRING_FLOATING  "FLOATING"
 #define USER_KEYSTRING_STICKER   "STICKER_LAYOUT"
@@ -221,7 +219,7 @@ static CandidateEventListener g_candidate_event_listener;
 #define USER_VOICE_LANGUAGE     "LANGUAGE"
 
 static sclboolean           _cm_popup_opened = FALSE;
-static const char          *_cm_key_list[CM_KEY_LIST_SIZE] = {USER_KEYSTRING_OPTION, USER_KEYSTRING_EMOTICON, USER_KEYSTRING_CLIPBOARD,
+static const char          *_cm_key_list[CM_KEY_LIST_SIZE] = {USER_KEYSTRING_OPTION, USER_KEYSTRING_EMOTICON,
                                                               USER_KEYSTRING_VOICE, USER_KEYSTRING_FLOATING, USER_KEYSTRING_STICKER, USER_KEYSTRING_TRANSLATION};
 static scluint              _current_cm_key_id = 0;
 
@@ -407,12 +405,6 @@ static void ise_set_cm_private_key(scluint cm_key_id)
             const_cast<sclchar*>("icon/54x54/icon_setting_press.png"),
             const_cast<sclchar*>("icon/54x54/icon_setting_dim.png")};
         ui->set_private_key("CM_KEY", const_cast<sclchar*>(" "), imagelabel, NULL, 0, const_cast<sclchar*>(USER_KEYSTRING_OPTION), TRUE);
-    } else if (strcmp(_cm_key_list[cm_key_id], USER_KEYSTRING_CLIPBOARD) == 0) {
-        sclchar* imagelabel[SCL_BUTTON_STATE_MAX] = {
-            const_cast<sclchar*>("icon/54x54/icon_clipboard_nor.png"),
-            const_cast<sclchar*>("icon/54x54/icon_clipboard_press.png"),
-            const_cast<sclchar*>("icon/54x54/icon_clipboard_dim.png")};
-        ui->set_private_key("CM_KEY", const_cast<sclchar*>(" "), imagelabel, NULL, 0, const_cast<sclchar*>(USER_KEYSTRING_CLIPBOARD), TRUE);
     } else if (strcmp(_cm_key_list[cm_key_id], USER_KEYSTRING_VOICE) == 0) {
         sclchar* imagelabel[SCL_BUTTON_STATE_MAX] = {
             const_cast<sclchar*>("icon/54x54/icon_mic_nor.png"),
@@ -1029,7 +1021,7 @@ void CUIEventCallback::on_event_character_key(CSCLUI *ui, SclUIEventDesc event_d
         }
     }
     if (input_mode && strcmp (input_mode, "NUMONLY_3X4_SIGDEC") == 0 &&
-        strcmp(event_desc.key_value, ".") == 0) {
+        event_desc.key_value && strcmp(event_desc.key_value, ".") == 0) {
         ime_update_preedit_string(_sig_dec[_click_count%SIG_DEC_SIZE], NULL);
         ime_show_preedit_string();
         delete_commit_timer();
@@ -1108,10 +1100,6 @@ void CUIEventCallback::on_event_modechange_key(CSCLUI *ui, SclUIEventDesc event_
         launch_option();
 
         ret = SCL_EVENT_DONE;
-    } else if (strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0) {
-        clipboard_show();
-
-        ret = SCL_EVENT_DONE;
     } else if (strcmp(event_desc.key_value, USER_KEYSTRING_FLOATING) == 0) {
         CONFIG_VALUES *config_values = get_config_values();
 
@@ -1176,9 +1164,6 @@ void CUIEventCallback::process_user_key(CSCLUI *ui, SclUIEventDesc event_desc, K
         launch_option();
 
         ret = SCL_EVENT_DONE;
-    } else if (strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0) {
-        clipboard_show();
-        ret = SCL_EVENT_DONE;
     } else if (strcmp(event_desc.key_value, "Cancel") == 0) {
         ret = SCL_EVENT_DONE;
         const sclchar *input_mode = ui->get_input_mode();
@@ -1230,7 +1215,6 @@ void CUIEventCallback::process_user_key(CSCLUI *ui, SclUIEventDesc event_desc, K
 
     if (_cm_popup_opened) {
         if (strcmp(event_desc.key_value, USER_KEYSTRING_OPTION) == 0 ||
-            strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0 ||
             strcmp(event_desc.key_value, USER_KEYSTRING_STICKER) == 0 ||
             strcmp(event_desc.key_value, USER_KEYSTRING_TRANSLATION) == 0) {
             scluint id = ise_get_cm_key_id(event_desc.key_value);
@@ -2085,6 +2069,7 @@ ise_destroy()
         LOGD("deleting ui\n");
         delete ui;
         ui = NULL;
+        g_ui = NULL;
     }
 
     if (g_candidate) {
@@ -2590,9 +2575,8 @@ static void ime_app_create_cb(void *user_data)
     if (elm_scale)
         elm_app_base_scale_set(atof(elm_scale));
 
-    clipboard_init();
-
-    nmt_init();
+    if (nmt_check_agent_install())
+        nmt_init();
 }
 
 static void ime_app_exit_cb(void *user_data)
@@ -2603,8 +2587,6 @@ static void ime_app_exit_cb(void *user_data)
     if (!engine_loader_dbus_shutdown())
         LOGE("Failed to finalize dbus");
 
-    clipboard_shutdown();
-
     nmt_shutdown();
 }
 
@@ -2712,8 +2694,6 @@ static void ime_app_hide_cb(int ic, void *user_data)
     LOGD("Enter\n");
     ise_hide();
 
-    clipboard_set_mime_type(false);
-
     g_ic_smartreply = -1;
 }
 
@@ -2788,7 +2768,6 @@ static void ime_app_focus_out_cb(int context_id, void *user_data)
     LOGD("Enter\n");
     ise_focus_out(context_id);
     g_imdata_state = 0;
-    clipboard_set_mime_type(false);
     input_smartreply_deinit();
     g_ic_smartreply = -1;
 
@@ -3164,17 +3143,6 @@ static void ime_app_prediction_hint_set_cb(const char *prediction_hint, void *us
 static void ime_app_mime_type_set_request_cb(const char *mime_types, void *user_data)
 {
     LOGD("mime type : %s\n", mime_types);
-
-    clipboard_set_mime_type(true);
-    clipboard_init_sel_type();
-
-    string str(mime_types), text_key = "text/", image_key = "image/";
-
-    if (str.find(text_key) != string::npos)
-        clipboard_add_sel_type(CLIPBOARD_SEL_TEXT);
-
-    if (str.find(image_key) != string::npos)
-        clipboard_add_sel_type(CLIPBOARD_SEL_IMAGE);
 }
 
 static void ime_app_prediction_hint_data_set_cb(const char *key, const char *value, void *user_data)