2 * Copyright(c) 2022 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
23 namespace Tizen.NUI.BaseComponents
26 /// View is the base class for all views.
28 /// <since_tizen> 3 </since_tizen>
29 public partial class View : Container, IResourcesProvider
31 private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
32 private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
33 private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
34 private static bool defaultGrabTouchAfterLeave = false;
35 private static bool defaultAllowOnlyOwnTouch = false;
37 internal BackgroundExtraData backgroundExtraData;
39 private bool layoutSet = false;
40 private LayoutItem layout; // Exclusive layout assigned to this View.
42 // List of transitions paired with the condition that uses the transition.
43 private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
44 private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
45 private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
46 private float weight = 0.0f; // Weighting of child View in a Layout
47 private bool backgroundImageSynchronousLoading = false;
48 private bool excludeLayouting = false;
49 private LayoutTransition layoutTransition;
50 private TransitionOptions transitionOptions = null;
51 private ThemeData themeData;
52 private bool isThemeChanged = false;
54 // List of constraints
55 private Constraint widthConstraint = null;
56 private Constraint heightConstraint = null;
58 private Size2D internalMaximumSize = null;
59 private Size2D internalMinimumSize = null;
60 private Extents internalMargin = null;
61 private Extents internalPadding = null;
62 private Vector3 internalSizeModeFactor = null;
63 private Vector2 internalCellIndex = null;
64 private Color internalBackgroundColor = null;
65 private Color internalColor = null;
66 private Position internalPivotPoint = null;
67 private Position internalPosition = null;
68 private Position2D internalPosition2D = null;
69 private Vector3 internalScale = null;
70 private Size internalSize = null;
71 private Size2D internalSize2D = null;
72 private int layoutCount = 0;
73 private ControlState propagatableControlStates = ControlState.All;
75 // List of dispatch Event
76 private PanGestureDetector panGestureDetector = null;
77 private LongPressGestureDetector longGestureDetector = null;
78 private PinchGestureDetector pinchGestureDetector = null;
79 private TapGestureDetector tapGestureDetector = null;
80 private RotationGestureDetector rotationGestureDetector = null;
81 private int configGestureCount = 0;
82 private bool dispatchTouchEvents = true;
83 private bool dispatchGestureEvents = true;
84 private bool dispatchParentGestureEvents = true;
86 #if NUI_PROPERTY_CHANGE_3
87 private Vector3 internalCurrentParentOrigin = null;
88 private Vector3 internalCurrentAnchorPoint = null;
89 private Vector3 internalTargetSize = null;
90 private Size2D internalCurrentSize = null;
91 private Vector3 internalNaturalSize = null;
92 private Position internalCurrentPosition = null;
93 private Vector3 internalCurrentWorldPosition = null;
94 private Vector3 internalCurrentScale = null;
95 private Vector3 internalCurrentWorldScale = null;
96 private Vector4 internalCurrentColor = null;
97 private Vector4 internalCurrentWorldColor = null;
100 #if NUI_PROPERTY_CHANGE_DEBUG
101 internal static int LayoutSetGetter = 0;
102 internal static int SizeGetter = 0;
103 internal static int SizeSetter = 0;
104 internal static int Size2DGetter = 0;
105 internal static int Size2DSetter = 0;
106 internal static int MaximumSizeGetter = 0;
107 internal static int MaximumSizeSetter = 0;
108 internal static int MinimumSizeGetter = 0;
109 internal static int MinimumSizeSetter = 0;
110 internal static int PositionGetter = 0;
111 internal static int PositionSetter = 0;
112 internal static int Position2DGetter = 0;
113 internal static int Position2DSetter = 0;
114 internal static int SizeWidthGetter = 0;
115 internal static int SizeWidthSetter = 0;
116 internal static int SizeHeightGetter = 0;
117 internal static int SizeHeightSetter = 0;
118 internal static int PositionXGetter = 0;
119 internal static int PositionXSetter = 0;
120 internal static int PositionYGetter = 0;
121 internal static int PositionYSetter = 0;
122 internal static int PositionZGetter = 0;
123 internal static int PositionZSetter = 0;
124 internal static int StyleNameGetter = 0;
125 internal static int StyleNameSetter = 0;
126 internal static int KeyInputFocusGetter = 0;
127 internal static int KeyInputFocusSetter = 0;
128 internal static int ColorGetter = 0;
129 internal static int ColorSetter = 0;
132 internal static int ColorRedSetter = 0;
133 internal static int ColorGreenSetter = 0;
134 internal static int ColorBlueSetter = 0;
135 internal static int StateSetter = 0;
136 internal static int SubStateSetter = 0;
137 internal static int FlexSetter = 0;
138 internal static int AlignSelfSetter = 0;
139 internal static int FlexMarginSetter = 0;
140 internal static int CellIndexSetter = 0;
141 internal static int RowSpanSetter = 0;
142 internal static int ColumnSpanSetter = 0;
143 internal static int CellHorizontalAlignmentSetter = 0;
144 internal static int CellVerticalAlignmentSetter = 0;
145 internal static int OpacitySetter = 0;
146 internal static int PositionUsesPivotPointSetter = 0;
147 internal static int ParentOriginSetter = 0;
148 internal static int PivotPointSetter = 0;
149 internal static int OrientationSetter = 0;
150 internal static int ScaleSetter = 0;
151 internal static int ScaleXSetter = 0;
152 internal static int ScaleYSetter = 0;
153 internal static int ScaleZSetter = 0;
154 internal static int NameSetter = 0;
155 internal static int SensitiveSetter = 0;
156 internal static int IsEnabledSetter = 0;
157 internal static int DispatchKeyEventsSetter = 0;
158 internal static int LeaveRequiredSetter = 0;
159 internal static int InheritOrientationSetter = 0;
160 internal static int InheritScaleSetter = 0;
161 internal static int DrawModeSetter = 0;
162 internal static int SizeModeFactorSetter = 0;
163 internal static int WidthResizePolicySetter = 0;
164 internal static int HeightResizePolicySetter = 0;
165 internal static int SizeScalePolicySetter = 0;
166 internal static int WidthForHeightSetter = 0;
167 internal static int HeightForWidthSetter = 0;
168 internal static int InheritPositionSetter = 0;
169 internal static int ClippingModeSetter = 0;
170 internal static int InheritLayoutDirectionSetter = 0;
171 internal static int LayoutDirectionSetter = 0;
172 internal static int UpdateAreaHintSetter = 0;
173 internal static int AccessibilityNameSetter = 0;
174 internal static int AccessibilityDescriptionSetter = 0;
175 internal static int AccessibilityTranslationDomainSetter = 0;
176 internal static int AccessibilityRoleSetter = 0;
177 internal static int AccessibilityHighlightableSetter = 0;
178 internal static int AccessibilityHiddenSetter = 0;
179 internal static int AutomationIdSetter = 0;
181 internal static int ColorRedGetter = 0;
182 internal static int ColorGreenGetter = 0;
183 internal static int ColorBlueGetter = 0;
184 internal static int StateGetter = 0;
185 internal static int SubStateGetter = 0;
186 internal static int FlexGetter = 0;
187 internal static int AlignSelfGetter = 0;
188 internal static int FlexMarginGetter = 0;
189 internal static int CellIndexGetter = 0;
190 internal static int RowSpanGetter = 0;
191 internal static int ColumnSpanGetter = 0;
192 internal static int CellHorizontalAlignmentGetter = 0;
193 internal static int CellVerticalAlignmentGetter = 0;
194 internal static int OpacityGetter = 0;
195 internal static int PositionUsesPivotPointGetter = 0;
196 internal static int ParentOriginGetter = 0;
197 internal static int PivotPointGetter = 0;
198 internal static int OrientationGetter = 0;
199 internal static int ScaleGetter = 0;
200 internal static int ScaleXGetter = 0;
201 internal static int ScaleYGetter = 0;
202 internal static int ScaleZGetter = 0;
203 internal static int NameGetter = 0;
204 internal static int SensitiveGetter = 0;
205 internal static int IsEnabledGetter = 0;
206 internal static int DispatchKeyEventsGetter = 0;
207 internal static int LeaveRequiredGetter = 0;
208 internal static int InheritOrientationGetter = 0;
209 internal static int InheritScaleGetter = 0;
210 internal static int DrawModeGetter = 0;
211 internal static int SizeModeFactorGetter = 0;
212 internal static int WidthResizePolicyGetter = 0;
213 internal static int HeightResizePolicyGetter = 0;
214 internal static int SizeScalePolicyGetter = 0;
215 internal static int WidthForHeightGetter = 0;
216 internal static int HeightForWidthGetter = 0;
217 internal static int InheritPositionGetter = 0;
218 internal static int ClippingModeGetter = 0;
219 internal static int InheritLayoutDirectionGetter = 0;
220 internal static int LayoutDirectionGetter = 0;
221 internal static int UpdateAreaHintGetter = 0;
222 internal static int AccessibilityNameGetter = 0;
223 internal static int AccessibilityDescriptionGetter = 0;
224 internal static int AccessibilityTranslationDomainGetter = 0;
225 internal static int AccessibilityRoleGetter = 0;
226 internal static int AccessibilityHighlightableGetter = 0;
227 internal static int AccessibilityHiddenGetter = 0;
228 internal static int AutomationIdGetter = 0;
230 #if NUI_PROPERTY_CHANGE_3
231 internal static int WorldPositionXGetter = 0;
232 internal static int WorldPositionYGetter = 0;
233 internal static int WorldPositionZGetter = 0;
234 internal static int ParentOriginXGetter = 0;
235 internal static int ParentOriginXSetter = 0;
236 internal static int ParentOriginYGetter = 0;
237 internal static int ParentOriginYSetter = 0;
238 internal static int ParentOriginZGetter = 0;
239 internal static int ParentOriginZSetter = 0;
240 internal static int PivotPointXGetter = 0;
241 internal static int PivotPointXSetter = 0;
242 internal static int PivotPointYGetter = 0;
243 internal static int PivotPointYSetter = 0;
244 internal static int PivotPointZGetter = 0;
245 internal static int PivotPointZSetter = 0;
246 internal static int LeftFocusableViewIdGetter = 0;
247 internal static int LeftFocusableViewIdSetter = 0;
248 internal static int RightFocusableViewIdGetter = 0;
249 internal static int RightFocusableViewIdSetter = 0;
250 internal static int UpFocusableViewIdGetter = 0;
251 internal static int UpFocusableViewIdSetter = 0;
252 internal static int DownFocusableViewIdGetter = 0;
253 internal static int DownFocusableViewIdSetter = 0;
254 internal static int ClockwiseFocusableViewIdGetter = 0;
255 internal static int ClockwiseFocusableViewIdSetter = 0;
256 internal static int CounterClockwiseFocusableViewIdGetter = 0;
257 internal static int CounterClockwiseFocusableViewIdSetter = 0;
259 internal static int GetCurrentParentOriginCnt = 0;
260 internal static int GetCurrentAnchorPointCnt = 0;
261 internal static int GetTargetSizeCnt = 0;
262 internal static int GetCurrentSizeCnt = 0;
263 internal static int GetCurrentSizeFloatCnt = 0;
264 internal static int GetNaturalSizeCnt = 0;
265 internal static int GetCurrentPositionCnt = 0;
266 internal static int GetCurrentWorldPositionCnt = 0;
267 internal static int GetCurrentScaleCnt = 0;
268 internal static int GetCurrentWorldScaleCnt = 0;
269 internal static int GetCurrentColorCnt = 0;
270 internal static int GetCurrentWorldColorCnt = 0;
271 internal static int GetSizeModeFactorCnt = 0;
272 internal static int GetMinimumSizeCnt = 0;
273 internal static int GetMaximumSizeCnt = 0;
280 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
281 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
282 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
283 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
285 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
286 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
287 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
288 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
290 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
291 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
292 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
293 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
295 RegisterAccessibilityDelegate();
299 /// Creates a new instance of a view.
301 /// <since_tizen> 3 </since_tizen>
302 public View() : this(Interop.View.New(), true)
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
307 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
308 [EditorBrowsable(EditorBrowsableState.Never)]
309 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
314 /// Create a new instance of a View with setting the status of shown or hidden.
316 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
317 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
318 [EditorBrowsable(EditorBrowsableState.Never)]
319 public View(bool shown) : this(Interop.View.New(), true)
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
336 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
338 InitializeStyle(viewStyle);
341 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
345 PositionUsesPivotPoint = false;
348 onWindowSendEventCallback = SendViewAddedEventToWindow;
349 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
350 signal?.Connect(onWindowSendEventCallback);
352 hitTestResultDataCallback = OnHitTestResult;
353 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
354 touchDataSignal?.Connect(hitTestResultDataCallback);
361 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
362 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
365 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
367 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
376 /// The event that is triggered when the View's ControlState is changed.
378 [EditorBrowsable(EditorBrowsableState.Never)]
379 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
381 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
385 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
387 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
388 [EditorBrowsable(EditorBrowsableState.Never)]
389 public bool LayoutSet
393 #if NUI_PROPERTY_CHANGE_DEBUG
401 /// Flag to allow Layouting to be disabled for Views.
402 /// Once a View has a Layout set then any children added to Views from then on will receive
403 /// automatic Layouts.
405 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
406 [EditorBrowsable(EditorBrowsableState.Never)]
407 public static bool LayoutingDisabled { get; set; } = true;
410 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
412 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
413 [EditorBrowsable(EditorBrowsableState.Never)]
414 public static void SetDefaultGrabTouchAfterLeave(bool enable)
416 defaultGrabTouchAfterLeave = enable;
420 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
422 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
423 [EditorBrowsable(EditorBrowsableState.Never)]
424 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
426 defaultAllowOnlyOwnTouch = enable;
430 /// Deprecate. Do not use this.
431 /// The style instance applied to this view.
432 /// Note that do not modify the ViewStyle.
433 /// Modifying ViewStyle will affect other views with same ViewStyle.
435 [EditorBrowsable(EditorBrowsableState.Never)]
436 protected ViewStyle ViewStyle
440 if (themeData == null) themeData = new ThemeData();
442 if (themeData.viewStyle == null)
444 ApplyStyle(CreateViewStyle());
446 return themeData.viewStyle;
451 /// Get/Set the control state.
452 /// Note that the ControlState only available for the classes derived from Control.
453 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
454 /// please set <see cref="EnableControlState"/> to true.
456 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
457 [EditorBrowsable(EditorBrowsableState.Never)]
458 public ControlState ControlState
462 return themeData == null ? ControlState.Normal : themeData.controlStates;
466 if (ControlState == value)
471 var prevState = ControlState;
473 if (themeData == null) themeData = new ThemeData();
474 themeData.controlStates = value;
476 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
478 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
480 if (themeData.ControlStatePropagation)
482 foreach (View child in Children)
484 ControlState allowed = child.PropagatableControlStates;
485 if (allowed.Contains(ControlState.All))
487 child.ControlState = value;
491 ControlState newControlState = child.ControlState;
493 if (allowed.Contains(ControlState.Normal))
495 if (value.Contains(ControlState.Normal))
497 newControlState += ControlState.Normal;
501 newControlState -= ControlState.Normal;
505 if (allowed.Contains(ControlState.Disabled))
507 if (value.Contains(ControlState.Disabled))
509 newControlState += ControlState.Disabled;
513 newControlState -= ControlState.Disabled;
517 if (allowed.Contains(ControlState.Selected))
519 if (value.Contains(ControlState.Selected))
521 newControlState += ControlState.Selected;
525 newControlState -= ControlState.Selected;
529 if (allowed.Contains(ControlState.Pressed))
531 if (value.Contains(ControlState.Pressed))
533 newControlState += ControlState.Pressed;
537 newControlState -= ControlState.Pressed;
541 if (allowed.Contains(ControlState.Focused))
543 if (value.Contains(ControlState.Focused))
545 newControlState += ControlState.Focused;
549 newControlState -= ControlState.Focused;
553 if (allowed.Contains(ControlState.Other))
555 if (value.Contains(ControlState.Other))
557 newControlState += ControlState.Other;
561 newControlState -= ControlState.Other;
565 if (child.ControlState != newControlState)
566 child.ControlState = newControlState;
571 OnControlStateChanged(changeInfo);
573 ControlStateChangedEvent?.Invoke(this, changeInfo);
578 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
580 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
581 [EditorBrowsable(EditorBrowsableState.Never)]
582 public bool ExcludeLayouting
586 return (bool)GetValue(ExcludeLayoutingProperty);
590 SetValue(ExcludeLayoutingProperty, value);
591 NotifyPropertyChanged();
595 private bool InternalExcludeLayouting
599 return excludeLayouting;
603 excludeLayouting = value;
604 if (Layout != null && Layout.SetPositionByLayout == value)
606 Layout.SetPositionByLayout = !value;
607 Layout.RequestLayout();
613 /// The StyleName, type string.
614 /// The value indicates DALi style name defined in json theme file.
616 /// <since_tizen> 3 </since_tizen>
617 public string StyleName
621 #if NUI_PROPERTY_CHANGE_DEBUG
624 return (string)GetValue(StyleNameProperty);
628 #if NUI_PROPERTY_CHANGE_DEBUG
631 SetValue(StyleNameProperty, value);
632 NotifyPropertyChanged();
637 /// The KeyInputFocus, type bool.
639 [EditorBrowsable(EditorBrowsableState.Never)]
640 public bool KeyInputFocus
644 #if NUI_PROPERTY_CHANGE_DEBUG
645 KeyInputFocusGetter++;
647 return (bool)GetValue(KeyInputFocusProperty);
651 #if NUI_PROPERTY_CHANGE_DEBUG
652 KeyInputFocusSetter++;
654 SetValue(KeyInputFocusProperty, value);
655 NotifyPropertyChanged();
660 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
664 /// The property cascade chaining set is not recommended.
667 /// Animatable - This property can be animated using <c>Animation</c> class.
669 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
674 /// This way is recommended for setting the property
676 /// var view = new View();
677 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
679 /// This way to set the property is prohibited
681 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
684 /// <since_tizen> 3 </since_tizen>
685 public Color BackgroundColor
689 return (Color)GetValue(BackgroundColorProperty);
693 SetValue(BackgroundColorProperty, value);
694 NotifyPropertyChanged();
699 /// The mutually exclusive with "backgroundColor" and "background" type Map.
701 /// <since_tizen> 3 </since_tizen>
702 public string BackgroundImage
706 return (string)GetValue(BackgroundImageProperty);
710 SetValue(BackgroundImageProperty, value);
711 NotifyPropertyChanged();
716 /// Get or set the border of background image.
718 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
719 [EditorBrowsable(EditorBrowsableState.Never)]
720 public Rectangle BackgroundImageBorder
724 return (Rectangle)GetValue(BackgroundImageBorderProperty);
728 SetValue(BackgroundImageBorderProperty, value);
729 NotifyPropertyChanged();
734 /// The background of view.
736 /// <since_tizen> 3 </since_tizen>
737 public Tizen.NUI.PropertyMap Background
741 return (PropertyMap)GetValue(BackgroundProperty);
745 SetValue(BackgroundProperty, value);
746 NotifyPropertyChanged();
751 /// Describes a shadow as an image for a View.
752 /// It is null by default.
755 /// Getter returns copied instance of current shadow.
758 /// The mutually exclusive with "BoxShadow".
762 /// Animatable - This property can be animated using <c>Animation</c> class.
763 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
765 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
767 /// Animatable sub-property : Offset.
770 [EditorBrowsable(EditorBrowsableState.Never)]
771 public ImageShadow ImageShadow
775 return (ImageShadow)GetValue(ImageShadowProperty);
779 SetValue(ImageShadowProperty, value);
780 NotifyPropertyChanged();
785 /// Describes a box shaped shadow drawing for a View.
786 /// It is null by default.
789 /// The mutually exclusive with "ImageShadow".
793 /// Animatable - This property can be animated using <c>Animation</c> class.
794 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
796 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
798 /// Animatable sub-property : Offset, Color, BlurRadius.
801 /// <since_tizen> 9 </since_tizen>
802 public Shadow BoxShadow
806 return (Shadow)GetValue(BoxShadowProperty);
810 SetValue(BoxShadowProperty, value);
811 NotifyPropertyChanged();
816 /// The radius for the rounded corners of the View.
817 /// This will rounds background and shadow edges.
818 /// The values in Vector4 are used in clockwise order from top-left to bottom-left : Vector4(top-left-corner, top-right-corner, bottom-right-corner, bottom-left-corner).
819 /// Each radius will clamp internally to the half of smaller of the view's width or height.
820 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
824 /// Animatable - This property can be animated using <c>Animation</c> class.
826 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
830 /// <since_tizen> 9 </since_tizen>
831 public Vector4 CornerRadius
835 return (Vector4)GetValue(CornerRadiusProperty);
839 SetValue(CornerRadiusProperty, value);
840 NotifyPropertyChanged();
845 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
846 /// It is absolute by default.
847 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
849 /// <since_tizen> 9 </since_tizen>
850 public VisualTransformPolicyType CornerRadiusPolicy
852 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
853 set => SetValue(CornerRadiusPolicyProperty, value);
857 /// The width for the borderline of the View.
861 /// Animatable - This property can be animated using <c>Animation</c> class.
863 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
866 /// Note that, an image background may not have borderline if it uses the Border property.
868 /// <since_tizen> 9 </since_tizen>
869 public float BorderlineWidth
873 return (float)GetValue(BorderlineWidthProperty);
877 SetValue(BorderlineWidthProperty, value);
878 NotifyPropertyChanged();
883 /// The color for the borderline of the View.
884 /// It is Color.Black by default.
888 /// Animatable - This property can be animated using <c>Animation</c> class.
890 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
894 /// <since_tizen> 9 </since_tizen>
895 public Color BorderlineColor
899 return (Color)GetValue(BorderlineColorProperty);
903 SetValue(BorderlineColorProperty, value);
904 NotifyPropertyChanged();
909 /// The color selector for the borderline of the View.
910 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
911 /// So this API is internally used only.
913 internal Selector<Color> BorderlineColorSelector
917 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
921 SetValue(BorderlineColorSelectorProperty, value);
922 NotifyPropertyChanged();
927 /// The Relative offset for the borderline of the View.
928 /// Recommended range : [-1.0f to 1.0f].
929 /// If -1.0f, draw borderline inside of the View.
930 /// If 1.0f, draw borderline outside of the View.
931 /// If 0.0f, draw borderline half inside and half outside.
932 /// It is 0.0f by default.
936 /// Animatable - This property can be animated using <c>Animation</c> class.
938 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
942 /// <since_tizen> 9 </since_tizen>
943 public float BorderlineOffset
947 return (float)GetValue(BorderlineOffsetProperty);
951 SetValue(BorderlineOffsetProperty, value);
952 NotifyPropertyChanged();
957 /// The current state of the view.
959 /// <since_tizen> 3 </since_tizen>
964 #if NUI_PROPERTY_CHANGE_DEBUG
967 return (States)GetValue(StateProperty);
971 #if NUI_PROPERTY_CHANGE_DEBUG
974 SetValue(StateProperty, value);
975 NotifyPropertyChanged();
980 /// The current sub state of the view.
982 /// <since_tizen> 3 </since_tizen>
983 public States SubState
987 #if NUI_PROPERTY_CHANGE_DEBUG
990 return (States)GetValue(SubStateProperty);
994 #if NUI_PROPERTY_CHANGE_DEBUG
997 SetValue(SubStateProperty, value);
998 NotifyPropertyChanged();
1003 /// Displays a tooltip
1005 /// <since_tizen> 3 </since_tizen>
1006 public Tizen.NUI.PropertyMap Tooltip
1010 return (PropertyMap)GetValue(TooltipProperty);
1014 SetValue(TooltipProperty, value);
1015 NotifyPropertyChanged();
1020 /// Displays a tooltip as a text.
1022 /// <since_tizen> 3 </since_tizen>
1023 public string TooltipText
1027 return GetValue(TooltipTextProperty) as string;
1031 SetValue(TooltipTextProperty, value);
1035 private string InternalTooltipText
1039 using (var propertyValue = GetProperty(Property.TOOLTIP))
1041 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
1043 return retrivedValue;
1045 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
1046 return "error to get TooltipText";
1051 var temp = new Tizen.NUI.PropertyValue(value);
1052 SetProperty(View.Property.TOOLTIP, temp);
1054 NotifyPropertyChanged();
1059 /// The Child property of FlexContainer.<br />
1060 /// The proportion of the free space in the container, the flex item will receive.<br />
1061 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
1063 /// <since_tizen> 3 </since_tizen>
1064 [Obsolete("Deprecated in API8, will be removed in API10.")]
1069 #if NUI_PROPERTY_CHANGE_DEBUG
1072 return (float)GetValue(FlexProperty);
1076 #if NUI_PROPERTY_CHANGE_DEBUG
1079 SetValue(FlexProperty, value);
1080 NotifyPropertyChanged();
1085 /// The Child property of FlexContainer.<br />
1086 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
1088 /// <since_tizen> 3 </since_tizen>
1089 [Obsolete("Deprecated in API8, will be removed in API10.")]
1090 public int AlignSelf
1094 #if NUI_PROPERTY_CHANGE_DEBUG
1097 return (int)GetValue(AlignSelfProperty);
1101 #if NUI_PROPERTY_CHANGE_DEBUG
1104 SetValue(AlignSelfProperty, value);
1105 NotifyPropertyChanged();
1110 /// The Child property of FlexContainer.<br />
1111 /// The space around the flex item.<br />
1114 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
1116 /// <since_tizen> 3 </since_tizen>
1117 [Obsolete("Deprecated in API8, will be removed in API10.")]
1118 public Vector4 FlexMargin
1122 #if NUI_PROPERTY_CHANGE_DEBUG
1125 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
1126 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
1130 #if NUI_PROPERTY_CHANGE_DEBUG
1133 SetValue(FlexMarginProperty, value);
1134 NotifyPropertyChanged();
1139 /// The top-left cell this child occupies, if not set, the first available cell is used.
1142 /// The property cascade chaining set is not recommended.
1143 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
1146 /// This way is recommended for setting the property
1148 /// var view = new View();
1149 /// view.CellIndex = new Vector2(1, 3);
1151 /// This way to set the property is prohibited
1153 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
1156 /// <since_tizen> 3 </since_tizen>
1157 public Vector2 CellIndex
1161 #if NUI_PROPERTY_CHANGE_DEBUG
1164 return (Vector2)GetValue(CellIndexProperty);
1168 #if NUI_PROPERTY_CHANGE_DEBUG
1171 SetValue(CellIndexProperty, value);
1172 NotifyPropertyChanged();
1177 /// The number of rows this child occupies, if not set, the default value is 1.
1180 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1182 /// <since_tizen> 3 </since_tizen>
1183 public float RowSpan
1187 #if NUI_PROPERTY_CHANGE_DEBUG
1190 return (float)GetValue(RowSpanProperty);
1194 #if NUI_PROPERTY_CHANGE_DEBUG
1197 SetValue(RowSpanProperty, value);
1198 NotifyPropertyChanged();
1203 /// The number of columns this child occupies, if not set, the default value is 1.
1206 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1208 /// <since_tizen> 3 </since_tizen>
1209 public float ColumnSpan
1213 #if NUI_PROPERTY_CHANGE_DEBUG
1216 return (float)GetValue(ColumnSpanProperty);
1220 #if NUI_PROPERTY_CHANGE_DEBUG
1223 SetValue(ColumnSpanProperty, value);
1224 NotifyPropertyChanged();
1229 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1232 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1234 /// <since_tizen> 3 </since_tizen>
1235 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1239 #if NUI_PROPERTY_CHANGE_DEBUG
1240 CellHorizontalAlignmentGetter++;
1242 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1246 #if NUI_PROPERTY_CHANGE_DEBUG
1247 CellHorizontalAlignmentSetter++;
1249 SetValue(CellHorizontalAlignmentProperty, value);
1250 NotifyPropertyChanged();
1255 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1258 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1260 /// <since_tizen> 3 </since_tizen>
1261 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1265 #if NUI_PROPERTY_CHANGE_DEBUG
1266 CellVerticalAlignmentGetter++;
1268 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1272 #if NUI_PROPERTY_CHANGE_DEBUG
1273 CellVerticalAlignmentSetter++;
1275 SetValue(CellVerticalAlignmentProperty, value);
1276 NotifyPropertyChanged();
1281 /// The left focusable view.<br />
1282 /// This will return null if not set.<br />
1283 /// This will also return null if the specified left focusable view is not on a window.<br />
1285 /// <since_tizen> 3 </since_tizen>
1286 public View LeftFocusableView
1288 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1291 return (View)GetValue(LeftFocusableViewProperty);
1295 SetValue(LeftFocusableViewProperty, value);
1296 NotifyPropertyChanged();
1301 /// The right focusable view.<br />
1302 /// This will return null if not set.<br />
1303 /// This will also return null if the specified right focusable view is not on a window.<br />
1305 /// <since_tizen> 3 </since_tizen>
1306 public View RightFocusableView
1308 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1311 return (View)GetValue(RightFocusableViewProperty);
1315 SetValue(RightFocusableViewProperty, value);
1316 NotifyPropertyChanged();
1321 /// The up focusable view.<br />
1322 /// This will return null if not set.<br />
1323 /// This will also return null if the specified up focusable view is not on a window.<br />
1325 /// <since_tizen> 3 </since_tizen>
1326 public View UpFocusableView
1328 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1331 return (View)GetValue(UpFocusableViewProperty);
1335 SetValue(UpFocusableViewProperty, value);
1336 NotifyPropertyChanged();
1341 /// The down focusable view.<br />
1342 /// This will return null if not set.<br />
1343 /// This will also return null if the specified down focusable view is not on a window.<br />
1345 /// <since_tizen> 3 </since_tizen>
1346 public View DownFocusableView
1348 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1351 return (View)GetValue(DownFocusableViewProperty);
1355 SetValue(DownFocusableViewProperty, value);
1356 NotifyPropertyChanged();
1361 /// The clockwise focusable view by rotary wheel.<br />
1362 /// This will return null if not set.<br />
1363 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1365 [EditorBrowsable(EditorBrowsableState.Never)]
1366 public View ClockwiseFocusableView
1368 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1371 return (View)GetValue(ClockwiseFocusableViewProperty);
1375 SetValue(ClockwiseFocusableViewProperty, value);
1376 NotifyPropertyChanged();
1381 /// The counter clockwise focusable view by rotary wheel.<br />
1382 /// This will return null if not set.<br />
1383 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1385 [EditorBrowsable(EditorBrowsableState.Never)]
1386 public View CounterClockwiseFocusableView
1388 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1391 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1395 SetValue(CounterClockwiseFocusableViewProperty, value);
1396 NotifyPropertyChanged();
1401 /// Whether the view should be focusable by keyboard navigation.
1403 /// <since_tizen> 3 </since_tizen>
1404 public bool Focusable
1408 SetValue(FocusableProperty, value);
1409 NotifyPropertyChanged();
1413 return (bool)GetValue(FocusableProperty);
1418 /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
1419 /// Note : Default value is true.
1421 [EditorBrowsable(EditorBrowsableState.Never)]
1422 public bool FocusableChildren
1426 SetValue(FocusableChildrenProperty, value);
1427 NotifyPropertyChanged();
1431 return (bool)GetValue(FocusableChildrenProperty);
1436 /// Whether this view can focus by touch.
1437 /// If Focusable is false, FocusableInTouch is disabled.
1438 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1440 [EditorBrowsable(EditorBrowsableState.Never)]
1441 public bool FocusableInTouch
1445 SetValue(FocusableInTouchProperty, value);
1446 NotifyPropertyChanged();
1450 return (bool)GetValue(FocusableInTouchProperty);
1455 /// Retrieves the position of the view.
1456 /// The coordinates are relative to the view's parent.
1459 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1460 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1461 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1462 /// and users can get the current actual values through them.
1464 /// <since_tizen> 3 </since_tizen>
1465 public Position CurrentPosition
1469 return GetCurrentPosition();
1474 /// Sets the size of a view for the width and the height.<br />
1475 /// Geometry can be scaled to fit within this area.<br />
1476 /// This does not interfere with the view's scale factor.<br />
1477 /// The views default depth is the minimum of width and height.<br />
1480 /// The property cascade chaining set is not recommended.
1483 /// This way is recommended for setting the property
1485 /// var view = new View();
1486 /// view.Size2D = new Size2D(100, 200);
1488 /// This way to set the property is prohibited
1490 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1493 /// <since_tizen> 3 </since_tizen>
1494 public Size2D Size2D
1498 #if NUI_PROPERTY_CHANGE_DEBUG
1502 var temp = (Size2D)GetValue(Size2DProperty);
1504 if (this.Layout == null)
1506 if (temp.Width < 0) { temp.Width = 0; }
1507 if (temp.Height < 0) { temp.Height = 0; }
1514 #if NUI_PROPERTY_CHANGE_DEBUG
1518 SetValue(Size2DProperty, value);
1520 NotifyPropertyChanged();
1525 /// Retrieves the size of the view.
1526 /// The coordinates are relative to the view's parent.
1529 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1530 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1531 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1532 /// and users can get the current actual values through them.
1534 /// <since_tizen> 3 </since_tizen>
1535 public Size2D CurrentSize
1539 return GetCurrentSize();
1544 /// Retrieves and sets the view's opacity.<br />
1548 /// Animatable - This property can be animated using <c>Animation</c> class.
1550 /// animation.AnimateTo(view, "Opacity", 0.5f);
1554 /// <since_tizen> 3 </since_tizen>
1555 public float Opacity
1559 #if NUI_PROPERTY_CHANGE_DEBUG
1562 return (float)GetValue(OpacityProperty);
1566 #if NUI_PROPERTY_CHANGE_DEBUG
1569 SetValue(OpacityProperty, value);
1570 NotifyPropertyChanged();
1575 /// Sets the position of the view for X and Y.<br />
1576 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1577 /// If the position inheritance is disabled, sets the world position.<br />
1580 /// The property cascade chaining set is not recommended.
1583 /// This way is recommended for setting the property
1585 /// var view = new View();
1586 /// view.Position2D = new Position2D(100, 200);
1588 /// This way to set the property is prohibited
1590 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1593 /// <since_tizen> 3 </since_tizen>
1594 public Position2D Position2D
1598 #if NUI_PROPERTY_CHANGE_DEBUG
1602 return (Position2D)GetValue(Position2DProperty);
1606 #if NUI_PROPERTY_CHANGE_DEBUG
1610 SetValue(Position2DProperty, value);
1611 NotifyPropertyChanged();
1616 /// Retrieves the screen position of the view.<br />
1618 /// <since_tizen> 3 </since_tizen>
1619 public Vector2 ScreenPosition
1623 Vector2 temp = new Vector2(0.0f, 0.0f);
1624 var pValue = GetProperty(View.Property.ScreenPosition);
1632 /// Determines whether the pivot point should be used to determine the position of the view.
1633 /// This is false by default.
1635 /// <remarks>If false, then the top-left of the view is used for the position.
1636 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1638 /// <since_tizen> 3 </since_tizen>
1639 public bool PositionUsesPivotPoint
1643 #if NUI_PROPERTY_CHANGE_DEBUG
1644 PositionUsesPivotPointGetter++;
1646 return (bool)GetValue(PositionUsesPivotPointProperty);
1650 #if NUI_PROPERTY_CHANGE_DEBUG
1651 PositionUsesPivotPointSetter++;
1653 SetValue(PositionUsesPivotPointProperty, value);
1654 NotifyPropertyChanged();
1659 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1661 /// <since_tizen> 3 </since_tizen>
1662 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1664 "View view = new View(); " +
1665 "view.PivotPoint = PivotPoint.Center; " +
1666 "view.PositionUsesPivotPoint = true;" +
1667 " This has been deprecated in API5 and will be removed in API8")]
1668 [EditorBrowsable(EditorBrowsableState.Never)]
1669 public bool PositionUsesAnchorPoint
1673 return (bool)GetValue(PositionUsesAnchorPointProperty);
1677 SetValue(PositionUsesAnchorPointProperty, value);
1681 private bool InternalPositionUsesAnchorPoint
1686 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1687 pValue.Get(out temp);
1693 var temp = new Tizen.NUI.PropertyValue(value);
1694 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1696 NotifyPropertyChanged();
1701 /// Queries whether the view is connected to the stage.<br />
1702 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1704 /// <since_tizen> 3 </since_tizen>
1705 public bool IsOnWindow
1714 /// Gets the depth in the hierarchy for the view.
1716 /// <since_tizen> 3 </since_tizen>
1717 public int HierarchyDepth
1721 return GetHierarchyDepth();
1726 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1729 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1730 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1731 /// The values set by this property will likely change.
1733 /// <since_tizen> 3 </since_tizen>
1734 public int SiblingOrder
1738 return (int)GetValue(SiblingOrderProperty);
1742 SetValue(SiblingOrderProperty, value);
1744 Layout?.ChangeLayoutSiblingOrder(value);
1746 NotifyPropertyChanged();
1751 /// Returns the natural size of the view.
1754 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1756 /// <since_tizen> 5 </since_tizen>
1757 public Vector3 NaturalSize
1761 Vector3 ret = GetNaturalSize();
1762 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1768 /// Returns the natural size (Size2D) of the view.
1771 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1773 /// <since_tizen> 4 </since_tizen>
1774 public Size2D NaturalSize2D
1778 Vector3 temp = GetNaturalSize();
1779 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1781 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1788 /// Gets or sets the origin of a view within its parent's area.<br />
1789 /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1790 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1791 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1793 /// <pre>The view has been initialized.</pre>
1794 /// <since_tizen> 3 </since_tizen>
1795 public Position ParentOrigin
1799 #if NUI_PROPERTY_CHANGE_DEBUG
1800 ParentOriginGetter++;
1802 Position tmp = (Position)GetValue(ParentOriginProperty);
1803 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1807 #if NUI_PROPERTY_CHANGE_DEBUG
1808 ParentOriginSetter++;
1810 SetValue(ParentOriginProperty, value);
1811 NotifyPropertyChanged();
1816 /// Gets or sets the anchor-point of a view.<br />
1817 /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1818 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1819 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1820 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1821 /// <pre>The view has been initialized.</pre>
1824 /// The property cascade chaining set is not recommended.
1827 /// This way is recommended for setting the property
1829 /// var view = new View();
1830 /// view.PivotPoint = PivotPoint.Center;
1832 /// This way to set the property is prohibited
1834 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1837 /// <since_tizen> 3 </since_tizen>
1838 public Position PivotPoint
1842 #if NUI_PROPERTY_CHANGE_DEBUG
1845 return (Position)GetValue(PivotPointProperty);
1849 #if NUI_PROPERTY_CHANGE_DEBUG
1852 SetValue(PivotPointProperty, value);
1853 NotifyPropertyChanged();
1858 /// Gets or sets the size width of the view.
1862 /// Animatable - This property can be animated using <c>Animation</c> class.
1864 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1868 /// <since_tizen> 3 </since_tizen>
1869 public float SizeWidth
1873 #if NUI_PROPERTY_CHANGE_DEBUG
1877 return (float)GetValue(SizeWidthProperty);
1881 #if NUI_PROPERTY_CHANGE_DEBUG
1885 SetValue(SizeWidthProperty, value);
1886 NotifyPropertyChanged();
1891 /// Gets or sets the size height of the view.
1895 /// Animatable - This property can be animated using <c>Animation</c> class.
1898 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1901 /// <since_tizen> 3 </since_tizen>
1902 public float SizeHeight
1906 #if NUI_PROPERTY_CHANGE_DEBUG
1910 return (float)GetValue(SizeHeightProperty);
1914 #if NUI_PROPERTY_CHANGE_DEBUG
1918 SetValue(SizeHeightProperty, value);
1919 NotifyPropertyChanged();
1924 /// Gets or sets the position of the view.<br />
1925 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1926 /// If the position inheritance is disabled, sets the world position.<br />
1930 /// Animatable - This property can be animated using <c>Animation</c> class.
1932 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1935 /// The property cascade chaining set is not recommended.
1938 /// This way is recommended for setting the property
1940 /// var view = new View();
1941 /// view.Position = new Position(100, 200.5f, 0);
1943 /// This way to set the property is prohibited
1945 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1948 /// <since_tizen> 3 </since_tizen>
1949 public Position Position
1953 #if NUI_PROPERTY_CHANGE_DEBUG
1957 return (Position)GetValue(PositionProperty);
1961 #if NUI_PROPERTY_CHANGE_DEBUG
1965 SetValue(PositionProperty, value);
1966 NotifyPropertyChanged();
1971 /// Gets or sets the position X of the view.
1975 /// Animatable - This property can be animated using <c>Animation</c> class.
1977 /// animation.AnimateTo(view, "PositionX", 50.0f);
1981 /// <since_tizen> 3 </since_tizen>
1982 public float PositionX
1986 #if NUI_PROPERTY_CHANGE_DEBUG
1989 return (float)GetValue(PositionXProperty);
1993 #if NUI_PROPERTY_CHANGE_DEBUG
1996 SetValue(PositionXProperty, value);
1997 NotifyPropertyChanged();
2002 /// Gets or sets the position Y of the view.
2006 /// Animatable - This property can be animated using <c>Animation</c> class.
2008 /// animation.AnimateTo(view, "PositionY", 50.0f);
2012 /// <since_tizen> 3 </since_tizen>
2013 public float PositionY
2017 #if NUI_PROPERTY_CHANGE_DEBUG
2020 return (float)GetValue(PositionYProperty);
2024 #if NUI_PROPERTY_CHANGE_DEBUG
2027 SetValue(PositionYProperty, value);
2028 NotifyPropertyChanged();
2033 /// Gets or sets the position Z of the view.
2037 /// Animatable - This property can be animated using <c>Animation</c> class.
2039 /// animation.AnimateTo(view, "PositionZ", 50.0f);
2043 /// <since_tizen> 3 </since_tizen>
2044 public float PositionZ
2048 #if NUI_PROPERTY_CHANGE_DEBUG
2052 return (float)GetValue(PositionZProperty);
2056 #if NUI_PROPERTY_CHANGE_DEBUG
2060 SetValue(PositionZProperty, value);
2061 NotifyPropertyChanged();
2066 /// Gets or sets the world position of the view.
2068 /// <since_tizen> 3 </since_tizen>
2069 public Vector3 WorldPosition
2073 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
2074 var pValue = GetProperty(View.Property.WorldPosition);
2082 /// Gets or sets the orientation of the view.<br />
2083 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
2087 /// This is an asynchronous method.
2090 /// Animatable - This property can be animated using <c>Animation</c> class.
2092 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
2096 /// <since_tizen> 3 </since_tizen>
2097 public Rotation Orientation
2101 #if NUI_PROPERTY_CHANGE_DEBUG
2102 OrientationGetter++;
2104 return (Rotation)GetValue(OrientationProperty);
2108 #if NUI_PROPERTY_CHANGE_DEBUG
2109 OrientationSetter++;
2111 SetValue(OrientationProperty, value);
2112 NotifyPropertyChanged();
2117 /// Gets or sets the world orientation of the view.<br />
2119 /// <since_tizen> 3 </since_tizen>
2120 public Rotation WorldOrientation
2124 Rotation temp = new Rotation();
2125 var pValue = GetProperty(View.Property.WorldOrientation);
2133 /// Gets or sets the scale factor applied to the view.<br />
2137 /// Animatable - This property can be animated using <c>Animation</c> class.
2139 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
2142 /// The property cascade chaining set is not recommended.
2145 /// This way is recommended for setting the property
2147 /// var view = new View();
2148 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
2150 /// This way to set the property is prohibited
2152 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
2155 /// <since_tizen> 3 </since_tizen>
2156 public Vector3 Scale
2160 #if NUI_PROPERTY_CHANGE_DEBUG
2163 return (Vector3)GetValue(ScaleProperty);
2167 #if NUI_PROPERTY_CHANGE_DEBUG
2170 SetValue(ScaleProperty, value);
2171 NotifyPropertyChanged();
2176 /// Gets or sets the scale X factor applied to the view.
2180 /// Animatable - This property can be animated using <c>Animation</c> class.
2182 /// animation.AnimateTo(view, "ScaleX", 1.5f);
2186 /// <since_tizen> 3 </since_tizen>
2191 #if NUI_PROPERTY_CHANGE_DEBUG
2194 return (float)GetValue(ScaleXProperty);
2198 #if NUI_PROPERTY_CHANGE_DEBUG
2201 SetValue(ScaleXProperty, value);
2202 NotifyPropertyChanged();
2207 /// Gets or sets the scale Y factor applied to the view.
2211 /// Animatable - This property can be animated using <c>Animation</c> class.
2213 /// animation.AnimateTo(view, "ScaleY", 1.5f);
2217 /// <since_tizen> 3 </since_tizen>
2222 #if NUI_PROPERTY_CHANGE_DEBUG
2225 return (float)GetValue(ScaleYProperty);
2229 #if NUI_PROPERTY_CHANGE_DEBUG
2232 SetValue(ScaleYProperty, value);
2233 NotifyPropertyChanged();
2238 /// Gets or sets the scale Z factor applied to the view.
2242 /// Animatable - This property can be animated using <c>Animation</c> class.
2244 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
2248 /// <since_tizen> 3 </since_tizen>
2253 #if NUI_PROPERTY_CHANGE_DEBUG
2256 return (float)GetValue(ScaleZProperty);
2260 #if NUI_PROPERTY_CHANGE_DEBUG
2263 SetValue(ScaleZProperty, value);
2264 NotifyPropertyChanged();
2269 /// Gets the world scale of the view.
2271 /// <since_tizen> 3 </since_tizen>
2272 public Vector3 WorldScale
2276 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
2277 var pValue = GetProperty(View.Property.WorldScale);
2285 /// Retrieves the visibility flag of the view.
2289 /// If the view is not visible, then the view and its children will not be rendered.
2290 /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true.
2293 /// Animatable - This property can be animated using <c>Animation</c> class.
2295 /// animation.AnimateTo(view, "Visibility", false);
2299 /// <since_tizen> 3 </since_tizen>
2300 public bool Visibility
2305 var pValue = GetProperty(View.Property.VISIBLE);
2306 pValue.Get(out temp);
2313 /// Gets the view's world color.
2315 /// <since_tizen> 3 </since_tizen>
2316 public Vector4 WorldColor
2320 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2321 var pValue = GetProperty(View.Property.WorldColor);
2329 /// Gets or sets the view's name.
2331 /// <since_tizen> 3 </since_tizen>
2336 #if NUI_PROPERTY_CHANGE_DEBUG
2339 return (string)GetValue(NameProperty);
2343 #if NUI_PROPERTY_CHANGE_DEBUG
2346 SetValue(NameProperty, value);
2347 NotifyPropertyChanged();
2352 /// Get the number of children held by the view.
2354 /// <since_tizen> 3 </since_tizen>
2355 public new uint ChildCount
2359 return Convert.ToUInt32(Children.Count);
2364 /// Gets the view's ID.
2367 /// <since_tizen> 3 </since_tizen>
2377 /// Gets or sets the status of whether the view should emit touch or hover signals.
2378 /// If a View is made insensitive, then the View and its children are not hittable.
2380 /// <since_tizen> 3 </since_tizen>
2381 public bool Sensitive
2385 #if NUI_PROPERTY_CHANGE_DEBUG
2388 return (bool)GetValue(SensitiveProperty);
2392 #if NUI_PROPERTY_CHANGE_DEBUG
2395 SetValue(SensitiveProperty, value);
2396 NotifyPropertyChanged();
2401 /// Gets or sets the status of whether the view should be enabled user interactions.
2402 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2404 /// <since_tizen> tizen_next </since_tizen>
2405 [EditorBrowsable(EditorBrowsableState.Never)]
2406 public bool IsEnabled
2410 #if NUI_PROPERTY_CHANGE_DEBUG
2413 return (bool)GetValue(IsEnabledProperty);
2417 #if NUI_PROPERTY_CHANGE_DEBUG
2420 SetValue(IsEnabledProperty, value);
2421 NotifyPropertyChanged();
2426 /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view.
2428 /// <since_tizen> 3 </since_tizen>
2429 public bool LeaveRequired
2433 #if NUI_PROPERTY_CHANGE_DEBUG
2434 LeaveRequiredGetter++;
2436 return (bool)GetValue(LeaveRequiredProperty);
2440 #if NUI_PROPERTY_CHANGE_DEBUG
2441 LeaveRequiredSetter++;
2443 SetValue(LeaveRequiredProperty, value);
2444 NotifyPropertyChanged();
2449 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2451 /// <since_tizen> 3 </since_tizen>
2452 public bool InheritOrientation
2456 return (bool)GetValue(InheritOrientationProperty);
2460 SetValue(InheritOrientationProperty, value);
2461 NotifyPropertyChanged();
2466 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2468 /// <since_tizen> 3 </since_tizen>
2469 public bool InheritScale
2473 #if NUI_PROPERTY_CHANGE_DEBUG
2474 InheritScaleGetter++;
2476 return (bool)GetValue(InheritScaleProperty);
2480 #if NUI_PROPERTY_CHANGE_DEBUG
2481 InheritScaleSetter++;
2483 SetValue(InheritScaleProperty, value);
2484 NotifyPropertyChanged();
2489 /// Gets or sets the status of how the view and its children should be drawn.<br />
2490 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2491 /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.<br />
2492 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2493 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2494 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2496 /// <since_tizen> 3 </since_tizen>
2497 public DrawModeType DrawMode
2501 #if NUI_PROPERTY_CHANGE_DEBUG
2504 return (DrawModeType)GetValue(DrawModeProperty);
2508 #if NUI_PROPERTY_CHANGE_DEBUG
2511 SetValue(DrawModeProperty, value);
2512 NotifyPropertyChanged();
2517 /// Gets or sets the relative to parent size factor of the view.<br />
2518 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2519 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2522 /// The property cascade chaining set is not recommended.
2525 /// This way is recommended for setting the property
2527 /// var text = new TextField();
2528 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2530 /// This way to set the property is prohibited
2532 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2535 /// <since_tizen> 3 </since_tizen>
2536 public Vector3 SizeModeFactor
2540 #if NUI_PROPERTY_CHANGE_DEBUG
2541 SizeModeFactorGetter++;
2543 return (Vector3)GetValue(SizeModeFactorProperty);
2547 #if NUI_PROPERTY_CHANGE_DEBUG
2548 SizeModeFactorSetter++;
2550 SetValue(SizeModeFactorProperty, value);
2551 NotifyPropertyChanged();
2556 /// Gets or sets the width resize policy to be used.
2558 /// <since_tizen> 3 </since_tizen>
2559 public ResizePolicyType WidthResizePolicy
2563 #if NUI_PROPERTY_CHANGE_DEBUG
2564 WidthResizePolicyGetter++;
2566 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2570 #if NUI_PROPERTY_CHANGE_DEBUG
2571 WidthResizePolicySetter++;
2573 SetValue(WidthResizePolicyProperty, value);
2574 NotifyPropertyChanged();
2579 /// Gets or sets the height resize policy to be used.
2581 /// <since_tizen> 3 </since_tizen>
2582 public ResizePolicyType HeightResizePolicy
2586 #if NUI_PROPERTY_CHANGE_DEBUG
2587 HeightResizePolicyGetter++;
2589 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2593 #if NUI_PROPERTY_CHANGE_DEBUG
2594 HeightResizePolicySetter++;
2596 SetValue(HeightResizePolicyProperty, value);
2597 NotifyPropertyChanged();
2602 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2603 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2605 /// <since_tizen> 3 </since_tizen>
2606 public SizeScalePolicyType SizeScalePolicy
2610 #if NUI_PROPERTY_CHANGE_DEBUG
2611 SizeScalePolicyGetter++;
2613 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2617 #if NUI_PROPERTY_CHANGE_DEBUG
2618 SizeScalePolicySetter++;
2620 SetValue(SizeScalePolicyProperty, value);
2621 NotifyPropertyChanged();
2626 /// Gets or sets the status of whether the width size is dependent on the height size.
2628 /// <since_tizen> 3 </since_tizen>
2629 public bool WidthForHeight
2633 #if NUI_PROPERTY_CHANGE_DEBUG
2634 WidthForHeightGetter++;
2636 return (bool)GetValue(WidthForHeightProperty);
2640 #if NUI_PROPERTY_CHANGE_DEBUG
2641 WidthForHeightSetter++;
2643 SetValue(WidthForHeightProperty, value);
2644 NotifyPropertyChanged();
2649 /// Gets or sets the status of whether the height size is dependent on the width size.
2651 /// <since_tizen> 3 </since_tizen>
2652 public bool HeightForWidth
2656 #if NUI_PROPERTY_CHANGE_DEBUG
2657 HeightForWidthGetter++;
2659 return (bool)GetValue(HeightForWidthProperty);
2663 #if NUI_PROPERTY_CHANGE_DEBUG
2664 HeightForWidthSetter++;
2666 SetValue(HeightForWidthProperty, value);
2667 NotifyPropertyChanged();
2672 /// Gets or sets the padding for use in layout.
2675 /// The property cascade chaining set is not recommended.
2678 /// This way is recommended for setting the property
2680 /// var view = new View();
2681 /// view.Padding = new Extents(5, 5, 5, 5);
2683 /// This way to set the property is prohibited
2685 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2688 /// <since_tizen> 5 </since_tizen>
2689 public Extents Padding
2693 return (Extents)GetValue(PaddingProperty);
2697 SetValue(PaddingProperty, value);
2698 NotifyPropertyChanged();
2703 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2705 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2707 /// The property cascade chaining set is not recommended.
2710 /// This way is recommended for setting the property
2712 /// var view = new View();
2713 /// view.MinimumSize = new Size2D(100, 200);
2715 /// This way to set the property is prohibited
2717 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2720 /// <since_tizen> 3 </since_tizen>
2721 public Size2D MinimumSize
2725 #if NUI_PROPERTY_CHANGE_DEBUG
2726 MinimumSizeGetter++;
2728 return (Size2D)GetValue(MinimumSizeProperty);
2732 #if NUI_PROPERTY_CHANGE_DEBUG
2733 MinimumSizeSetter++;
2737 throw new ArgumentNullException(nameof(value));
2741 // Note: it only works if minimum size is >= than natural size.
2742 // To force the size it should be done through the width&height spec or Size2D.
2743 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2744 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2745 layout.RequestLayout();
2747 SetValue(MinimumSizeProperty, value);
2748 NotifyPropertyChanged();
2753 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2756 /// This way is recommended for setting the property
2758 /// var view = new View();
2759 /// view.MaximumSize = new Size2D(100, 200);
2761 /// This way to set the property is prohibited
2763 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2766 /// <since_tizen> 3 </since_tizen>
2767 public Size2D MaximumSize
2771 #if NUI_PROPERTY_CHANGE_DEBUG
2772 MaximumSizeGetter++;
2774 return (Size2D)GetValue(MaximumSizeProperty);
2778 #if NUI_PROPERTY_CHANGE_DEBUG
2779 MaximumSizeSetter++;
2781 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2782 // MATCH_PARENT spec + parent container size can be used to limit
2785 layout.RequestLayout();
2787 SetValue(MaximumSizeProperty, value);
2788 NotifyPropertyChanged();
2793 /// Gets or sets whether a child view inherits it's parent's position.<br />
2794 /// Default is to inherit.<br />
2795 /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.<br />
2797 /// <since_tizen> 3 </since_tizen>
2798 public bool InheritPosition
2802 #if NUI_PROPERTY_CHANGE_DEBUG
2803 InheritPositionGetter++;
2805 return (bool)GetValue(InheritPositionProperty);
2809 #if NUI_PROPERTY_CHANGE_DEBUG
2810 InheritPositionSetter++;
2812 SetValue(InheritPositionProperty, value);
2813 NotifyPropertyChanged();
2818 /// Gets or sets the clipping behavior (mode) of it's children.
2820 /// <since_tizen> 3 </since_tizen>
2821 public ClippingModeType ClippingMode
2825 #if NUI_PROPERTY_CHANGE_DEBUG
2826 ClippingModeGetter++;
2828 return (ClippingModeType)GetValue(ClippingModeProperty);
2832 #if NUI_PROPERTY_CHANGE_DEBUG
2833 ClippingModeSetter++;
2835 SetValue(ClippingModeProperty, value);
2836 NotifyPropertyChanged();
2841 /// Gets the number of renderers held by the view.
2843 /// <since_tizen> 3 </since_tizen>
2844 public uint RendererCount
2848 return GetRendererCount();
2853 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2856 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2858 /// <since_tizen> 3 </since_tizen>
2859 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2861 "View view = new View(); " +
2862 "view.PivotPoint = PivotPoint.Center; " +
2863 "view.PositionUsesPivotPoint = true;")]
2864 [EditorBrowsable(EditorBrowsableState.Never)]
2865 public Position AnchorPoint
2869 return GetValue(AnchorPointProperty) as Position;
2873 SetValue(AnchorPointProperty, value);
2877 private Position InternalAnchorPoint
2881 Position temp = new Position(0.0f, 0.0f, 0.0f);
2882 var pValue = GetProperty(View.Property.AnchorPoint);
2885 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2891 var temp = new Tizen.NUI.PropertyValue(value);
2892 SetProperty(View.Property.AnchorPoint, temp);
2894 NotifyPropertyChanged();
2899 /// Sets the size of a view for the width, the height and the depth.<br />
2900 /// Geometry can be scaled to fit within this area.<br />
2901 /// This does not interfere with the view's scale factor.<br />
2902 /// The views default depth is the minimum of width and height.<br />
2906 /// Animatable - This property can be animated using <c>Animation</c> class.
2908 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2911 /// The property cascade chaining set is not recommended.
2914 /// This way is recommended for setting the property
2916 /// var view = new View();
2917 /// view.Size = new Size(100.5f, 200, 0);
2919 /// This way to set the property is prohibited
2921 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2924 /// <since_tizen> 5 </since_tizen>
2929 #if NUI_PROPERTY_CHANGE_DEBUG
2932 return (Size)GetValue(SizeProperty);
2936 #if NUI_PROPERTY_CHANGE_DEBUG
2939 SetValue(SizeProperty, value);
2940 NotifyPropertyChanged();
2945 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2947 /// <since_tizen> 3 </since_tizen>
2948 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2950 "Container parent = view.GetParent(); " +
2951 "View view = parent as View;")]
2952 [EditorBrowsable(EditorBrowsableState.Never)]
2953 public new View Parent
2958 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2959 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2960 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2962 if (basehandle is Layer layer)
2964 ret = new View(Layer.getCPtr(layer).Handle, false);
2965 NUILog.Error("This Parent property is deprecated, should do not be used");
2969 ret = basehandle as View;
2972 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2973 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2975 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2981 /// Gets/Sets whether inherit parent's the layout Direction.
2983 /// <since_tizen> 4 </since_tizen>
2984 public bool InheritLayoutDirection
2988 #if NUI_PROPERTY_CHANGE_DEBUG
2989 InheritLayoutDirectionGetter++;
2991 return (bool)GetValue(InheritLayoutDirectionProperty);
2995 #if NUI_PROPERTY_CHANGE_DEBUG
2996 InheritLayoutDirectionSetter++;
2998 SetValue(InheritLayoutDirectionProperty, value);
2999 NotifyPropertyChanged();
3004 /// Gets/Sets the layout Direction.
3006 /// <since_tizen> 4 </since_tizen>
3007 public ViewLayoutDirectionType LayoutDirection
3011 #if NUI_PROPERTY_CHANGE_DEBUG
3012 LayoutDirectionGetter++;
3014 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
3018 #if NUI_PROPERTY_CHANGE_DEBUG
3019 LayoutDirectionSetter++;
3021 SetValue(LayoutDirectionProperty, value);
3022 NotifyPropertyChanged();
3023 layout?.RequestLayout();
3028 /// Gets or sets the Margin for use in layout.
3031 /// Margin property is supported by Layout algorithms and containers.
3032 /// Please Set Layout if you want to use Margin property.
3033 /// The property cascade chaining set is not recommended.
3036 /// This way is recommended for setting the property
3038 /// var view = new View();
3039 /// view.Margin = new Extents(10, 5, 15, 20);
3041 /// This way to set the property is prohibited
3043 /// view.Margin.Top = 15; //This does not guarantee a proper operation
3046 /// <since_tizen> 4 </since_tizen>
3047 public Extents Margin
3051 return (Extents)GetValue(MarginProperty);
3055 SetValue(MarginProperty, value);
3056 NotifyPropertyChanged();
3061 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
3065 /// // matchParentView matches its size to its parent size.
3066 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
3067 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
3069 /// // wrapContentView wraps its children with their desired size.
3070 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
3071 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
3073 /// // exactSizeView shows itself with an exact size.
3074 /// exactSizeView.WidthSpecification = 100;
3075 /// exactSizeView.HeightSpecification = 100;
3078 /// <since_tizen> 6 </since_tizen>
3079 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
3080 public int WidthSpecification
3084 return (int)GetValue(WidthSpecificationProperty);
3088 SetValue(WidthSpecificationProperty, value);
3089 NotifyPropertyChanged();
3093 private int InternalWidthSpecification
3101 if (value == widthPolicy)
3104 widthPolicy = value;
3105 if (widthPolicy >= 0)
3107 if (heightPolicy >= 0) // Policy an exact value
3109 // Create Size2D only both _widthPolicy and _heightPolicy are set.
3110 Size2D = new Size2D(widthPolicy, heightPolicy);
3113 layout?.RequestLayout();
3118 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
3122 /// // matchParentView matches its size to its parent size.
3123 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
3124 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
3126 /// // wrapContentView wraps its children with their desired size.
3127 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
3128 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
3130 /// // exactSizeView shows itself with an exact size.
3131 /// exactSizeView.WidthSpecification = 100;
3132 /// exactSizeView.HeightSpecification = 100;
3135 /// <since_tizen> 6 </since_tizen>
3136 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
3137 public int HeightSpecification
3141 return (int)GetValue(HeightSpecificationProperty);
3145 SetValue(HeightSpecificationProperty, value);
3146 NotifyPropertyChanged();
3150 private int InternalHeightSpecification
3154 return heightPolicy;
3158 if (value == heightPolicy)
3161 heightPolicy = value;
3162 if (heightPolicy >= 0)
3164 if (widthPolicy >= 0) // Policy an exact value
3166 // Create Size2D only both _widthPolicy and _heightPolicy are set.
3167 Size2D = new Size2D(widthPolicy, heightPolicy);
3170 layout?.RequestLayout();
3175 /// Gets the List of transitions for this View.
3177 /// <since_tizen> 6 </since_tizen>
3178 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
3182 if (layoutTransitions == null)
3184 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
3186 return layoutTransitions;
3191 /// Sets a layout transitions for this View.
3193 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
3195 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
3197 /// <since_tizen> 6 </since_tizen>
3198 public LayoutTransition LayoutTransition
3202 return GetValue(LayoutTransitionProperty) as LayoutTransition;
3206 SetValue(LayoutTransitionProperty, value);
3207 NotifyPropertyChanged();
3211 private LayoutTransition InternalLayoutTransition
3215 return layoutTransition;
3221 throw new global::System.ArgumentNullException(nameof(value));
3223 if (layoutTransitions == null)
3225 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
3228 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
3230 AttachTransitionsToChildren(value);
3232 layoutTransition = value;
3237 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
3240 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
3242 /// <since_tizen> 4 </since_tizen>
3243 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
3244 [EditorBrowsable(EditorBrowsableState.Never)]
3245 public Extents PaddingEX
3249 return GetValue(PaddingEXProperty) as Extents;
3253 SetValue(PaddingEXProperty, value);
3257 private Extents InternalPaddingEX
3261 Extents temp = new Extents(0, 0, 0, 0);
3262 var pValue = GetProperty(View.Property.PADDING);
3265 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
3271 var temp = new Tizen.NUI.PropertyValue(value);
3272 SetProperty(View.Property.PADDING, temp);
3274 NotifyPropertyChanged();
3275 layout?.RequestLayout();
3280 /// The Color of View. This is an RGBA value.
3281 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
3282 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
3283 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
3284 /// Inherient of color value depend on <see cref="ColorMode"/>.
3288 /// Animatable - This property can be animated using <c>Animation</c> class.
3290 /// The property cascade chaining set is not recommended.
3293 /// This way is recommended for setting the property
3295 /// var view = new View();
3296 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
3298 /// This way to set the property is prohibited
3300 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
3303 [EditorBrowsable(EditorBrowsableState.Never)]
3308 #if NUI_PROPERTY_CHANGE_DEBUG
3311 return (Color)GetValue(ColorProperty);
3315 #if NUI_PROPERTY_CHANGE_DEBUG
3318 SetValue(ColorProperty, value);
3319 NotifyPropertyChanged();
3324 /// The Red component of View.Color.
3328 /// Animatable - This property can be animated using <c>Animation</c> class.
3331 [EditorBrowsable(EditorBrowsableState.Never)]
3332 public float ColorRed
3336 #if NUI_PROPERTY_CHANGE_DEBUG
3339 return (float)GetValue(ColorRedProperty);
3343 #if NUI_PROPERTY_CHANGE_DEBUG
3346 SetValue(ColorRedProperty, value);
3347 NotifyPropertyChanged();
3352 /// The Green component of View.Color.
3356 /// Animatable - This property can be animated using <c>Animation</c> class.
3359 [EditorBrowsable(EditorBrowsableState.Never)]
3360 public float ColorGreen
3364 #if NUI_PROPERTY_CHANGE_DEBUG
3367 return (float)GetValue(ColorGreenProperty);
3371 #if NUI_PROPERTY_CHANGE_DEBUG
3374 SetValue(ColorGreenProperty, value);
3375 NotifyPropertyChanged();
3380 /// The Blue component of View.Color.
3384 /// Animatable - This property can be animated using <c>Animation</c> class.
3387 [EditorBrowsable(EditorBrowsableState.Never)]
3388 public float ColorBlue
3392 #if NUI_PROPERTY_CHANGE_DEBUG
3395 return (float)GetValue(ColorBlueProperty);
3399 #if NUI_PROPERTY_CHANGE_DEBUG
3402 SetValue(ColorBlueProperty, value);
3403 NotifyPropertyChanged();
3408 /// Set the layout on this View. Replaces any existing Layout.
3411 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
3413 /// <since_tizen> 6 </since_tizen>
3414 public LayoutItem Layout
3418 return GetValue(LayoutProperty) as LayoutItem;
3422 SetValue(LayoutProperty, value);
3426 private LayoutItem InternalLayout
3434 // Do nothing if layout provided is already set on this View.
3435 if (value == layout)
3440 LayoutingDisabled = false;
3443 // If new layout being set already has a owner then that owner receives a replacement default layout.
3444 // First check if the layout to be set already has a owner.
3445 if (value?.Owner != null)
3447 // Previous owner of the layout gets a default layout as a replacement.
3448 value.Owner.Layout = new AbsoluteLayout()
3450 // Copy Margin and Padding to replacement LayoutGroup.
3451 Margin = value.Margin,
3452 Padding = value.Padding,
3456 // Copy Margin and Padding to new layout being set or restore padding and margin back to
3457 // View if no replacement. Previously margin and padding values would have been moved from
3458 // the View to the layout.
3459 if (layout != null) // Existing layout
3463 // Existing layout being replaced so copy over margin and padding values.
3464 value.Margin = layout.Margin;
3465 value.Padding = layout.Padding;
3466 value.SetPositionByLayout = !excludeLayouting;
3470 // Layout not being replaced so restore margin and padding to View.
3471 SetValue(MarginProperty, layout.Margin);
3472 SetValue(PaddingProperty, layout.Padding);
3473 NotifyPropertyChanged();
3478 // First Layout to be added to the View hence copy
3480 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
3483 Extents margin = Margin;
3484 Extents padding = Padding;
3485 bool setMargin = false;
3486 bool setPadding = false;
3488 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3490 // If View already has a margin set then store it in Layout instead.
3491 value.Margin = margin;
3492 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3496 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3498 // If View already has a padding set then store it in Layout instead.
3499 value.Padding = padding;
3500 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3504 if (setMargin || setPadding)
3506 NotifyPropertyChanged();
3509 value.SetPositionByLayout = !excludeLayouting;
3513 // Remove existing layout from it's parent layout group.
3516 // Set layout to this view
3522 /// The weight of the View, used to share available space in a layout with siblings.
3524 /// <since_tizen> 6 </since_tizen>
3534 layout?.RequestLayout();
3539 /// Whether to load the BackgroundImage synchronously.
3540 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3541 /// Note: For Normal Quad images only.
3543 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3544 [EditorBrowsable(EditorBrowsableState.Never)]
3545 public bool BackgroundImageSynchronosLoading
3549 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3553 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3554 NotifyPropertyChanged();
3558 private bool InternalBackgroundImageSynchronosLoading
3562 return BackgroundImageSynchronousLoading;
3566 BackgroundImageSynchronousLoading = value;
3571 /// Whether to load the BackgroundImage synchronously.
3572 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3573 /// Note: For Normal Quad images only.
3575 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3576 [EditorBrowsable(EditorBrowsableState.Never)]
3577 public bool BackgroundImageSynchronousLoading
3581 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3585 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3586 NotifyPropertyChanged();
3590 private bool InternalBackgroundImageSynchronousLoading
3594 return backgroundImageSynchronousLoading;
3598 backgroundImageSynchronousLoading = value;
3600 string bgUrl = null;
3601 var pValue = Background.Find(ImageVisualProperty.URL);
3602 pValue?.Get(out bgUrl);
3605 if (!string.IsNullOrEmpty(bgUrl))
3607 PropertyMap bgMap = this.Background;
3608 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3609 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3616 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3617 [EditorBrowsable(EditorBrowsableState.Never)]
3618 public Vector4 UpdateAreaHint
3622 #if NUI_PROPERTY_CHANGE_DEBUG
3623 UpdateAreaHintGetter++;
3625 return (Vector4)GetValue(UpdateAreaHintProperty);
3629 #if NUI_PROPERTY_CHANGE_DEBUG
3630 UpdateAreaHintSetter++;
3632 SetValue(UpdateAreaHintProperty, value);
3633 NotifyPropertyChanged();
3638 /// Enable/Disable ControlState propagation for children.
3639 /// It is false by default.
3640 /// If the View needs to share ControlState with descendants, please set it true.
3641 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3643 [EditorBrowsable(EditorBrowsableState.Never)]
3644 public bool EnableControlStatePropagation
3648 return (bool)GetValue(EnableControlStatePropagationProperty);
3652 SetValue(EnableControlStatePropagationProperty, value);
3653 NotifyPropertyChanged();
3657 private bool InternalEnableControlStatePropagation
3659 get => themeData?.ControlStatePropagation ?? false;
3662 if (InternalEnableControlStatePropagation == value) return;
3664 if (themeData == null) themeData = new ThemeData();
3666 themeData.ControlStatePropagation = value;
3668 foreach (View child in Children)
3670 child.EnableControlStatePropagation = value;
3676 /// The ControlStates can propagate from the parent.
3677 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3678 /// if parent view EnableControlState is true.
3679 /// <see cref="EnableControlState"/>.
3680 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3682 [EditorBrowsable(EditorBrowsableState.Never)]
3683 public ControlState PropagatableControlStates
3687 return (ControlState)GetValue(PropagatableControlStatesProperty);
3691 SetValue(PropagatableControlStatesProperty, value);
3692 NotifyPropertyChanged();
3696 private ControlState InternalPropagatableControlStates
3698 get => propagatableControlStates;
3699 set => propagatableControlStates = value;
3703 /// By default, it is false in View, true in Control.
3704 /// Note that if the value is true, the View will be a touch receptor.
3706 [EditorBrowsable(EditorBrowsableState.Never)]
3707 public bool EnableControlState
3711 return (bool)GetValue(EnableControlStateProperty);
3715 SetValue(EnableControlStateProperty, value);
3720 /// Whether the actor grab all touches even if touch leaves its boundary.
3722 /// <returns>true, if it grab all touch after start</returns>
3723 [EditorBrowsable(EditorBrowsableState.Never)]
3724 public bool GrabTouchAfterLeave
3728 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3732 SetValue(GrabTouchAfterLeaveProperty, value);
3736 private bool InternalGrabTouchAfterLeave
3741 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3742 pValue.Get(out temp);
3748 var temp = new Tizen.NUI.PropertyValue(value);
3749 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3751 NotifyPropertyChanged();
3756 /// Whether the view will only receive own touch.
3758 /// <returns>true, if it only receives touches that started from itself.</returns>
3759 [EditorBrowsable(EditorBrowsableState.Never)]
3760 public bool AllowOnlyOwnTouch
3764 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3768 SetValue(AllowOnlyOwnTouchProperty, value);
3772 private bool InternalAllowOnlyOwnTouch
3777 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3778 pValue.Get(out temp);
3784 var temp = new Tizen.NUI.PropertyValue(value);
3785 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3787 NotifyPropertyChanged();
3792 /// Determines which blend equation will be used to render renderers of this actor.
3794 /// <returns>blend equation enum currently assigned</returns>
3795 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3796 [EditorBrowsable(EditorBrowsableState.Never)]
3797 public BlendEquationType BlendEquation
3801 return (BlendEquationType)GetValue(BlendEquationProperty);
3805 SetValue(BlendEquationProperty, value);
3809 private BlendEquationType InternalBlendEquation
3814 var pValue = GetProperty(View.Property.BlendEquation);
3815 pValue.Get(out temp);
3817 return (BlendEquationType)temp;
3821 var temp = new Tizen.NUI.PropertyValue((int)value);
3822 SetProperty(View.Property.BlendEquation, temp);
3824 NotifyPropertyChanged();
3829 /// If the value is true, the View will change its style as the theme changes.
3830 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3832 /// <since_tizen> 9 </since_tizen>
3833 public bool ThemeChangeSensitive
3835 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3836 set => SetValue(ThemeChangeSensitiveProperty, value);
3840 /// Create Style, it is abstract function and must be override.
3842 [EditorBrowsable(EditorBrowsableState.Never)]
3843 protected virtual ViewStyle CreateViewStyle()
3845 return new ViewStyle();
3849 /// Called after the View's ControlStates changed.
3851 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3852 [EditorBrowsable(EditorBrowsableState.Never)]
3853 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3859 [EditorBrowsable(EditorBrowsableState.Never)]
3860 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3862 isThemeChanged = true;
3863 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3864 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3865 isThemeChanged = false;
3869 /// Apply style instance to the view.
3870 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3872 /// <since_tizen> 9 </since_tizen>
3873 public virtual void ApplyStyle(ViewStyle viewStyle)
3875 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3877 if (themeData == null) themeData = new ThemeData();
3879 themeData.viewStyle = viewStyle;
3881 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3887 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3889 if (bindablePropertyOfView == null)
3894 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3895 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3897 foreach (var sourceProperty in dirtyStyleProperties)
3899 var sourceValue = viewStyle.GetValue(sourceProperty);
3901 if (sourceValue == null)
3906 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3908 // Do not set value again when theme is changed and the value has been set already.
3909 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3914 if (destinationProperty != null)
3916 InternalSetValue(destinationProperty, sourceValue);
3922 /// Get whether the View is culled or not.
3923 /// True means that the View is out of the view frustum.
3926 /// Hidden-API (Inhouse-API).
3928 [EditorBrowsable(EditorBrowsableState.Never)]
3934 var pValue = GetProperty(View.Property.Culled);
3935 pValue.Get(out temp);
3942 /// Set or Get TransitionOptions for the page transition.
3943 /// This property is used to define how this view will be transitioned during Page switching.
3945 /// <since_tizen> 9 </since_tizen>
3946 public TransitionOptions TransitionOptions
3950 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3954 SetValue(TransitionOptionsProperty, value);
3955 NotifyPropertyChanged();
3959 private TransitionOptions InternalTransitionOptions
3963 transitionOptions = value;
3967 return transitionOptions;
3972 /// Gets or sets the status of whether the view should emit key event signals.
3973 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3975 [EditorBrowsable(EditorBrowsableState.Never)]
3976 public bool DispatchKeyEvents
3980 #if NUI_PROPERTY_CHANGE_DEBUG
3981 DispatchKeyEventsGetter++;
3983 return (bool)GetValue(DispatchKeyEventsProperty);
3987 #if NUI_PROPERTY_CHANGE_DEBUG
3988 DispatchKeyEventsSetter++;
3990 SetValue(DispatchKeyEventsProperty, value);
3991 NotifyPropertyChanged();
3996 /// Gets or sets the status of whether touch events can be dispatched.
3997 /// If a View's DispatchTouchEvents is set to false, then it's can not will receive touch and parents will not receive a touch event signal either.
3998 /// This works without adding a TouchEvent callback in the View.
4000 /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit touch event.
4003 [EditorBrowsable(EditorBrowsableState.Never)]
4004 public bool DispatchTouchEvents
4008 return dispatchTouchEvents;
4012 if (dispatchTouchEvents != value)
4014 dispatchTouchEvents = value;
4015 if (dispatchTouchEvents == false)
4017 TouchEvent += OnDispatchTouchEvent;
4021 TouchEvent -= OnDispatchTouchEvent;
4027 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
4033 /// Gets or sets the status of whether the view should emit Gesture event signals.
4034 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
4035 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
4037 [EditorBrowsable(EditorBrowsableState.Never)]
4038 public bool DispatchGestureEvents
4042 return dispatchGestureEvents;
4046 if (dispatchGestureEvents != value)
4048 dispatchGestureEvents = value;
4049 ConfigGestureDetector(dispatchGestureEvents);
4055 /// Gets or sets the status of whether the view should emit Gesture event signals.
4056 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
4057 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
4059 [EditorBrowsable(EditorBrowsableState.Never)]
4060 public bool DispatchParentGestureEvents
4064 return dispatchParentGestureEvents;
4068 if (dispatchParentGestureEvents != value)
4070 dispatchParentGestureEvents = value;
4071 ConfigGestureDetector(dispatchParentGestureEvents);
4076 private void ConfigGestureDetector(bool dispatch)
4078 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
4079 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
4080 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
4081 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
4082 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
4084 if (dispatch == true)
4086 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
4087 if (configGestureCount == 0)
4089 panGestureDetector.Detach(this);
4090 longGestureDetector.Detach(this);
4091 pinchGestureDetector.Detach(this);
4092 tapGestureDetector.Detach(this);
4093 rotationGestureDetector.Detach(this);
4095 panGestureDetector.Detected -= OnGestureDetected;
4096 longGestureDetector.Detected -= OnGestureDetected;
4097 pinchGestureDetector.Detected -= OnGestureDetected;
4098 tapGestureDetector.Detected -= OnGestureDetected;
4099 rotationGestureDetector.Detected -= OnGestureDetected;
4101 panGestureDetector = null;
4102 longGestureDetector = null;
4103 pinchGestureDetector = null;
4104 tapGestureDetector = null;
4105 rotationGestureDetector = null;
4110 if (configGestureCount == 0)
4112 panGestureDetector.Attach(this);
4113 longGestureDetector.Attach(this);
4114 pinchGestureDetector.Attach(this);
4115 tapGestureDetector.Attach(this);
4116 rotationGestureDetector.Attach(this);
4118 panGestureDetector.Detected += OnGestureDetected;
4119 longGestureDetector.Detected += OnGestureDetected;
4120 pinchGestureDetector.Detected += OnGestureDetected;
4121 tapGestureDetector.Detected += OnGestureDetected;
4122 rotationGestureDetector.Detected += OnGestureDetected;
4124 configGestureCount++;
4128 private void OnGestureDetected(object source, EventArgs e)
4130 // Does notting. This is to consume the gesture.
4134 /// Called when the view is hit through TouchEvent or GestureEvent.
4135 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
4136 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
4137 /// User can override whether hit or not in HitTest.
4138 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
4139 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
4141 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
4142 [EditorBrowsable(EditorBrowsableState.Never)]
4143 protected virtual bool HitTest(Touch touch)
4149 /// Retrieve the View's current Color.
4152 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
4153 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
4154 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
4155 /// and users can get the current actual values through them.
4157 [EditorBrowsable(EditorBrowsableState.Never)]
4158 public Color CurrentColor => GetCurrentColor();
4161 /// Retrieve the current scale factor applied to the View.
4164 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
4165 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
4166 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
4167 /// and users can get the current actual values through them.
4169 [EditorBrowsable(EditorBrowsableState.Never)]
4170 public Vector3 CurrentScale => GetCurrentScale();