X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FAccessibility%2FAccessibility.cs;h=054cc9ba6a46ba3803202c65436b94acfc655193;hb=8a56e0255e65d42cea7a93cc755a6dc6ec6d7e42;hp=7bccb4c11dfabc41b6cc20c5b59d7cedb464b3fb;hpb=66c5e221f79599f27c0b01097215ea18e0b6c485;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git
diff --git a/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs b/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs
index 7bccb4c..054cc9b 100755
--- a/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs
+++ b/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs
@@ -20,9 +20,6 @@ using System.ComponentModel;
using System.Runtime.InteropServices;
using Tizen.NUI.BaseComponents;
using System.Diagnostics.CodeAnalysis;
-#if (NUI_DEBUG_ON)
-using tlog = Tizen.Log;
-#endif
namespace Tizen.NUI.Accessibility
{
@@ -41,11 +38,29 @@ namespace Tizen.NUI.Accessibility
dummy = new View();
dummy.Name = "dali-atspi-singleton";
}
+
+ static Accessibility()
+ {
+ enabledSignalHandler = () =>
+ {
+ Enabled?.Invoke(typeof(Accessibility), EventArgs.Empty);
+ };
+
+ disabledSignalHandler = () =>
+ {
+ Disabled?.Invoke(typeof(Accessibility), EventArgs.Empty);
+ };
+
+ Interop.Accessibility.RegisterEnabledDisabledSignalHandler(enabledSignalHandler, disabledSignalHandler);
+ }
+
///
/// destructor. This is HiddenAPI. recommended not to use in public.
///
~Accessibility()
{
+ Interop.Accessibility.RegisterEnabledDisabledSignalHandler(null, null);
+
Tizen.Log.Debug("NUI", $"Accessibility is destroyed\n");
}
#endregion Constructor, Destructor, Dispose
@@ -61,6 +76,23 @@ namespace Tizen.NUI.Accessibility
{
get => accessibility;
}
+
+ ///
+ /// Flag to check whether the state of Accessibility is enabled or not.
+ ///
+ ///
+ /// Getter returns true if Accessibility is enabled, false otherwise.
+ ///
+ /// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static bool IsEnabled
+ {
+ get
+ {
+ return (bool)Interop.Accessibility.IsEnabled();
+ }
+ }
+
#endregion Property
@@ -122,6 +154,46 @@ namespace Tizen.NUI.Accessibility
}
///
+ /// Suppress reading of screen-reader
+ ///
+ /// whether to suppress reading of screen-reader
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool SuppressScreenReader(bool suppress)
+ {
+ bool ret = Interop.Accessibility.SuppressScreenReader(View.getCPtr(dummy), suppress);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ ///
+ /// Re-enables auto-initialization of AT-SPI bridge
+ ///
+ ///
+ /// Normal applications do not have to call this function. The AT-SPI bridge is initialized on demand.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void BridgeEnableAutoInit()
+ {
+ Interop.Accessibility.BridgeEnableAutoInit();
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ ///
+ /// Blocks auto-initialization of AT-SPI bridge
+ ///
+ ///
+ /// Use this only if your application starts before DBus does, and call it early in Main().
+ /// When DBus is ready, call BridgeEnableAutoInit().
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void BridgeDisableAutoInit()
+ {
+ Interop.Accessibility.BridgeDisableAutoInit();
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ ///
/// Get View that is used to highlight widget.
///
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
@@ -154,10 +226,10 @@ namespace Tizen.NUI.Accessibility
public View GetCurrentlyHighlightedView()
{
var ptr = Interop.ControlDevel.DaliAccessibilityAccessibleGetCurrentlyHighlightedActor();
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- if (ptr == IntPtr.Zero)
- return null;
- return new View(ptr, true);
+
+ return this.GetInstanceSafely(ptr);
}
///
@@ -167,10 +239,9 @@ namespace Tizen.NUI.Accessibility
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ClearCurrentlyHighlightedView()
{
- using (View view = GetCurrentlyHighlightedView())
- {
- return view?.ClearAccessibilityHighlight() ?? false;
- }
+ var view = GetCurrentlyHighlightedView();
+
+ return view?.ClearAccessibilityHighlight() ?? false;
}
#endregion Method
@@ -231,6 +302,21 @@ namespace Tizen.NUI.Accessibility
add => sayFinishedEventHandler += value;
remove => sayFinishedEventHandler -= value;
}
+
+ ///
+ /// Triggered whenever the value of IsEnabled would change from false to true
+ ///
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static event EventHandler Enabled;
+
+ ///
+ /// Triggered whenever the value of IsEnabled would change from true to false
+ ///
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static event EventHandler Disabled;
+
#endregion Event, Enum, Struct, ETC
@@ -266,15 +352,18 @@ namespace Tizen.NUI.Accessibility
private SayFinishedEventCallbackType callback = null;
+ private static Interop.Accessibility.EnabledDisabledSignalHandler enabledSignalHandler = null;
+
+ private static Interop.Accessibility.EnabledDisabledSignalHandler disabledSignalHandler = null;
+
private void SayFinishedEventCallback(int result)
{
- tlog.Fatal(tag, $"sayFinishedEventCallback(res={result}) called!");
+ NUILog.Debug($"sayFinishedEventCallback(res={result}) called!");
sayFinishedEventHandler?.Invoke(this, new SayFinishedEventArgs(result));
}
private View dummy;
- private static string tag = "NUITEST";
#endregion Private
}
@@ -299,7 +388,7 @@ namespace Tizen.NUI.Accessibility
internal SayFinishedEventArgs(int result)
{
State = (Accessibility.SayFinishedState)(result);
- tlog.Fatal("NUITEST", $"SayFinishedEventArgs Constructor! State={State}");
+ NUILog.Debug($"SayFinishedEventArgs Constructor! State={State}");
}
}
}