[DllImport(NDalicPINVOKE.Lib, EntryPoint = "csharp_dali_accessibility_IsEnabled")]
[return: MarshalAs(UnmanagedType.U1)]
public static extern bool IsEnabled();
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void EnabledDisabledSignalHandler();
+
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "csharp_dali_accessibility_RegisterEnabledDisabledSignalHandler")]
+ public static extern void RegisterEnabledDisabledSignalHandler(EnabledDisabledSignalHandler enabledSignalHandler, EnabledDisabledSignalHandler disabledSignalHandler);
}
}
}
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);
+ }
+
/// <summary>
/// destructor. This is HiddenAPI. recommended not to use in public.
/// </summary>
~Accessibility()
{
+ Interop.Accessibility.RegisterEnabledDisabledSignalHandler(null, null);
+
Tizen.Log.Debug("NUI", $"Accessibility is destroyed\n");
}
#endregion Constructor, Destructor, Dispose
add => sayFinishedEventHandler += value;
remove => sayFinishedEventHandler -= value;
}
+
+ /// <summary>
+ /// Triggered whenever the value of IsEnabled would change from false to true
+ /// </summary>
+ // 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;
+
+ /// <summary>
+ /// Triggered whenever the value of IsEnabled would change from true to false
+ /// </summary>
+ // 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
private SayFinishedEventCallbackType callback = null;
+ private static Interop.Accessibility.EnabledDisabledSignalHandler enabledSignalHandler = null;
+
+ private static Interop.Accessibility.EnabledDisabledSignalHandler disabledSignalHandler = null;
+
private void SayFinishedEventCallback(int result)
{
NUILog.Debug($"sayFinishedEventCallback(res={result}) called!");