Apply the chinese ambiguous input 27/170027/5
authorXie Ligang <ligang0.xie@samsung.com>
Tue, 13 Feb 2018 03:19:59 +0000 (11:19 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 14 Feb 2018 02:19:56 +0000 (02:19 +0000)
Change-Id: I572c8dad37efd2d4c191085962df4e96e1c3c6c3

data/layout/wearable/LYT_PORTRAIT_4X4_CHINESE.xml
src/include/ise.h
src/ise.cpp

index f9e9146..ef4bb1e 100644 (file)
         <label auto_upper="true" autopopup="1">\</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">ABC</rec>
         <rec multi="1">2</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">a</rec>
-        <rec auto_upper="true" multichar_state="1">b</rec>
-        <rec auto_upper="true" multichar_state="2">c</rec>
+        <rec>2</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">2</label>
         <label auto_upper="true" autopopup="3">c</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">DEF</rec>
         <rec multi="1">3</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">d</rec>
-        <rec auto_upper="true" multichar_state="1">e</rec>
-        <rec auto_upper="true" multichar_state="2">f</rec>
+        <rec>3</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">d</label>
         <label auto_upper="true" autopopup="2">/</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">ABC</rec>
         <rec multi="1">2</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">a</rec>
-        <rec auto_upper="true" multichar_state="1">b</rec>
-        <rec auto_upper="true" multichar_state="2">c</rec>
+        <rec>2</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">2</label>
         <label auto_upper="true" autopopup="3">c</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">DEF</rec>
         <rec multi="1">3</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">d</rec>
-        <rec auto_upper="true" multichar_state="1">e</rec>
-        <rec auto_upper="true" multichar_state="2">f</rec>
+        <rec>3</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">d</label>
         <label auto_upper="true" autopopup="3">;</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">ABC</rec>
         <rec multi="1">2</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">a</rec>
-        <rec auto_upper="true" multichar_state="1">b</rec>
-        <rec auto_upper="true" multichar_state="2">c</rec>
+        <rec>2</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">2</label>
         <label auto_upper="true" autopopup="3">c</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">DEF</rec>
         <rec multi="1">3</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">d</rec>
-        <rec auto_upper="true" multichar_state="1">e</rec>
-        <rec auto_upper="true" multichar_state="2">f</rec>
+        <rec>3</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">d</label>
         <rec>,</rec>
       </key_value>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">GHI</rec>
         <rec multi="1">4</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">g</rec>
-        <rec auto_upper="true" multichar_state="1">h</rec>
-        <rec auto_upper="true" multichar_state="2">i</rec>
+        <rec>4</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">4</label>
         <label auto_upper="true" autopopup="3">i</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">JKL</rec>
         <rec multi="1">5</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">j</rec>
-        <rec auto_upper="true" multichar_state="1">k</rec>
-        <rec auto_upper="true" multichar_state="2">l</rec>
+        <rec>5</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">5</label>
         <label auto_upper="true" autopopup="3">l</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">MNO</rec>
         <rec multi="1">6</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">m</rec>
-        <rec auto_upper="true" multichar_state="1">n</rec>
-        <rec auto_upper="true" multichar_state="2">o</rec>
+        <rec>6</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">m</label>
         <rec>?</rec>
       </key_value>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">PQRS</rec>
         <rec multi="1">7</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">p</rec>
-        <rec auto_upper="true" multichar_state="1">q</rec>
-        <rec auto_upper="true" multichar_state="2">r</rec>
-        <rec auto_upper="true" multichar_state="3">s</rec>
+        <rec>7</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">7</label>
         <label auto_upper="true" autopopup="4">s</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">TUV</rec>
         <rec multi="1">8</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">t</rec>
-        <rec auto_upper="true" multichar_state="1">u</rec>
-        <rec auto_upper="true" multichar_state="2">v</rec>
+        <rec>8</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">8</label>
         <label auto_upper="true" autopopup="3">v</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">WXYZ</rec>
         <rec multi="1">9</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">w</rec>
-        <rec auto_upper="true" multichar_state="1">x</rec>
-        <rec auto_upper="true" multichar_state="2">y</rec>
-        <rec auto_upper="true" multichar_state="3">z</rec>
+        <rec>9</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">w</label>
     </key>
   </row>
   <row x="20" sub_layout="URL">
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">PQRS</rec>
         <rec multi="1">7</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">p</rec>
-        <rec auto_upper="true" multichar_state="1">q</rec>
-        <rec auto_upper="true" multichar_state="2">r</rec>
-        <rec auto_upper="true" multichar_state="3">s</rec>
+        <rec>7</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">7</label>
         <label auto_upper="true" autopopup="4">s</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">TUV</rec>
         <rec multi="1">8</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">t</rec>
-        <rec auto_upper="true" multichar_state="1">u</rec>
-        <rec auto_upper="true" multichar_state="2">v</rec>
+        <rec>8</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">8</label>
         <label auto_upper="true" autopopup="3">v</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">WXYZ</rec>
         <rec multi="1">9</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">w</rec>
-        <rec auto_upper="true" multichar_state="1">x</rec>
-        <rec auto_upper="true" multichar_state="2">y</rec>
-        <rec auto_upper="true" multichar_state="3">z</rec>
+        <rec>9</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">w</label>
     </key>
   </row>
   <row x="20" sub_layout="EMAIL">
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">PQRS</rec>
         <rec multi="1">7</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">p</rec>
-        <rec auto_upper="true" multichar_state="1">q</rec>
-        <rec auto_upper="true" multichar_state="2">r</rec>
-        <rec auto_upper="true" multichar_state="3">s</rec>
+        <rec>7</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">7</label>
         <label auto_upper="true" autopopup="4">s</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">TUV</rec>
         <rec multi="1">8</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">t</rec>
-        <rec auto_upper="true" multichar_state="1">u</rec>
-        <rec auto_upper="true" multichar_state="2">v</rec>
+        <rec>8</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">8</label>
         <label auto_upper="true" autopopup="3">v</label>
       </auto_popup_keys>
     </key>
-    <key key_type="string" button_type="multitap" popup_type="auto_popup">
+    <key popup_type="auto_popup">
       <label>
         <rec multi="0" auto_upper="true">WXYZ</rec>
         <rec multi="1">9</rec>
       </label>
       <key_value>
-        <rec auto_upper="true" multichar_state="0">w</rec>
-        <rec auto_upper="true" multichar_state="1">x</rec>
-        <rec auto_upper="true" multichar_state="2">y</rec>
-        <rec auto_upper="true" multichar_state="3">z</rec>
+        <rec>9</rec>
       </key_value>
       <auto_popup_keys>
         <label auto_upper="true" autopopup="0">w</label>
index 52ad2fe..a11068b 100644 (file)
@@ -199,6 +199,9 @@ void ise_create();
 void ise_destroy();
 void ise_app_candidate_show();
 void ise_app_candidate_hide();
+#ifdef _WEARABLE
+void ise_check_wearable_candidate();
+#endif
 void ise_reset_context();
 void ise_reset_input_context();
 void ise_set_layout(sclu32 layout, sclu32 layout_variation);
index 6687421..fce5608 100644 (file)
@@ -1014,9 +1014,9 @@ SCLEventReturnType CUIEventCallback::on_event_key_clicked(SclUIEventDesc event_d
                         *ensure the Number keypad won't be affected
                         *
                         */
-                        if (g_keyboard_state.layout == ISE_LAYOUT_STYLE_NUMBER){
+                        if (g_keyboard_state.layout == ISE_LAYOUT_STYLE_NUMBER) {
                             ime_send_key_event(IME_KEY_Print, IME_KEY_MASK_CONTROL, false);
-                        } else{
+                        } else {
                             ime_send_key_event(IME_KEY_Select, IME_KEY_MASK_CONTROL, false);
                         }
 #endif
@@ -1327,30 +1327,11 @@ ise_show(int ic)
         const sclchar *cur_lang = _language_manager.get_current_language();
 
 #ifdef _WEARABLE
-        if (cur_lang && !strcmp(cur_lang, "English")) {
-            if (!g_config_values.prediction_on ||
-                    (g_keyboard_state.layout == ISE_LAYOUT_STYLE_PHONENUMBER ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_VOICE ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_IP ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_MONTH ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_NUMBERONLY ||
-                g_keyboard_state.layout != ISE_LAYOUT_STYLE_EMAIL ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_PASSWD_3X4||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_PASSWORD)){
-                ise_app_candidate_hide();
-                g_softcandidate_show = false;
-            } else {
-                g_softcandidate_show = true;
-                ise_app_candidate_show();
-            }
-        } else {
-            ise_app_candidate_hide();
-            g_softcandidate_show = false;
-        }
+        ise_check_wearable_candidate();
         /*
          *Clear the personalized data
          */
-        if (g_config_values.dataclear){
+        if (g_config_values.dataclear) {
             ime_send_key_event(IME_KEY_Clear, IME_KEY_MASK_CONTROL, false);
             g_config_values.dataclear = FALSE;
         }
@@ -1929,7 +1910,7 @@ void
 ise_app_candidate_show()
 {
 #ifdef _WEARABLE
-    if (!g_softcandidate_show){
+    if (!g_softcandidate_show) {
         return;
     }
 #endif
@@ -1961,6 +1942,25 @@ ise_app_candidate_hide()
     add_softcandidate_hide_timer();
 }
 
+#ifdef _WEARABLE
+void ise_check_wearable_candidate() {
+    if (!g_config_values.prediction_on) {
+        ise_app_candidate_hide();
+    } else if (g_keyboard_state.layout == ISE_LAYOUT_STYLE_PHONENUMBER ||
+                  g_keyboard_state.layout == ISE_LAYOUT_STYLE_VOICE ||
+                  g_keyboard_state.layout == ISE_LAYOUT_STYLE_IP ||
+                  g_keyboard_state.layout == ISE_LAYOUT_STYLE_MONTH ||
+                  g_keyboard_state.layout == ISE_LAYOUT_STYLE_NUMBERONLY ||
+                  g_keyboard_state.layout == ISE_LAYOUT_STYLE_PASSWD_3X4||
+                  g_keyboard_state.layout == ISE_LAYOUT_STYLE_PASSWORD) {
+        ise_app_candidate_hide();
+    } else {
+        g_softcandidate_show = true;
+        ise_app_candidate_show();
+    }
+}
+#endif
+
 // when it is the time to auto_cap, the
 // ise_set_caps_mode is called.
 // -------------------------------------------------------
@@ -2643,26 +2643,7 @@ static void ime_app_caps_mode_changed_cb(int mode, void *user_data)
 static void ime_app_candidate_show_cb(int context_id, void *user_data)
 {
 #ifdef _WEARABLE
-    const sclchar *cur_lang = _language_manager.get_current_language();
-    if (cur_lang && !strcmp(cur_lang, "English")) {
-        if (!g_config_values.prediction_on ||
-                (g_keyboard_state.layout == ISE_LAYOUT_STYLE_PHONENUMBER ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_VOICE ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_IP ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_MONTH ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_NUMBERONLY ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_PASSWD_3X4||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_PASSWORD)){
-            ise_app_candidate_hide();
-            g_softcandidate_show = false;
-        } else {
-            g_softcandidate_show = true;
-            ise_app_candidate_show();
-        }
-    } else {
-        ise_app_candidate_hide();
-        g_softcandidate_show = false;
-    }
+    ise_check_wearable_candidate();
 #else
     ise_app_candidate_show();
 #endif
@@ -2671,27 +2652,7 @@ static void ime_app_candidate_show_cb(int context_id, void *user_data)
 static void ime_app_candidate_hide_cb(int context_id, void *user_data)
 {
 #ifdef _WEARABLE
-    const sclchar *cur_lang = _language_manager.get_current_language();
-    if (cur_lang && !strcmp(cur_lang, "English")) {
-        if (!g_config_values.prediction_on ||
-                (g_keyboard_state.layout == ISE_LAYOUT_STYLE_PHONENUMBER ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_VOICE ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_IP ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_MONTH ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_NUMBERONLY ||
-                g_keyboard_state.layout != ISE_LAYOUT_STYLE_EMAIL ||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_PASSWD_3X4||
-                g_keyboard_state.layout == ISE_LAYOUT_STYLE_PASSWORD)){
-            ise_app_candidate_hide();
-            g_softcandidate_show = false;
-        } else {
-            g_softcandidate_show = true;
-            ise_app_candidate_show();
-        }
-    } else {
-        ise_app_candidate_hide();
-        g_softcandidate_show = false;
-    }
+    ise_check_wearable_candidate();
 #else
     ise_app_candidate_hide();
 #endif
@@ -2874,7 +2835,7 @@ static void ime_app_mime_type_set_request_cb(const char *mime_types, void *user_
 #endif
 }
 
-/*static void ime_app_prediction_hint_data_set_cb(const char *key, const char *value, void *user_data)
+static void ime_app_prediction_hint_data_set_cb(const char *key, const char *value, void *user_data)
 {
     SECURE_LOGD("key : %s, value : %s\n", key, value);
 
@@ -2882,7 +2843,7 @@ static void ime_app_mime_type_set_request_cb(const char *mime_types, void *user_
         g_app_id = string(value ? value : "");
     else if (string(key) == "res_id")
         g_resource_id = string(value ? value : "");
-}*/
+}
 
 #ifdef __cplusplus
 extern "C"{
@@ -2922,7 +2883,7 @@ EXPORTED void ime_app_main(int argc, char **argv)
 
     ime_event_set_prediction_hint_set_cb(ime_app_prediction_hint_set_cb, NULL);
     ime_event_set_mime_type_set_request_cb(ime_app_mime_type_set_request_cb, NULL);
-    //ime_event_set_prediction_hint_data_set_cb(ime_app_prediction_hint_data_set_cb, NULL);
+    ime_event_set_prediction_hint_data_set_cb(ime_app_prediction_hint_data_set_cb, NULL);
 
 #if DEFER_ISE_CREATION
     ime_set_window_creation_defer_flag(TRUE);