[NUI] Add EnableDefaultAlgorithm and IsDefaultAlgorithmEnabled
authorJoogab Yun <joogab.yun@samsung.com>
Mon, 19 Jul 2021 01:22:47 +0000 (10:22 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 19 Jul 2021 09:01:03 +0000 (18:01 +0900)
src/Tizen.NUI/src/internal/Interop/Interop.FocusManager.cs
src/Tizen.NUI/src/public/Input/FocusManager.cs

index a0e9f73..ec9c4ab 100755 (executable)
@@ -82,6 +82,13 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_KeyboardFocusManager_FocusedActorEnterKeySignal")]
             public static extern global::System.IntPtr FocusedActorEnterKeySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_KeyboardFocusManager_EnableDefaultAlgorithm")]
+            public static extern void EnableDefaultAlgorithm(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_KeyboardFocusManager_IsDefaultAlgorithmEnabled")]
+            [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+            public static extern bool IsDefaultAlgorithmEnabled(global::System.Runtime.InteropServices.HandleRef jarg1);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_KeyboardFocusManager_SWIGUpcast")]
             public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1);
         }
index cfd59ec..016b311 100755 (executable)
@@ -410,6 +410,30 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        /// Sets to use the automatic focus moveing algorithm. <br />
+        /// It moves the focus to the view closest to the keyboard movement direction.
+        /// </summary>
+        /// <param name="enable">Whether using default focus algorithm or not</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void EnableDefaultAlgorithm(bool enable)
+        {
+            Interop.FocusManager.EnableDefaultAlgorithm(SwigCPtr, enable);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        ///  Checks default focus moveing algorithm is enabled or not
+        /// </summary>
+        /// <returns>Whether default focus algorithm is enabled</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsDefaultAlgorithmEnabled()
+        {
+            bool ret = Interop.FocusManager.IsDefaultAlgorithmEnabled(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         internal static FocusManager Get()
         {
             FocusManager ret = new FocusManager(Interop.FocusManager.Get(), true);