[NUI] Add IsUsingXaml flag in properties of View and AnimatedVectorImageView
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewAccessibilityProperties.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI;
22
23 namespace Tizen.NUI.BaseComponents
24 {
25     /// <summary>
26     /// View is the base class for all views.
27     /// </summary>
28     /// <since_tizen> 3 </since_tizen>
29     public partial class View
30     {
31         /// <summary>
32         /// Gets or sets accessibility name.
33         /// </summary>
34         [EditorBrowsable(EditorBrowsableState.Never)]
35         public string AccessibilityName
36         {
37             get
38             {
39                 if (NUIApplication.IsUsingXaml)
40                 {
41                     return (string)GetValue(AccessibilityNameProperty);
42                 }
43                 else
44                 {
45                     return (string)GetInternalAccessibilityNameProperty(this);
46                 }
47             }
48             set
49             {
50                 if (NUIApplication.IsUsingXaml)
51                 {
52                     SetValue(AccessibilityNameProperty, value);
53                 }
54                 else
55                 {
56                     SetInternalAccessibilityNameProperty(this, null, value);
57                 }
58                 NotifyPropertyChanged();
59             }
60         }
61
62         /// <summary>
63         /// Gets or sets accessibility description.
64         /// </summary>
65         [EditorBrowsable(EditorBrowsableState.Never)]
66         public string AccessibilityDescription
67         {
68             get
69             {
70                 if (NUIApplication.IsUsingXaml)
71                 {
72                     return (string)GetValue(AccessibilityDescriptionProperty);
73                 }
74                 else
75                 {
76                     return (string)GetInternalAccessibilityDescriptionProperty(this);
77                 }
78             }
79             set
80             {
81                 if (NUIApplication.IsUsingXaml)
82                 {
83                     SetValue(AccessibilityDescriptionProperty, value);
84                 }
85                 else
86                 {
87                     SetInternalAccessibilityDescriptionProperty(this, null, value);
88                 }
89                 NotifyPropertyChanged();
90             }
91         }
92
93         /// <summary>
94         /// Gets or sets accessibility translation domain.
95         /// </summary>
96         [EditorBrowsable(EditorBrowsableState.Never)]
97         public string AccessibilityTranslationDomain
98         {
99             get
100             {
101                 if (NUIApplication.IsUsingXaml)
102                 {
103                     return (string)GetValue(AccessibilityTranslationDomainProperty);
104                 }
105                 else
106                 {
107                     return (string)GetInternalAccessibilityTranslationDomainProperty(this);
108                 }
109             }
110             set
111             {
112                 if (NUIApplication.IsUsingXaml)
113                 {
114                     SetValue(AccessibilityTranslationDomainProperty, value);
115                 }
116                 else
117                 {
118                     SetInternalAccessibilityTranslationDomainProperty(this, null, value);
119                 }
120                 NotifyPropertyChanged();
121             }
122         }
123
124         /// <summary>
125         /// Gets or sets accessibility role.
126         /// </summary>
127         [EditorBrowsable(EditorBrowsableState.Never)]
128         public Role AccessibilityRole
129         {
130             get
131             {
132                 if (NUIApplication.IsUsingXaml)
133                 {
134                     return (Role)GetValue(AccessibilityRoleProperty);
135                 }
136                 else
137                 {
138                     return (Role)GetInternalAccessibilityRoleProperty(this);
139                 }
140             }
141             set
142             {
143                 if (NUIApplication.IsUsingXaml)
144                 {
145                     SetValue(AccessibilityRoleProperty, value);
146                 }
147                 else
148                 {
149                     SetInternalAccessibilityRoleProperty(this, null, value);
150                 }
151                 NotifyPropertyChanged();
152             }
153         }
154
155         /// <summary>
156         /// Gets or sets whether the view is highlightable for accessibility or not.
157         /// </summary>
158         /// <remarks>
159         /// For views, which intend to receive accessibility highlight focus, this value should  be set as true.
160         /// Otherwise it is set to false by default and the object is omitted in AT-SPI2 navigation.
161         /// </remarks>
162         [EditorBrowsable(EditorBrowsableState.Never)]
163         public bool AccessibilityHighlightable
164         {
165             get
166             {
167                 if (NUIApplication.IsUsingXaml)
168                 {
169                     return (bool)GetValue(AccessibilityHighlightableProperty);
170                 }
171                 else
172                 {
173                     return (bool)GetInternalAccessibilityHighlightableProperty(this);
174                 }
175             }
176             set
177             {
178                 if (NUIApplication.IsUsingXaml)
179                 {
180                     SetValue(AccessibilityHighlightableProperty, value);
181                 }
182                 else
183                 {
184                     SetInternalAccessibilityHighlightableProperty(this, null, value);
185                 }
186                 NotifyPropertyChanged();
187             }
188         }
189
190         /// <summary>
191         /// Controls whether the view is hidden from the AT-SPI tree.
192         /// </summary>
193         /// <remarks>
194         /// False by default. Hiding an object means that any AT-SPI clients are not able to see it.
195         /// </remarks>
196         [EditorBrowsable(EditorBrowsableState.Never)]
197         public bool AccessibilityHidden
198         {
199             get
200             {
201                 if (NUIApplication.IsUsingXaml)
202                 {
203                     return (bool)GetValue(AccessibilityHiddenProperty);
204                 }
205                 else
206                 {
207                     return (bool)GetInternalAccessibilityHiddenProperty(this);
208                 }
209             }
210             set
211             {
212                 if (NUIApplication.IsUsingXaml)
213                 {
214                     SetValue(AccessibilityHiddenProperty, value);
215                 }
216                 else
217                 {
218                     SetInternalAccessibilityHiddenProperty(this, null, value);
219                 }
220                 NotifyPropertyChanged();
221             }
222         }
223
224         /// <summary>
225         /// Gets or sets a value that allows the automation framework to find and interact with this element.
226         /// </summary>
227         [EditorBrowsable(EditorBrowsableState.Never)]
228         public new string AutomationId
229         {
230             get
231             {
232                 if (NUIApplication.IsUsingXaml)
233                 {
234                     return GetValue(AutomationIdProperty) as string;
235                 }
236                 else
237                 {
238                     return GetInternalAutomationIdProperty(this) as string;
239                 }
240             }
241             set
242             {
243                 if (NUIApplication.IsUsingXaml)
244                 {
245                     SetValue(AutomationIdProperty, value);
246                 }
247                 else
248                 {
249                     SetInternalAutomationIdProperty(this, null, value);
250                 }
251                 NotifyPropertyChanged();
252             }
253         }
254     }
255 }