[NUI][AT-SPI] Simplify ReadingInfoTypes
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Tue, 30 Mar 2021 11:51:23 +0000 (13:51 +0200)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Tue, 20 Apr 2021 06:13:00 +0000 (15:13 +0900)
Replace ReadingInfoTypes with AccessibiltyReadingInfoType flag.

src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs
src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs
src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEnum.cs

index 62cf13e6d753826c4545cfc44642865ff192c9fa..a35a562d39f62c0809f41c9e101c7aef64295a89 100755 (executable)
@@ -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")]
index e0c24402386797da66cef56e183b2df0580c7420..12967c4e50c2f56515405b76e98e392a203aa9fe 100755 (executable)
@@ -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;
index b409ee0398955500141085d907b60cd783358818..d580af36a61e3ee7bdda480327e27c08195f9e21 100755 (executable)
@@ -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