[NUI] Add some APIs to make Accessibility enabled / disabled (#2296)
authorSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Fri, 27 Nov 2020 01:31:16 +0000 (10:31 +0900)
committerGitHub <noreply@github.com>
Fri, 27 Nov 2020 01:31:16 +0000 (10:31 +0900)
- Added EnableAccessibility and IsEnabled to AccessibilityManager

Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.AccessibilityManager.cs
src/Tizen.NUI/src/public/Accessibility/AccessibilityManager.cs

index 409f728..70db3b1 100755 (executable)
@@ -89,6 +89,12 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetReadPosition")]
             public static extern global::System.IntPtr AccessibilityManager_GetReadPosition(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_EnableAccessibility")]
+            public static extern void EnableAccessibility(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_IsEnabled")]
+            public static extern bool IsEnabled(global::System.Runtime.InteropServices.HandleRef jarg1);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_FocusChangedSignal")]
             public static extern global::System.IntPtr AccessibilityManager_FocusChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index 1d1fc14..43bef18 100755 (executable)
@@ -832,6 +832,32 @@ namespace Tizen.NUI.Accessibility
             return ret;
         }
 
+        /// <summary>
+        /// Enables Accessibility or not.
+        /// </summary>
+        /// <param name="enabled"> True if Accessibility should be enabled.</param>
+        /// This will be public opened later. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void EnableAccessibility(bool enabled)
+        {
+            Interop.AccessibilityManager.EnableAccessibility(swigCPtr, enabled);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Queries whether the accessibility(screen-reader) is enabled.
+        /// Basically, the accessibility will be enabled by system setting.
+        /// </summary>
+        /// <returns> True if the accessibility(screen-reader) is enabled. </returns>
+        /// This will be public opened later. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsEnabled()
+        {
+            bool ret = Interop.AccessibilityManager.IsEnabled(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         internal static AccessibilityManager Get()
         {
             AccessibilityManager ret = new AccessibilityManager(Interop.AccessibilityManager.AccessibilityManager_Get(), true);