From: Bartlomiej Grzelewski Date: Tue, 30 Mar 2021 11:51:23 +0000 (+0200) Subject: [NUI][AT-SPI] Simplify ReadingInfoTypes X-Git-Tag: submit/tizen/20210420.162238~1^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52602d5792a081d0696c6bc1052edf51e2651115;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI][AT-SPI] Simplify ReadingInfoTypes Replace ReadingInfoTypes with AccessibiltyReadingInfoType flag. --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs index 62cf13e6d..a35a562d3 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs @@ -104,28 +104,12 @@ namespace Tizen.NUI public static extern void DaliToolkitDevelControlClearAccessibilityAttributes(global::System.Runtime.InteropServices.HandleRef arg1); [EditorBrowsable(EditorBrowsableState.Never)] - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_SetAccessibilityReadingInfoType")] - public static extern void DaliToolkitDevelControlSetAccessibilityReadingInfoType(global::System.Runtime.InteropServices.HandleRef arg1, Tizen.NUI.BaseComponents.ReadingInfoTypes arg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_SetAccessibilityReadingInfoType2")] + public static extern void DaliToolkitDevelControlSetAccessibilityReadingInfoTypes(global::System.Runtime.InteropServices.HandleRef arg1, int arg2); [EditorBrowsable(EditorBrowsableState.Never)] - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_new_ReadingInfoType")] - public static extern global::System.IntPtr DaliToolkitDevelControlNewReadingInfoType(); - - [EditorBrowsable(EditorBrowsableState.Never)] - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_new_GetAccessibilityReadingInfoType")] - public static extern global::System.IntPtr DaliToolkitDevelControlNewGetAccessibilityReadingInfoType(global::System.Runtime.InteropServices.HandleRef arg1); - - [EditorBrowsable(EditorBrowsableState.Never)] - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_delete_ReadingInfoType")] - public static extern void DaliToolkitDevelControlDeleteReadingInfoType(IntPtr arg1); - - [EditorBrowsable(EditorBrowsableState.Never)] - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_ReadingInfoTypes_Get")] - public static extern bool DaliToolkitDevelControlReadingInfoTypesGet(Tizen.NUI.BaseComponents.ReadingInfoTypes arg1, int arg2); - - [EditorBrowsable(EditorBrowsableState.Never)] - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_ReadingInfoTypes_Set")] - public static extern void DaliToolkitDevelControlReadingInfoTypesSet(Tizen.NUI.BaseComponents.ReadingInfoTypes arg1, int arg2, int arg3); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_GetAccessibilityReadingInfoType2")] + public static extern int DaliToolkitDevelControlGetAccessibilityReadingInfoTypes(global::System.Runtime.InteropServices.HandleRef arg1); [EditorBrowsable(EditorBrowsableState.Never)] [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Toolkit_DevelControl_ClearAccessibilityHighlight")] diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs index e0c244023..12967c4e5 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs @@ -81,52 +81,6 @@ namespace Tizen.NUI.BaseComponents } } - [EditorBrowsable(EditorBrowsableState.Never)] - public partial class ReadingInfoTypes : SafeHandle - { - [EditorBrowsable(EditorBrowsableState.Never)] - public ReadingInfoTypes() : base(IntPtr.Zero, true) - { - var obj = Interop.ControlDevel.DaliToolkitDevelControlNewReadingInfoType(); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - this.SetHandle(obj); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public ReadingInfoTypes(IntPtr ptr) : base(ptr, true) { } - - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool IsInvalid { get { return this.handle == IntPtr.Zero; } } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void Set(ReadingInfoType type, bool v) - { - Interop.ControlDevel.DaliToolkitDevelControlReadingInfoTypesSet(this, (int)type, Convert.ToInt32(v)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Get(ReadingInfoType type) - { - bool result = Interop.ControlDevel.DaliToolkitDevelControlReadingInfoTypesGet(this, (int)type); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return result; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - protected override bool ReleaseHandle() - { - Interop.ControlDevel.DaliToolkitDevelControlDeleteReadingInfoType(handle); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - this.SetHandle(IntPtr.Zero); - return true; - } - } - [EditorBrowsable(EditorBrowsableState.Never)] public partial class AccessibilityStates : SafeHandle { @@ -261,6 +215,9 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public void RemoveAccessibilityRelation(View second, RelationType relation) { + if (second is null) + throw new ArgumentNullException(nameof(second)); + Interop.ControlDevel.DaliToolkitDevelControlRemoveAccessibilityRelation(SwigCPtr, second.SwigCPtr, (int)relation); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -283,18 +240,22 @@ namespace Tizen.NUI.BaseComponents return result; } + /////////////////////////////////////////////////////////////////// + // ********************* ReadingInfoType *********************** // + /////////////////////////////////////////////////////////////////// + [EditorBrowsable(EditorBrowsableState.Never)] - public void SetAccessibilityReadingInfoType(ReadingInfoTypes types) + public void SetAccessibilityReadingInfoTypes(AccessibilityReadingInfoTypes info) { - Interop.ControlDevel.DaliToolkitDevelControlSetAccessibilityReadingInfoType(SwigCPtr, types); + Interop.ControlDevel.DaliToolkitDevelControlSetAccessibilityReadingInfoTypes(SwigCPtr, (int)info); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } [EditorBrowsable(EditorBrowsableState.Never)] - public ReadingInfoTypes GetAccessibilityReadingInfoType() + public AccessibilityReadingInfoTypes GetAccessibilityReadingInfoTypes() { - var result = new ReadingInfoTypes(Interop.ControlDevel.DaliToolkitDevelControlNewGetAccessibilityReadingInfoType(SwigCPtr)); + AccessibilityReadingInfoTypes result = (AccessibilityReadingInfoTypes)Interop.ControlDevel.DaliToolkitDevelControlGetAccessibilityReadingInfoTypes(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return result; diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEnum.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEnum.cs index b409ee039..d580af36a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEnum.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEnum.cs @@ -22,17 +22,16 @@ using Tizen.NUI; namespace Tizen.NUI.BaseComponents { - public partial class ReadingInfoTypes + [EditorBrowsable(EditorBrowsableState.Never)] + [Flags] + public enum AccessibilityReadingInfoTypes : int { - [EditorBrowsable(EditorBrowsableState.Never)] - public enum ReadingInfoType - { - Name = 0, - Role, - Description, - State - }; - } + None = 0, + Name = 1, + Role = 2, + Description = 4, + State = 8 + }; [EditorBrowsable(EditorBrowsableState.Never)] public enum AccessibilityGesture