825e27d5c546197fe8b8ebf711fab29d7e2b4663
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewEnum.cs
1 /*
2  * Copyright(c) 2019-2022 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.ComponentModel;
19
20 namespace Tizen.NUI.BaseComponents
21 {
22     /// <summary>
23     /// The View layout Direction type.
24     /// </summary>
25     /// <since_tizen> 4 </since_tizen>
26     public enum ViewLayoutDirectionType
27     {
28         /// <summary>
29         /// Left to right.
30         /// </summary>
31         /// <since_tizen> 4 </since_tizen>
32         LTR,
33         /// <summary>
34         /// Right to left.
35         /// </summary>
36         /// <since_tizen> 4 </since_tizen>
37         RTL
38     }
39
40     /// <summary>
41     /// Layout policies to decide the size of View when the View is laid out in its parent View.
42     /// LayoutParamPolicies.MatchParent and LayoutParamPolicies.WrapContent can be assigned to <see cref="View.WidthSpecification"/> and <see cref="View.HeightSpecification"/>.
43     /// </summary>
44     /// <example>
45     /// <code>
46     /// // matchParentView matches its size to its parent size.
47     /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
48     /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
49     ///
50     /// // wrapContentView wraps its children with their desired size.
51     /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
52     /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
53     /// </code>
54     /// </example>
55     /// <since_tizen> 9 </since_tizen>
56     public static class LayoutParamPolicies
57     {
58         /// <summary>
59         /// Constant which indicates child size should match parent size.
60         /// </summary>
61         /// <since_tizen> 9 </since_tizen>
62         public const int MatchParent = -1;
63         /// <summary>
64         /// Constant which indicates parent should take the smallest size possible to wrap its children with their desired size.
65         /// </summary>
66         /// <since_tizen> 9 </since_tizen>
67         public const int WrapContent = -2;
68     }
69
70     internal enum ResourceLoadingStatusType
71     {
72         Invalid = -1,
73         Preparing = 0,
74         Ready,
75         Failed,
76     }
77
78     /// <summary>
79     /// View is the base class for all views.
80     /// </summary>
81     /// <since_tizen> 3 </since_tizen>
82     public partial class View
83     {
84         /// <summary>
85         /// Enumeration for describing the states of the view.
86         /// </summary>
87         /// <since_tizen> 3 </since_tizen>
88         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
89         public enum States
90         {
91             /// <summary>
92             /// The normal state.
93             /// </summary>
94             [Description("NORMAL")]
95             Normal,
96             /// <summary>
97             /// The focused state.
98             /// </summary>
99             [Description("FOCUSED")]
100             Focused,
101             /// <summary>
102             /// The disabled state.
103             /// </summary>
104             [Description("DISABLED")]
105             Disabled
106         }
107
108         /// <summary>
109         /// Describes the direction to move the focus towards.
110         /// </summary>
111         /// <since_tizen> 3 </since_tizen>
112         public enum FocusDirection
113         {
114             /// <summary>
115             /// Move keyboard focus towards the left direction.
116             /// </summary>
117             /// <since_tizen> 3 </since_tizen>
118             Left,
119             /// <summary>
120             /// Move keyboard focus towards the right direction.
121             /// </summary>
122             /// <since_tizen> 3 </since_tizen>
123             Right,
124             /// <summary>
125             /// Move keyboard focus towards the up direction.
126             /// </summary>
127             /// <since_tizen> 3 </since_tizen>
128             Up,
129             /// <summary>
130             /// Move keyboard focus towards the down direction.
131             /// </summary>
132             /// <since_tizen> 3 </since_tizen>
133             Down,
134             /// <summary>
135             /// Move keyboard focus towards the previous page direction.
136             /// </summary>
137             /// <since_tizen> 3 </since_tizen>
138             PageUp,
139             /// <summary>
140             /// Move keyboard focus towards the next page direction.
141             /// </summary>
142             /// <since_tizen> 3 </since_tizen>
143             PageDown,
144             /// <summary>
145             /// Move keyboard focus towards the forward direction.
146             /// </summary>
147             [EditorBrowsable(EditorBrowsableState.Never)]
148             Forward,
149             /// <summary>
150             /// Move keyboard focus towards the backward direction.
151             /// </summary>
152             [EditorBrowsable(EditorBrowsableState.Never)]
153             Backward,
154             /// <summary>
155             /// Move focus towards the Clockwise direction by rotary wheel.
156             /// </summary>
157             [EditorBrowsable(EditorBrowsableState.Never)]
158             Clockwise,
159             /// <summary>
160             /// Move focus towards the CounterClockwise direction by rotary wheel.
161             /// </summary>
162             [EditorBrowsable(EditorBrowsableState.Never)]
163             CounterClockwise,
164         }
165
166         /// <summary>
167         /// Actions property value to update visual property.
168         /// Note : Only few kind of properies can be update. Update with invalid property action is undefined.
169         /// This property can be redefined by child class if it use different value.
170         /// </summary>
171         [EditorBrowsable(EditorBrowsableState.Never)]
172         protected int ActionUpdateProperty { get; set; } = Interop.Visual.GetActionUpdateProperty();
173
174         internal enum PropertyRange
175         {
176             PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
177             CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
178             CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000
179         }
180
181         internal class Property
182         {
183             internal static readonly int TOOLTIP = Interop.ViewProperty.TooltipGet();
184             internal static readonly int STATE = Interop.ViewProperty.StateGet();
185             internal static readonly int SubState = Interop.ViewProperty.SubStateGet();
186             internal static readonly int LeftFocusableViewId = Interop.ViewProperty.LeftFocusableActorIdGet();
187             internal static readonly int RightFocusableViewId = Interop.ViewProperty.RightFocusableActorIdGet();
188             internal static readonly int UpFocusableViewId = Interop.ViewProperty.UpFocusableActorIdGet();
189             internal static readonly int DownFocusableViewId = Interop.ViewProperty.DownFocusableActorIdGet();
190             internal static readonly int ClockwiseFocusableViewId = Interop.ViewProperty.ClockwiseFocusableActorIdGet();
191             internal static readonly int CounterClockwiseFocusableViewId = Interop.ViewProperty.CounterClockwiseFocusableActorIdGet();
192             internal static readonly int StyleName = Interop.ViewProperty.StyleNameGet();
193             internal static readonly int KeyInputFocus = Interop.ViewProperty.KeyInputFocusGet();
194             internal static readonly int BACKGROUND = Interop.ViewProperty.BackgroundGet();
195             internal static readonly int SiblingOrder = Interop.ActorProperty.SiblingOrderGet();
196             internal static readonly int OPACITY = Interop.ActorProperty.OpacityGet();
197             internal static readonly int ScreenPosition = Interop.ActorProperty.ScreenPositionGet();
198             internal static readonly int PositionUsesAnchorPoint = Interop.ActorProperty.PositionUsesAnchorPointGet();
199             internal static readonly int ParentOrigin = Interop.ActorProperty.ParentOriginGet();
200             internal static readonly int ParentOriginX = Interop.ActorProperty.ParentOriginXGet();
201             internal static readonly int ParentOriginY = Interop.ActorProperty.ParentOriginYGet();
202             internal static readonly int ParentOriginZ = Interop.ActorProperty.ParentOriginZGet();
203             internal static readonly int AnchorPoint = Interop.ActorProperty.AnchorPointGet();
204             internal static readonly int AnchorPointX = Interop.ActorProperty.AnchorPointXGet();
205             internal static readonly int AnchorPointY = Interop.ActorProperty.AnchorPointYGet();
206             internal static readonly int AnchorPointZ = Interop.ActorProperty.AnchorPointZGet();
207             internal static readonly int SIZE = Interop.ActorProperty.SizeGet();
208             internal static readonly int SizeWidth = Interop.ActorProperty.SizeWidthGet();
209             internal static readonly int SizeHeight = Interop.ActorProperty.SizeHeightGet();
210             internal static readonly int SizeDepth = Interop.ActorProperty.SizeDepthGet();
211             internal static readonly int POSITION = Interop.ActorProperty.PositionGet();
212             internal static readonly int PositionX = Interop.ActorProperty.PositionXGet();
213             internal static readonly int PositionY = Interop.ActorProperty.PositionYGet();
214             internal static readonly int PositionZ = Interop.ActorProperty.PositionZGet();
215             internal static readonly int WorldPosition = Interop.ActorProperty.WorldPositionGet();
216             internal static readonly int WorldPositionX = Interop.ActorProperty.WorldPositionXGet();
217             internal static readonly int WorldPositionY = Interop.ActorProperty.WorldPositionYGet();
218             internal static readonly int WorldPositionZ = Interop.ActorProperty.WorldPositionZGet();
219             internal static readonly int ORIENTATION = Interop.ActorProperty.OrientationGet();
220             internal static readonly int WorldOrientation = Interop.ActorProperty.WorldOrientationGet();
221             internal static readonly int SCALE = Interop.ActorProperty.ScaleGet();
222             internal static readonly int ScaleX = Interop.ActorProperty.ScaleXGet();
223             internal static readonly int ScaleY = Interop.ActorProperty.ScaleYGet();
224             internal static readonly int ScaleZ = Interop.ActorProperty.ScaleZGet();
225             internal static readonly int WorldScale = Interop.ActorProperty.WorldScaleGet();
226             internal static readonly int VISIBLE = Interop.ActorProperty.VisibleGet();
227             internal static readonly int COLOR = Interop.ActorProperty.ColorGet();
228             internal static readonly int ColorRed = Interop.ActorProperty.ColorRedGet();
229             internal static readonly int ColorGreen = Interop.ActorProperty.ColorGreenGet();
230             internal static readonly int ColorBlue = Interop.ActorProperty.ColorBlueGet();
231             internal static readonly int WorldColor = Interop.ActorProperty.WorldColorGet();
232             internal static readonly int WorldMatrix = Interop.ActorProperty.WorldMatrixGet();
233             internal static readonly int NAME = Interop.ActorProperty.NameGet();
234             internal static readonly int SENSITIVE = Interop.ActorProperty.SensitiveGet();
235             internal static readonly int UserInteractionEnabled = Interop.ActorProperty.UserInteractionEnabledGet();
236             internal static readonly int LeaveRequired = Interop.ActorProperty.LeaveRequiredGet();
237             internal static readonly int InheritOrientation = Interop.ActorProperty.InheritOrientationGet();
238             internal static readonly int InheritScale = Interop.ActorProperty.InheritScaleGet();
239             internal static readonly int DrawMode = Interop.ActorProperty.DrawModeGet();
240             internal static readonly int SizeModeFactor = Interop.ActorProperty.SizeModeFactorGet();
241             internal static readonly int WidthResizePolicy = Interop.ActorProperty.WidthResizePolicyGet();
242             internal static readonly int HeightResizePolicy = Interop.ActorProperty.HeightResizePolicyGet();
243             internal static readonly int SizeScalePolicy = Interop.ActorProperty.SizeScalePolicyGet();
244             internal static readonly int WidthForHeight = Interop.ActorProperty.WidthForHeightGet();
245             internal static readonly int HeightForWidth = Interop.ActorProperty.HeightForWidthGet();
246             internal static readonly int MinimumSize = Interop.ActorProperty.MinimumSizeGet();
247             internal static readonly int MaximumSize = Interop.ActorProperty.MaximumSizeGet();
248             internal static readonly int InheritPosition = Interop.ActorProperty.InheritPositionGet();
249             internal static readonly int ClippingMode = Interop.ActorProperty.ClippingModeGet();
250             internal static readonly int InheritLayoutDirection = Interop.ActorProperty.InheritLayoutDirectionGet();
251             internal static readonly int LayoutDirection = Interop.ActorProperty.LayoutDirectionGet();
252             internal static readonly int MARGIN = Interop.ViewProperty.MarginGet();
253             internal static readonly int PADDING = Interop.ViewProperty.PaddingGet();
254             internal static readonly int SHADOW = Interop.ViewProperty.ShadowGet();
255             internal static readonly int CaptureAllTouchAfterStart = Interop.ActorProperty.CaptureAllTouchAfterStartGet();
256             internal static readonly int AllowOnlyOwnTouch = Interop.ActorProperty.AllowOnlyOwnTouchGet();
257             internal static readonly int BlendEquation = Interop.ActorProperty.BlendEquationGet();
258             internal static readonly int Culled = Interop.ActorProperty.CulledGet();
259             internal static readonly int AccessibilityName = Interop.ViewProperty.AccessibilityNameGet();
260             internal static readonly int AccessibilityDescription = Interop.ViewProperty.AccessibilityDescriptionGet();
261             internal static readonly int AccessibilityTranslationDomain = Interop.ViewProperty.AccessibilityTranslationDomainGet();
262             internal static readonly int AccessibilityRole = Interop.ViewProperty.AccessibilityRoleGet();
263             internal static readonly int AccessibilityHighlightable = Interop.ViewProperty.AccessibilityHighlightableGet();
264             internal static readonly int AccessibilityAttributes = Interop.ViewProperty.AccessibilityAttributesGet();
265             internal static readonly int DispatchKeyEvents = Interop.ViewProperty.DispatchKeyEventsGet();
266             internal static readonly int AccessibilityHidden = Interop.ViewProperty.AccessibilityHiddenGet();
267             internal static readonly int AutomationId = Interop.ViewProperty.AutomationIdGet();
268             internal static readonly int UpdateAreaHint = Interop.ActorProperty.UpdateAreaHintGet();
269         }
270     }
271 }