[NUI] Add KeyString in Key.cs (#936)
authorSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Wed, 24 Jul 2019 03:19:37 +0000 (12:19 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 24 Jul 2019 03:19:37 +0000 (12:19 +0900)
* [NUI] Add KeyString in Key.cs

- Provide to use 'KeyString' for a clearer meaning instead of 'KeyPressed'

Change-Id: I5aa3680b81cc62d6718aa0f21a08bc7c74b8826b
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
* Update Key.cs

- Add set property to KeyString.

src/Tizen.NUI/src/internal/Interop/Interop.Key.cs
src/Tizen.NUI/src/public/Key.cs

index 2f421c3..a80f7c9 100755 (executable)
@@ -58,6 +58,15 @@ namespace Tizen.NUI
             public static extern string Key_keyPressed_get(global::System.Runtime.InteropServices.HandleRef jarg1);
 
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Key_keyPressed_set")]
+            public static extern void Key_keyString_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Key_keyPressed_get")]
+            public static extern string Key_keyString_get(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Key_keyCode_set")]
             public static extern void Key_keyCode_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
 
index b7744b6..7a3e362 100755 (executable)
@@ -167,6 +167,24 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Get the actual string returned that should be used for input editors.
+        /// </summary>
+        /// <returns>The key string</returns>
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string KeyString
+        {
+            get
+            {
+                return keyString;
+            }
+            set
+            {
+                keyString = value;
+            }
+        }
+
+        /// <summary>
         /// Keycode for the key pressed.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
@@ -288,6 +306,21 @@ namespace Tizen.NUI
             }
         }
 
+        private string keyString
+        {
+            set
+            {
+                Interop.Key.Key_keyString_set(swigCPtr, value);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+            get
+            {
+                string ret = Interop.Key.Key_keyString_get(swigCPtr);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
+        }
+
         private int keyCode
         {
             set