Add voice button for CM key 98/87098/5
authorHaifeng Deng <haifeng.deng@samsung.com>
Tue, 6 Sep 2016 09:39:03 +0000 (17:39 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 23 Sep 2016 07:44:20 +0000 (00:44 -0700)
Change-Id: I6cd0200df8209b2c8861605c1d5455e808adfc2f
Signed-off-by: Haifeng Deng <haifeng.deng@samsung.com>
data/layout/mobile/LYT_CM_POPUP.xml
data/layout/mobile/input_mode_configure.xml
data/pixmaps/default/mobile/icon_mic.png [new file with mode: 0644]
data/pixmaps/default/mobile/icon_mic_dim.png [new file with mode: 0644]
data/pixmaps/default/mobile/icon_mic_press.png [new file with mode: 0644]
src/ise.cpp

index 078e43f..12cc4dd 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<layout width="237" height="124" style="popup" key_width="75" key_height="116" key_spacing="2" row_spacing="2" hit_left="1" hit_right="1" hit_top="4" hit_bottom="4" label_type="PUNC_POPUP" vibe_style="DEFAULT" sound_style="DEFAULT">
+<layout width="314" height="124" style="popup" key_width="75" key_height="116" key_spacing="2" row_spacing="2" hit_left="1" hit_right="1" hit_top="4" hit_bottom="4" label_type="PUNC_POPUP" vibe_style="DEFAULT" sound_style="DEFAULT">
   <image_path>
     <button_normal>B09_popup_bg.png</button_normal>
   </image_path>
         <rec button="disabled">popup_line/popup_line_center.png</rec>
       </background_image>
     </key>
+    <key key_type="modechange">
+      <key_value>
+        <rec>STT_3X4</rec>
+      </key_value>
+      <image_label>
+        <rec button="normal">icon_mic.png</rec>
+        <rec button="pressed">icon_mic_press.png</rec>
+        <rec button="disabled">icon_mic_dim.png</rec>
+      </image_label>
+      <background_image>
+        <rec button="normal">popup_line/popup_line_center.png</rec>
+        <rec button="disabled">popup_line/popup_line_center.png</rec>
+      </background_image>
+    </key>
     <key key_type="user" hit_right="4">
       <key_value>
         <rec>CLIPBOARD</rec>
index 9bf1d13..7e675d2 100644 (file)
       <landscape>LYT_LANDSCAPE_QTY_SYM_1.xml</landscape>
     </layouts>
   </mode>
-  <mode name="IPv6_3X4_ABC">
-    <layouts>
-      <portrait>LYT_PORTRAIT_3X4_IPv6_ABC.xml</portrait>
-      <landscape>LYT_LANDSCAPE_QTY_SYM_1.xml</landscape>
-    </layouts>
-  </mode>
   <mode name="STT_3X4">
     <layouts>
       <portrait>LYT_PORTRAIT_STT.xml</portrait>
diff --git a/data/pixmaps/default/mobile/icon_mic.png b/data/pixmaps/default/mobile/icon_mic.png
new file mode 100644 (file)
index 0000000..a424d57
Binary files /dev/null and b/data/pixmaps/default/mobile/icon_mic.png differ
diff --git a/data/pixmaps/default/mobile/icon_mic_dim.png b/data/pixmaps/default/mobile/icon_mic_dim.png
new file mode 100644 (file)
index 0000000..b7199cb
Binary files /dev/null and b/data/pixmaps/default/mobile/icon_mic_dim.png differ
diff --git a/data/pixmaps/default/mobile/icon_mic_press.png b/data/pixmaps/default/mobile/icon_mic_press.png
new file mode 100644 (file)
index 0000000..152cdc2
Binary files /dev/null and b/data/pixmaps/default/mobile/icon_mic_press.png differ
index 7b138a8..980fa92 100644 (file)
@@ -141,10 +141,12 @@ static ISELanguageManager _language_manager;
 #define USER_KEYSTRING_OPTION    "OPTION"
 #define USER_KEYSTRING_EMOTICON  "EMOTICON_LAYOUT"
 #define USER_KEYSTRING_CLIPBOARD "CLIPBOARD"
+#define USER_KEYSTRING_VOICE     "STT_3X4"
+
 #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, USER_VOICE_LANGUAGE};
+static const char          *_cm_key_list[CM_KEY_LIST_SIZE] = {USER_KEYSTRING_OPTION, USER_KEYSTRING_EMOTICON, USER_KEYSTRING_CLIPBOARD, USER_KEYSTRING_VOICE};
 static scluint              _current_cm_key_id = 0;
 
 /*
@@ -223,6 +225,12 @@ static void ise_set_cm_private_key(scluint cm_key_id)
             const_cast<sclchar*>("icon_clipboard.png"),
             const_cast<sclchar*>("icon_clipboard.png")};
         g_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_mic.png"),
+            const_cast<sclchar*>("icon_mic_press.png"),
+            const_cast<sclchar*>("icon_mic_dim.png")};
+        g_ui->set_private_key("CM_KEY", const_cast<sclchar*>(""), imagelabel, NULL, 0, const_cast<sclchar*>(USER_KEYSTRING_VOICE), TRUE);
     }
 }
 
@@ -990,7 +998,8 @@ SCLEventReturnType CUIEventCallback::on_event_key_clicked(SclUIEventDesc event_d
                 ret = SCL_EVENT_DONE;
             }
             if (_cm_popup_opened) {
-                if (strcmp(event_desc.key_value, USER_KEYSTRING_EMOTICON) == 0) {
+                if (strcmp(event_desc.key_value, USER_KEYSTRING_EMOTICON) == 0 ||
+                    strcmp(event_desc.key_value, USER_KEYSTRING_VOICE) == 0) {
                     scluint id = ise_get_cm_key_id(event_desc.key_value);
                     if (id != _current_cm_key_id) {
                         _current_cm_key_id = id;
@@ -1036,14 +1045,9 @@ SCLEventReturnType CUIEventCallback::on_event_key_clicked(SclUIEventDesc event_d
                 }
             }
             if (_cm_popup_opened) {
-                if (strcmp(event_desc.key_value, USER_KEYSTRING_OPTION) == 0) {
-                    scluint id = ise_get_cm_key_id(USER_KEYSTRING_OPTION);
-                    if (id != _current_cm_key_id) {
-                        _current_cm_key_id = id;
-                        ise_set_cm_private_key(_current_cm_key_id);
-                    }
-                } else if (strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0) {
-                    scluint id = ise_get_cm_key_id(USER_KEYSTRING_CLIPBOARD);
+                if (strcmp(event_desc.key_value, USER_KEYSTRING_OPTION) == 0 ||
+                    strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0) {
+                    scluint id = ise_get_cm_key_id(event_desc.key_value);
                     if (id != _current_cm_key_id) {
                         _current_cm_key_id = id;
                         ise_set_cm_private_key(_current_cm_key_id);