[NUI] Add AllowTextPrediction/IsTextPredictionAllowed Api (#312)
authorXianbing Teng <xb.teng@samsung.com>
Tue, 3 Jul 2018 08:06:15 +0000 (16:06 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 3 Jul 2018 08:06:15 +0000 (17:06 +0900)
src/Tizen.NUI/src/internal/ManualPINVOKE.cs
src/Tizen.NUI/src/public/InputMethodContext.cs

index 526e02c..e07f4a9 100755 (executable)
@@ -466,6 +466,12 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_InputMethodContext_GetInputPanelLocale")]
         public static extern string InputMethodContext_GetInputPanelLocale(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_InputMethodContext_AllowTextPrediction")]
+        public static extern void InputMethodContext_AllowTextPrediction(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_InputMethodContext_IsTextPredictionAllowed")]
+        public static extern bool InputMethodContext_IsTextPredictionAllowed(global::System.Runtime.InteropServices.HandleRef jarg1);
+
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_InputMethodContext_ActivatedSignal")]
         public static extern global::System.IntPtr InputMethodContext_ActivatedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index 8e59a41..11240ed 100755 (executable)
@@ -821,6 +821,36 @@ namespace Tizen.NUI
             return ret;
         }
 
+        internal void AllowTextPrediction(bool prediction)
+        {
+            NDalicManualPINVOKE.InputMethodContext_AllowTextPrediction(swigCPtr, prediction);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal bool IsTextPredictionAllowed()
+        {
+            bool ret = NDalicManualPINVOKE.InputMethodContext_IsTextPredictionAllowed(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Gets/Sets whether the IM context allow to use the text prediction.
+        /// </summary>
+        /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool TextPrediction
+        {
+            get
+            {
+                return IsTextPredictionAllowed();
+            }
+            set
+            {
+                AllowTextPrediction(value);
+            }
+        }
+
         /// <summary>
         /// InputMethodContext activated event arguments.
         /// </summary>