[NUI] Remove useless macros
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
1 /*
2  * Copyright(c) 2022 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
22
23 namespace Tizen.NUI.BaseComponents
24 {
25     /// <summary>
26     /// View is the base class for all views.
27     /// </summary>
28     /// <since_tizen> 3 </since_tizen>
29     public partial class View : Container, IResourcesProvider
30     {
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;
36
37         internal BackgroundExtraData backgroundExtraData;
38
39         private bool layoutSet = false;
40         private LayoutItem layout; // Exclusive layout assigned to this View.
41
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;
53
54         // List of constraints
55         private Constraint widthConstraint = null;
56         private Constraint heightConstraint = null;
57
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;
74
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;
85         private string internalName = string.Empty;
86         private Position internalCurrentParentOrigin = null;
87         private Position internalCurrentAnchorPoint = null;
88         private Vector3 internalTargetSize = null;
89         private Size2D internalCurrentSize = null;
90         private Vector3 internalNaturalSize = null;
91         private Position internalCurrentPosition = null;
92         private Vector3 internalCurrentWorldPosition = null;
93         private Vector3 internalCurrentScale = null;
94         private Vector3 internalCurrentWorldScale = null;
95         private Vector4 internalCurrentColor = null;
96         private Vector4 internalCurrentWorldColor = null;
97         private Vector2 internalCurrentScreenPosition = null;
98
99         static View()
100         {
101             RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
102             RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
103             RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
104             RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
105
106             RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
107             RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
108             RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
109             RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
110
111             RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
112             RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
113             RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
114             RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
115
116             RegisterAccessibilityDelegate();
117         }
118
119         /// <summary>
120         /// Creates a new instance of a view.
121         /// </summary>
122         /// <since_tizen> 3 </since_tizen>
123         public View() : this(Interop.View.New(), true)
124         {
125             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126         }
127
128         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
129         [EditorBrowsable(EditorBrowsableState.Never)]
130         public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
131         {
132         }
133
134         /// <summary>
135         /// Create a new instance of a View with setting the status of shown or hidden.
136         /// </summary>
137         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
138         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
139         [EditorBrowsable(EditorBrowsableState.Never)]
140         public View(bool shown) : this(Interop.View.New(), true)
141         {
142             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143             SetVisible(shown);
144         }
145
146         internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
147         {
148             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149             if (!shown)
150             {
151                 SetVisible(false);
152             }
153
154             backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
155         }
156
157         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
158         {
159             InitializeStyle(viewStyle);
160         }
161
162         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
163         {
164             if (HasBody())
165             {
166                 PositionUsesPivotPoint = false;
167             }
168
169             onWindowSendEventCallback = SendViewAddedEventToWindow;
170             using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
171             signal?.Connect(onWindowSendEventCallback);
172
173             hitTestResultDataCallback = OnHitTestResult;
174             using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
175             touchDataSignal?.Connect(hitTestResultDataCallback);
176
177             if (!shown)
178             {
179                 SetVisible(false);
180             }
181
182             GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
183             AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
184         }
185
186         internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
187         {
188             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189
190             if (!shown)
191             {
192                 SetVisible(false);
193             }
194         }
195
196         /// <summary>
197         /// The event that is triggered when the View's ControlState is changed.
198         /// </summary>
199         [EditorBrowsable(EditorBrowsableState.Never)]
200         public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
201
202         internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
203
204
205         /// <summary>
206         /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
207         /// </summary>
208         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
209         [EditorBrowsable(EditorBrowsableState.Never)]
210         public bool LayoutSet
211         {
212             get
213             {
214                 return layoutSet;
215             }
216         }
217
218         /// <summary>
219         /// Flag to allow Layouting to be disabled for Views.
220         /// Once a View has a Layout set then any children added to Views from then on will receive
221         /// automatic Layouts.
222         /// </summary>
223         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
224         [EditorBrowsable(EditorBrowsableState.Never)]
225         public static bool LayoutingDisabled { get; set; } = true;
226
227         /// <summary>
228         /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
229         /// </summary>
230         /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
231         [EditorBrowsable(EditorBrowsableState.Never)]
232         public static void SetDefaultGrabTouchAfterLeave(bool enable)
233         {
234             defaultGrabTouchAfterLeave = enable;
235         }
236
237         /// <summary>
238         /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
239         /// </summary>
240         /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
241         [EditorBrowsable(EditorBrowsableState.Never)]
242         public static void SetDefaultAllowOnlyOwnTouch(bool enable)
243         {
244             defaultAllowOnlyOwnTouch = enable;
245         }
246
247         /// <summary>
248         /// Deprecate. Do not use this.
249         /// The style instance applied to this view.
250         /// Note that do not modify the ViewStyle.
251         /// Modifying ViewStyle will affect other views with same ViewStyle.
252         /// </summary>
253         [EditorBrowsable(EditorBrowsableState.Never)]
254         protected ViewStyle ViewStyle
255         {
256             get
257             {
258                 if (themeData == null) themeData = new ThemeData();
259
260                 if (themeData.viewStyle == null)
261                 {
262                     ApplyStyle(CreateViewStyle());
263                 }
264                 return themeData.viewStyle;
265             }
266         }
267
268         /// <summary>
269         /// Get/Set the control state.
270         /// Note that the ControlState only available for the classes derived from Control.
271         /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
272         /// please set <see cref="EnableControlState"/> to true.
273         /// </summary>
274         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
275         [EditorBrowsable(EditorBrowsableState.Never)]
276         public ControlState ControlState
277         {
278             get
279             {
280                 return themeData == null ? ControlState.Normal : themeData.controlStates;
281             }
282             protected set
283             {
284                 if (ControlState == value)
285                 {
286                     return;
287                 }
288
289                 var prevState = ControlState;
290
291                 if (themeData == null) themeData = new ThemeData();
292                 themeData.controlStates = value;
293
294                 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
295
296                 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
297
298                 if (themeData.ControlStatePropagation)
299                 {
300                     foreach (View child in Children)
301                     {
302                         ControlState allowed = child.PropagatableControlStates;
303                         if (allowed.Contains(ControlState.All))
304                         {
305                             child.ControlState = value;
306                         }
307                         else
308                         {
309                             ControlState newControlState = child.ControlState;
310
311                             if (allowed.Contains(ControlState.Normal))
312                             {
313                                 if (value.Contains(ControlState.Normal))
314                                 {
315                                     newControlState += ControlState.Normal;
316                                 }
317                                 else
318                                 {
319                                     newControlState -= ControlState.Normal;
320                                 }
321                             }
322
323                             if (allowed.Contains(ControlState.Disabled))
324                             {
325                                 if (value.Contains(ControlState.Disabled))
326                                 {
327                                     newControlState += ControlState.Disabled;
328                                 }
329                                 else
330                                 {
331                                     newControlState -= ControlState.Disabled;
332                                 }
333                             }
334
335                             if (allowed.Contains(ControlState.Selected))
336                             {
337                                 if (value.Contains(ControlState.Selected))
338                                 {
339                                     newControlState += ControlState.Selected;
340                                 }
341                                 else
342                                 {
343                                     newControlState -= ControlState.Selected;
344                                 }
345                             }
346
347                             if (allowed.Contains(ControlState.Pressed))
348                             {
349                                 if (value.Contains(ControlState.Pressed))
350                                 {
351                                     newControlState += ControlState.Pressed;
352                                 }
353                                 else
354                                 {
355                                     newControlState -= ControlState.Pressed;
356                                 }
357                             }
358
359                             if (allowed.Contains(ControlState.Focused))
360                             {
361                                 if (value.Contains(ControlState.Focused))
362                                 {
363                                     newControlState += ControlState.Focused;
364                                 }
365                                 else
366                                 {
367                                     newControlState -= ControlState.Focused;
368                                 }
369                             }
370
371                             if (allowed.Contains(ControlState.Other))
372                             {
373                                 if (value.Contains(ControlState.Other))
374                                 {
375                                     newControlState += ControlState.Other;
376                                 }
377                                 else
378                                 {
379                                     newControlState -= ControlState.Other;
380                                 }
381                             }
382
383                             if (child.ControlState != newControlState)
384                             child.ControlState = newControlState;
385                         }
386                     }
387                 }
388
389                 OnControlStateChanged(changeInfo);
390
391                 ControlStateChangedEvent?.Invoke(this, changeInfo);
392             }
393         }
394
395         /// <summary>
396         /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
397         /// </summary>
398         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
399         [EditorBrowsable(EditorBrowsableState.Never)]
400         public bool ExcludeLayouting
401         {
402             get
403             {
404                 return (bool)GetValue(ExcludeLayoutingProperty);
405             }
406             set
407             {
408                 SetValue(ExcludeLayoutingProperty, value);
409                 NotifyPropertyChanged();
410             }
411         }
412
413         private bool InternalExcludeLayouting
414         {
415             get
416             {
417                 return excludeLayouting;
418             }
419             set
420             {
421                 excludeLayouting = value;
422                 if (Layout != null && Layout.SetPositionByLayout == value)
423                 {
424                     Layout.SetPositionByLayout = !value;
425                     Layout.RequestLayout();
426                 }
427             }
428         }
429
430         /// <summary>
431         /// The StyleName, type string.
432         /// The value indicates DALi style name defined in json theme file.
433         /// </summary>
434         /// <since_tizen> 3 </since_tizen>
435         public string StyleName
436         {
437             get
438             {
439                 return (string)GetValue(StyleNameProperty);
440             }
441             set
442             {
443                 SetValue(StyleNameProperty, value);
444                 NotifyPropertyChanged();
445             }
446         }
447
448         /// <summary>
449         /// The KeyInputFocus, type bool.
450         /// </summary>
451         [EditorBrowsable(EditorBrowsableState.Never)]
452         public bool KeyInputFocus
453         {
454             get
455             {
456                 return (bool)GetValue(KeyInputFocusProperty);
457             }
458             set
459             {
460                 SetValue(KeyInputFocusProperty, value);
461                 NotifyPropertyChanged();
462             }
463         }
464
465         /// <summary>
466         /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
467         /// </summary>
468         /// <remarks>
469         /// <para>
470         /// The property cascade chaining set is not recommended.
471         /// </para>
472         /// <para>
473         /// Animatable - This property can be animated using <c>Animation</c> class.
474         /// <code>
475         /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
476         /// </code>
477         /// </para>
478         /// </remarks>
479         /// <example>
480         /// This way is recommended for setting the property
481         /// <code>
482         /// var view = new View();
483         /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
484         /// </code>
485         /// This way to set the property is prohibited
486         /// <code>
487         /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
488         /// </code>
489         /// </example>
490         /// <since_tizen> 3 </since_tizen>
491         public Color BackgroundColor
492         {
493             get
494             {
495                 return (Color)GetValue(BackgroundColorProperty);
496             }
497             set
498             {
499                 SetValue(BackgroundColorProperty, value);
500                 NotifyPropertyChanged();
501             }
502         }
503
504         /// <summary>
505         /// The mutually exclusive with "backgroundColor" and "background" type Map.
506         /// </summary>
507         /// <since_tizen> 3 </since_tizen>
508         public string BackgroundImage
509         {
510             get
511             {
512                 return (string)GetValue(BackgroundImageProperty);
513             }
514             set
515             {
516                 SetValue(BackgroundImageProperty, value);
517                 NotifyPropertyChanged();
518             }
519         }
520
521         /// <summary>
522         /// Get or set the border of background image.
523         /// </summary>
524         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
525         [EditorBrowsable(EditorBrowsableState.Never)]
526         public Rectangle BackgroundImageBorder
527         {
528             get
529             {
530                 return (Rectangle)GetValue(BackgroundImageBorderProperty);
531             }
532             set
533             {
534                 SetValue(BackgroundImageBorderProperty, value);
535                 NotifyPropertyChanged();
536             }
537         }
538
539         /// <summary>
540         /// The background of view.
541         /// </summary>
542         /// <since_tizen> 3 </since_tizen>
543         public Tizen.NUI.PropertyMap Background
544         {
545             get
546             {
547                 return (PropertyMap)GetValue(BackgroundProperty);
548             }
549             set
550             {
551                 SetValue(BackgroundProperty, value);
552                 NotifyPropertyChanged();
553             }
554         }
555
556         /// <summary>
557         /// Describes a shadow as an image for a View.
558         /// It is null by default.
559         /// </summary>
560         /// <remarks>
561         /// Getter returns copied instance of current shadow.
562         /// </remarks>
563         /// <remarks>
564         /// The mutually exclusive with "BoxShadow".
565         /// </remarks>
566         /// <remarks>
567         /// <para>
568         /// Animatable - This property can be animated using <c>Animation</c> class.
569         /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
570         /// <code>
571         /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
572         /// </code>
573         /// Animatable sub-property : Offset.
574         /// </para>
575         /// </remarks>
576         [EditorBrowsable(EditorBrowsableState.Never)]
577         public ImageShadow ImageShadow
578         {
579             get
580             {
581                 return (ImageShadow)GetValue(ImageShadowProperty);
582             }
583             set
584             {
585                 SetValue(ImageShadowProperty, value);
586                 NotifyPropertyChanged();
587             }
588         }
589
590         /// <summary>
591         /// Describes a box shaped shadow drawing for a View.
592         /// It is null by default.
593         /// </summary>
594         /// <remarks>
595         /// The mutually exclusive with "ImageShadow".
596         /// </remarks>
597         /// <remarks>
598         /// <para>
599         /// Animatable - This property can be animated using <c>Animation</c> class.
600         /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
601         /// <code>
602         /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
603         /// </code>
604         /// Animatable sub-property : Offset, Color, BlurRadius.
605         /// </para>
606         /// </remarks>
607         /// <since_tizen> 9 </since_tizen>
608         public Shadow BoxShadow
609         {
610             get
611             {
612                 return (Shadow)GetValue(BoxShadowProperty);
613             }
614             set
615             {
616                 SetValue(BoxShadowProperty, value);
617                 NotifyPropertyChanged();
618             }
619         }
620
621         /// <summary>
622         /// The radius for the rounded corners of the View.
623         /// This will rounds background and shadow edges.
624         /// 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).
625         /// Each radius will clamp internally to the half of smaller of the view's width or height.
626         /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
627         /// </summary>
628         /// <remarks>
629         /// <para>
630         /// Animatable - This property can be animated using <c>Animation</c> class.
631         /// <code>
632         /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
633         /// </code>
634         /// </para>
635         /// </remarks>
636         /// <since_tizen> 9 </since_tizen>
637         public Vector4 CornerRadius
638         {
639             get
640             {
641                 return (Vector4)GetValue(CornerRadiusProperty);
642             }
643             set
644             {
645                 SetValue(CornerRadiusProperty, value);
646                 NotifyPropertyChanged();
647             }
648         }
649
650         /// <summary>
651         /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
652         /// It is absolute by default.
653         /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
654         /// </summary>
655         /// <since_tizen> 9 </since_tizen>
656         public VisualTransformPolicyType CornerRadiusPolicy
657         {
658             get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
659             set => SetValue(CornerRadiusPolicyProperty, value);
660         }
661
662         /// <summary>
663         /// The width for the borderline of the View.
664         /// </summary>
665         /// <remarks>
666         /// <para>
667         /// Animatable - This property can be animated using <c>Animation</c> class.
668         /// <code>
669         /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
670         /// </code>
671         /// </para>
672         /// Note that, an image background may not have borderline if it uses the Border property.
673         /// </remarks>
674         /// <since_tizen> 9 </since_tizen>
675         public float BorderlineWidth
676         {
677             get
678             {
679                 return (float)GetValue(BorderlineWidthProperty);
680             }
681             set
682             {
683                 SetValue(BorderlineWidthProperty, value);
684                 NotifyPropertyChanged();
685             }
686         }
687
688         /// <summary>
689         /// The color for the borderline of the View.
690         /// It is Color.Black by default.
691         /// </summary>
692         /// <remarks>
693         /// <para>
694         /// Animatable - This property can be animated using <c>Animation</c> class.
695         /// <code>
696         /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
697         /// </code>
698         /// </para>
699         /// </remarks>
700         /// <since_tizen> 9 </since_tizen>
701         public Color BorderlineColor
702         {
703             get
704             {
705                 return (Color)GetValue(BorderlineColorProperty);
706             }
707             set
708             {
709                 SetValue(BorderlineColorProperty, value);
710                 NotifyPropertyChanged();
711             }
712         }
713
714         /// <summary>
715         /// The color selector for the borderline of the View.
716         /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
717         /// So this API is internally used only.
718         /// </summary>
719         internal Selector<Color> BorderlineColorSelector
720         {
721             get
722             {
723                 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
724             }
725             set
726             {
727                 SetValue(BorderlineColorSelectorProperty, value);
728                 NotifyPropertyChanged();
729             }
730         }
731
732         /// <summary>
733         /// The Relative offset for the borderline of the View.
734         /// Recommended range : [-1.0f to 1.0f].
735         /// If -1.0f, draw borderline inside of the View.
736         /// If 1.0f, draw borderline outside of the View.
737         /// If 0.0f, draw borderline half inside and half outside.
738         /// It is 0.0f by default.
739         /// </summary>
740         /// <remarks>
741         /// <para>
742         /// Animatable - This property can be animated using <c>Animation</c> class.
743         /// <code>
744         /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
745         /// </code>
746         /// </para>
747         /// </remarks>
748         /// <since_tizen> 9 </since_tizen>
749         public float BorderlineOffset
750         {
751             get
752             {
753                 return (float)GetValue(BorderlineOffsetProperty);
754             }
755             set
756             {
757                 SetValue(BorderlineOffsetProperty, value);
758                 NotifyPropertyChanged();
759             }
760         }
761
762         /// <summary>
763         /// The current state of the view.
764         /// </summary>
765         /// <since_tizen> 3 </since_tizen>
766         public States State
767         {
768             get
769             {
770                 return (States)GetValue(StateProperty);
771             }
772             set
773             {
774                 SetValue(StateProperty, value);
775                 NotifyPropertyChanged();
776             }
777         }
778
779         /// <summary>
780         /// The current sub state of the view.
781         /// </summary>
782         /// <since_tizen> 3 </since_tizen>
783         public States SubState
784         {
785             get
786             {
787                 return (States)GetValue(SubStateProperty);
788             }
789             set
790             {
791                 SetValue(SubStateProperty, value);
792                 NotifyPropertyChanged();
793             }
794         }
795
796         /// <summary>
797         /// Displays a tooltip
798         /// </summary>
799         /// <since_tizen> 3 </since_tizen>
800         public Tizen.NUI.PropertyMap Tooltip
801         {
802             get
803             {
804                 return (PropertyMap)GetValue(TooltipProperty);
805             }
806             set
807             {
808                 SetValue(TooltipProperty, value);
809                 NotifyPropertyChanged();
810             }
811         }
812
813         /// <summary>
814         /// Displays a tooltip as a text.
815         /// </summary>
816         /// <since_tizen> 3 </since_tizen>
817         public string TooltipText
818         {
819             get
820             {
821                 return GetValue(TooltipTextProperty) as string;
822             }
823             set
824             {
825                 SetValue(TooltipTextProperty, value);
826             }
827         }
828
829         private string InternalTooltipText
830         {
831             get
832             {
833                 using (var propertyValue = GetProperty(Property.TOOLTIP))
834                 {
835                     if (propertyValue != null && propertyValue.Get(out string retrivedValue))
836                     {
837                         return retrivedValue;
838                     }
839                     NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
840                     return "error to get TooltipText";
841                 }
842             }
843             set
844             {
845                 var temp = new Tizen.NUI.PropertyValue(value);
846                 SetProperty(View.Property.TOOLTIP, temp);
847                 temp.Dispose();
848                 NotifyPropertyChanged();
849             }
850         }
851
852         /// <summary>
853         /// The Child property of FlexContainer.<br />
854         /// The proportion of the free space in the container, the flex item will receive.<br />
855         /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
856         /// </summary>
857         /// <since_tizen> 3 </since_tizen>
858         [Obsolete("Deprecated in API8, will be removed in API10.")]
859         public float Flex
860         {
861             get
862             {
863                 return (float)GetValue(FlexProperty);
864             }
865             set
866             {
867                 SetValue(FlexProperty, value);
868                 NotifyPropertyChanged();
869             }
870         }
871
872         /// <summary>
873         /// The Child property of FlexContainer.<br />
874         /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
875         /// </summary>
876         /// <since_tizen> 3 </since_tizen>
877         [Obsolete("Deprecated in API8, will be removed in API10.")]
878         public int AlignSelf
879         {
880             get
881             {
882                 return (int)GetValue(AlignSelfProperty);
883             }
884             set
885             {
886                 SetValue(AlignSelfProperty, value);
887                 NotifyPropertyChanged();
888             }
889         }
890
891         /// <summary>
892         /// The Child property of FlexContainer.<br />
893         /// The space around the flex item.<br />
894         /// </summary>
895         /// <remarks>
896         /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
897         /// </remarks>
898         /// <since_tizen> 3 </since_tizen>
899         [Obsolete("Deprecated in API8, will be removed in API10.")]
900         public Vector4 FlexMargin
901         {
902             get
903             {
904                 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
905                 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
906             }
907             set
908             {
909                 SetValue(FlexMarginProperty, value);
910                 NotifyPropertyChanged();
911             }
912         }
913
914         /// <summary>
915         /// The top-left cell this child occupies, if not set, the first available cell is used.
916         /// </summary>
917         /// <remarks>
918         /// The property cascade chaining set is not recommended.
919         /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
920         /// </remarks>
921         /// <example>
922         /// This way is recommended for setting the property
923         /// <code>
924         /// var view = new View();
925         /// view.CellIndex = new Vector2(1, 3);
926         /// </code>
927         /// This way to set the property is prohibited
928         /// <code>
929         /// view.CellIndex.X = 1; //This does not guarantee a proper operation
930         /// </code>
931         /// </example>
932         /// <since_tizen> 3 </since_tizen>
933         public Vector2 CellIndex
934         {
935             get
936             {
937                 return (Vector2)GetValue(CellIndexProperty);
938             }
939             set
940             {
941                 SetValue(CellIndexProperty, value);
942                 NotifyPropertyChanged();
943             }
944         }
945
946         /// <summary>
947         /// The number of rows this child occupies, if not set, the default value is 1.
948         /// </summary>
949         /// <remarks>
950         /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
951         /// </remarks>
952         /// <since_tizen> 3 </since_tizen>
953         public float RowSpan
954         {
955             get
956             {
957                 return (float)GetValue(RowSpanProperty);
958             }
959             set
960             {
961                 SetValue(RowSpanProperty, value);
962                 NotifyPropertyChanged();
963             }
964         }
965
966         /// <summary>
967         /// The number of columns this child occupies, if not set, the default value is 1.
968         /// </summary>
969         /// <remarks>
970         /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
971         /// </remarks>
972         /// <since_tizen> 3 </since_tizen>
973         public float ColumnSpan
974         {
975             get
976             {
977                 return (float)GetValue(ColumnSpanProperty);
978             }
979             set
980             {
981                 SetValue(ColumnSpanProperty, value);
982                 NotifyPropertyChanged();
983             }
984         }
985
986         /// <summary>
987         /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
988         /// </summary>
989         /// <remarks>
990         /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
991         /// </remarks>
992         /// <since_tizen> 3 </since_tizen>
993         public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
994         {
995             get
996             {
997                 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
998             }
999             set
1000             {
1001                 SetValue(CellHorizontalAlignmentProperty, value);
1002                 NotifyPropertyChanged();
1003             }
1004         }
1005
1006         /// <summary>
1007         /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1008         /// </summary>
1009         /// <remarks>
1010         /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1011         /// </remarks>
1012         /// <since_tizen> 3 </since_tizen>
1013         public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1014         {
1015             get
1016             {
1017                 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1018             }
1019             set
1020             {
1021                 SetValue(CellVerticalAlignmentProperty, value);
1022                 NotifyPropertyChanged();
1023             }
1024         }
1025
1026         /// <summary>
1027         /// The left focusable view.<br />
1028         /// This will return null if not set.<br />
1029         /// This will also return null if the specified left focusable view is not on a window.<br />
1030         /// </summary>
1031         /// <since_tizen> 3 </since_tizen>
1032         public View LeftFocusableView
1033         {
1034             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1035             get
1036             {
1037                 return (View)GetValue(LeftFocusableViewProperty);
1038             }
1039             set
1040             {
1041                 SetValue(LeftFocusableViewProperty, value);
1042                 NotifyPropertyChanged();
1043             }
1044         }
1045
1046         /// <summary>
1047         /// The right focusable view.<br />
1048         /// This will return null if not set.<br />
1049         /// This will also return null if the specified right focusable view is not on a window.<br />
1050         /// </summary>
1051         /// <since_tizen> 3 </since_tizen>
1052         public View RightFocusableView
1053         {
1054             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1055             get
1056             {
1057                 return (View)GetValue(RightFocusableViewProperty);
1058             }
1059             set
1060             {
1061                 SetValue(RightFocusableViewProperty, value);
1062                 NotifyPropertyChanged();
1063             }
1064         }
1065
1066         /// <summary>
1067         /// The up focusable view.<br />
1068         /// This will return null if not set.<br />
1069         /// This will also return null if the specified up focusable view is not on a window.<br />
1070         /// </summary>
1071         /// <since_tizen> 3 </since_tizen>
1072         public View UpFocusableView
1073         {
1074             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1075             get
1076             {
1077                 return (View)GetValue(UpFocusableViewProperty);
1078             }
1079             set
1080             {
1081                 SetValue(UpFocusableViewProperty, value);
1082                 NotifyPropertyChanged();
1083             }
1084         }
1085
1086         /// <summary>
1087         /// The down focusable view.<br />
1088         /// This will return null if not set.<br />
1089         /// This will also return null if the specified down focusable view is not on a window.<br />
1090         /// </summary>
1091         /// <since_tizen> 3 </since_tizen>
1092         public View DownFocusableView
1093         {
1094             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1095             get
1096             {
1097                 return (View)GetValue(DownFocusableViewProperty);
1098             }
1099             set
1100             {
1101                 SetValue(DownFocusableViewProperty, value);
1102                 NotifyPropertyChanged();
1103             }
1104         }
1105
1106         /// <summary>
1107         /// The clockwise focusable view by rotary wheel.<br />
1108         /// This will return null if not set.<br />
1109         /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1110         /// </summary>
1111         [EditorBrowsable(EditorBrowsableState.Never)]
1112         public View ClockwiseFocusableView
1113         {
1114             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1115             get
1116             {
1117                 return (View)GetValue(ClockwiseFocusableViewProperty);
1118             }
1119             set
1120             {
1121                 SetValue(ClockwiseFocusableViewProperty, value);
1122                 NotifyPropertyChanged();
1123             }
1124         }
1125
1126         /// <summary>
1127         /// The counter clockwise focusable view by rotary wheel.<br />
1128         /// This will return null if not set.<br />
1129         /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1130         /// </summary>
1131         [EditorBrowsable(EditorBrowsableState.Never)]
1132         public View CounterClockwiseFocusableView
1133         {
1134             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1135             get
1136             {
1137                 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1138             }
1139             set
1140             {
1141                 SetValue(CounterClockwiseFocusableViewProperty, value);
1142                 NotifyPropertyChanged();
1143             }
1144         }
1145
1146         /// <summary>
1147         /// Whether the view should be focusable by keyboard navigation.
1148         /// </summary>
1149         /// <since_tizen> 3 </since_tizen>
1150         public bool Focusable
1151         {
1152             set
1153             {
1154                 SetValue(FocusableProperty, value);
1155                 NotifyPropertyChanged();
1156             }
1157             get
1158             {
1159                 return (bool)GetValue(FocusableProperty);
1160             }
1161         }
1162
1163         /// <summary>
1164         /// 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.
1165         /// Note : Default value is true.
1166         /// </summary>
1167         [EditorBrowsable(EditorBrowsableState.Never)]
1168         public bool FocusableChildren
1169         {
1170             set
1171             {
1172                 SetValue(FocusableChildrenProperty, value);
1173                 NotifyPropertyChanged();
1174             }
1175             get
1176             {
1177                 return (bool)GetValue(FocusableChildrenProperty);
1178             }
1179         }
1180
1181         /// <summary>
1182         /// Whether this view can focus by touch.
1183         /// If Focusable is false, FocusableInTouch is disabled.
1184         /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1185         /// </summary>
1186         [EditorBrowsable(EditorBrowsableState.Never)]
1187         public bool FocusableInTouch
1188         {
1189             set
1190             {
1191                 SetValue(FocusableInTouchProperty, value);
1192                 NotifyPropertyChanged();
1193             }
1194             get
1195             {
1196                 return (bool)GetValue(FocusableInTouchProperty);
1197             }
1198         }
1199
1200         /// <summary>
1201         /// Retrieves the position of the view.
1202         /// The coordinates are relative to the view's parent.
1203         /// </summary>
1204         /// <remarks>
1205         /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1206         /// 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).
1207         /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1208         /// and users can get the current actual values through them.
1209         /// </remarks>
1210         /// <since_tizen> 3 </since_tizen>
1211         public Position CurrentPosition
1212         {
1213             get
1214             {
1215                 return GetCurrentPosition();
1216             }
1217         }
1218
1219         /// <summary>
1220         /// Sets the size of a view for the width and the height.<br />
1221         /// Geometry can be scaled to fit within this area.<br />
1222         /// This does not interfere with the view's scale factor.<br />
1223         /// The views default depth is the minimum of width and height.<br />
1224         /// </summary>
1225         /// <remarks>
1226         /// The property cascade chaining set is not recommended.
1227         /// </remarks>
1228         /// <example>
1229         /// This way is recommended for setting the property
1230         /// <code>
1231         /// var view = new View();
1232         /// view.Size2D = new Size2D(100, 200);
1233         /// </code>
1234         /// This way to set the property is prohibited
1235         /// <code>
1236         /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1237         /// </code>
1238         /// </example>
1239         /// <since_tizen> 3 </since_tizen>
1240         public Size2D Size2D
1241         {
1242             get
1243             {
1244                 var temp = (Size2D)GetValue(Size2DProperty);
1245
1246                 if (this.Layout == null)
1247                 {
1248                     if (temp.Width < 0) { temp.Width = 0; }
1249                     if (temp.Height < 0) { temp.Height = 0; }
1250                 }
1251
1252                 return temp;
1253             }
1254             set
1255             {
1256                 SetValue(Size2DProperty, value);
1257
1258                 NotifyPropertyChanged();
1259             }
1260         }
1261
1262         /// <summary>
1263         /// Retrieves the size of the view.
1264         /// The coordinates are relative to the view's parent.
1265         /// </summary>
1266         /// <remarks>
1267         /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1268         /// 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).
1269         /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1270         /// and users can get the current actual values through them.
1271         /// </remarks>
1272         /// <since_tizen> 3 </since_tizen>
1273         public Size2D CurrentSize
1274         {
1275             get
1276             {
1277                 return GetCurrentSize();
1278             }
1279         }
1280
1281         /// <summary>
1282         /// Retrieves and sets the view's opacity.<br />
1283         /// </summary>
1284         /// <remarks>
1285         /// <para>
1286         /// Animatable - This property can be animated using <c>Animation</c> class.
1287         /// <code>
1288         /// animation.AnimateTo(view, "Opacity", 0.5f);
1289         /// </code>
1290         /// </para>
1291         /// </remarks>
1292         /// <since_tizen> 3 </since_tizen>
1293         public float Opacity
1294         {
1295             get
1296             {
1297                 return (float)GetValue(OpacityProperty);
1298             }
1299             set
1300             {
1301                 SetValue(OpacityProperty, value);
1302                 NotifyPropertyChanged();
1303             }
1304         }
1305
1306         /// <summary>
1307         /// Sets the position of the view for X and Y.<br />
1308         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1309         /// If the position inheritance is disabled, sets the world position.<br />
1310         /// </summary>
1311         /// <remarks>
1312         /// The property cascade chaining set is not recommended.
1313         ///</remarks>
1314         /// <example>
1315         /// This way is recommended for setting the property
1316         /// <code>
1317         /// var view = new View();
1318         /// view.Position2D = new Position2D(100, 200);
1319         /// </code>
1320         /// This way to set the property is prohibited
1321         /// <code>
1322         /// view.Position2D.X = 100; //This does not guarantee a proper operation
1323         /// </code>
1324         /// </example>
1325         /// <since_tizen> 3 </since_tizen>
1326         public Position2D Position2D
1327         {
1328             get
1329             {
1330                 return (Position2D)GetValue(Position2DProperty);
1331             }
1332             set
1333             {
1334                 SetValue(Position2DProperty, value);
1335                 NotifyPropertyChanged();
1336             }
1337         }
1338
1339         /// <summary>
1340         /// Retrieves the screen position of the view.<br />
1341         /// </summary>
1342         /// <since_tizen> 3 </since_tizen>
1343         public Vector2 ScreenPosition
1344         {
1345             get
1346             {
1347                 return GetCurrentScreenPosition();
1348             }
1349         }
1350
1351         /// <summary>
1352         /// Retrieves the screen position and size of the view.<br />
1353         /// </summary>
1354         /// <remarks>
1355         /// The float type Rectangle class is not ready yet.
1356         /// Therefore, it transmits data in Vector4 class.
1357         /// This type should later be changed to the appropriate data type.
1358         /// </remarks>
1359         [EditorBrowsable(EditorBrowsableState.Never)]
1360         public Vector4 ScreenPositionSize
1361         {
1362             get
1363             {
1364                 return GetCurrentScreenPositionSize();
1365             }
1366         }
1367
1368         /// <summary>
1369         /// Determines whether the pivot point should be used to determine the position of the view.
1370         /// This is false by default.
1371         /// </summary>
1372         /// <remarks>If false, then the top-left of the view is used for the position.
1373         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1374         /// </remarks>
1375         /// <since_tizen> 3 </since_tizen>
1376         public bool PositionUsesPivotPoint
1377         {
1378             get
1379             {
1380                 return (bool)GetValue(PositionUsesPivotPointProperty);
1381             }
1382             set
1383             {
1384                 SetValue(PositionUsesPivotPointProperty, value);
1385                 NotifyPropertyChanged();
1386             }
1387         }
1388
1389         /// <summary>
1390         /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1391         /// </summary>
1392         /// <since_tizen> 3 </since_tizen>
1393         [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1394             "Like: " +
1395             "View view = new View(); " +
1396             "view.PivotPoint = PivotPoint.Center; " +
1397             "view.PositionUsesPivotPoint = true;" +
1398             " This has been deprecated in API5 and will be removed in API8")]
1399         [EditorBrowsable(EditorBrowsableState.Never)]
1400         public bool PositionUsesAnchorPoint
1401         {
1402             get
1403             {
1404                 return (bool)GetValue(PositionUsesAnchorPointProperty);
1405             }
1406             set
1407             {
1408                 SetValue(PositionUsesAnchorPointProperty, value);
1409             }
1410         }
1411
1412         private bool InternalPositionUsesAnchorPoint
1413         {
1414             get
1415             {
1416                 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1417             }
1418             set
1419             {
1420                 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1421                 NotifyPropertyChanged();
1422             }
1423         }
1424
1425         /// <summary>
1426         /// Queries whether the view is connected to the stage.<br />
1427         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1428         /// </summary>
1429         /// <since_tizen> 3 </since_tizen>
1430         public bool IsOnWindow
1431         {
1432             get
1433             {
1434                 return OnWindow();
1435             }
1436         }
1437
1438         /// <summary>
1439         /// Gets the depth in the hierarchy for the view.
1440         /// </summary>
1441         /// <since_tizen> 3 </since_tizen>
1442         public int HierarchyDepth
1443         {
1444             get
1445             {
1446                 return GetHierarchyDepth();
1447             }
1448         }
1449
1450         /// <summary>
1451         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1452         /// </summary>
1453         /// <remarks>
1454         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1455         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1456         /// The values set by this property will likely change.
1457         /// </remarks>
1458         /// <since_tizen> 3 </since_tizen>
1459         public int SiblingOrder
1460         {
1461             get
1462             {
1463                 return (int)GetValue(SiblingOrderProperty);
1464             }
1465             set
1466             {
1467                 SetValue(SiblingOrderProperty, value);
1468
1469                 Layout?.ChangeLayoutSiblingOrder(value);
1470
1471                 NotifyPropertyChanged();
1472             }
1473         }
1474
1475         /// <summary>
1476         /// Returns the natural size of the view.
1477         /// </summary>
1478         /// <remarks>
1479         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1480         /// </remarks>
1481         /// <since_tizen> 5 </since_tizen>
1482         public Vector3 NaturalSize
1483         {
1484             get
1485             {
1486                 Vector3 ret = GetNaturalSize();
1487                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1488                 return ret;
1489             }
1490         }
1491
1492         /// <summary>
1493         /// Returns the natural size (Size2D) of the view.
1494         /// </summary>
1495         /// <remarks>
1496         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1497         /// </remarks>
1498         /// <since_tizen> 4 </since_tizen>
1499         public Size2D NaturalSize2D
1500         {
1501             get
1502             {
1503                 Vector3 temp = GetNaturalSize();
1504                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1505
1506                 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1507                 temp.Dispose();
1508                 return sz;
1509             }
1510         }
1511
1512         /// <summary>
1513         /// Gets or sets the origin of a view within its parent's area.<br />
1514         /// 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 />
1515         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1516         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1517         /// </summary>
1518         /// <pre>The view has been initialized.</pre>
1519         /// <since_tizen> 3 </since_tizen>
1520         public Position ParentOrigin
1521         {
1522             get
1523             {
1524                 Position tmp = (Position)GetValue(ParentOriginProperty);
1525                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1526             }
1527             set
1528             {
1529                 SetValue(ParentOriginProperty, value);
1530                 NotifyPropertyChanged();
1531             }
1532         }
1533
1534         /// <summary>
1535         /// Gets or sets the anchor-point of a view.<br />
1536         /// 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 />
1537         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1538         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1539         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1540         /// <pre>The view has been initialized.</pre>
1541         /// </summary>
1542         /// <remarks>
1543         /// The property cascade chaining set is not recommended.
1544         ///</remarks>
1545         /// <example>
1546         /// This way is recommended for setting the property
1547         /// <code>
1548         /// var view = new View();
1549         /// view.PivotPoint = PivotPoint.Center;
1550         /// </code>
1551         /// This way to set the property is prohibited
1552         /// <code>
1553         /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1554         /// </code>
1555         /// </example>
1556         /// <since_tizen> 3 </since_tizen>
1557         public Position PivotPoint
1558         {
1559             get
1560             {
1561                 return (Position)GetValue(PivotPointProperty);
1562             }
1563             set
1564             {
1565                 SetValue(PivotPointProperty, value);
1566                 NotifyPropertyChanged();
1567             }
1568         }
1569
1570         /// <summary>
1571         /// Gets or sets the size width of the view.
1572         /// </summary>
1573         /// <remarks>
1574         /// <para>
1575         /// Animatable - This property can be animated using <c>Animation</c> class.
1576         /// <code>
1577         /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1578         /// </code>
1579         /// </para>
1580         /// </remarks>
1581         /// <since_tizen> 3 </since_tizen>
1582         public float SizeWidth
1583         {
1584             get
1585             {
1586                 return (float)GetValue(SizeWidthProperty);
1587             }
1588             set
1589             {
1590                 SetValue(SizeWidthProperty, value);
1591                 NotifyPropertyChanged();
1592             }
1593         }
1594
1595         /// <summary>
1596         /// Gets or sets the size height of the view.
1597         /// </summary>
1598         /// <remarks>
1599         /// <para>
1600         /// Animatable - This property can be animated using <c>Animation</c> class.
1601         /// </para>
1602         /// <code>
1603         /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1604         /// </code>
1605         /// </remarks>
1606         /// <since_tizen> 3 </since_tizen>
1607         public float SizeHeight
1608         {
1609             get
1610             {
1611                 return (float)GetValue(SizeHeightProperty);
1612             }
1613             set
1614             {
1615                 SetValue(SizeHeightProperty, value);
1616                 NotifyPropertyChanged();
1617             }
1618         }
1619
1620         /// <summary>
1621         /// Gets or sets the position of the view.<br />
1622         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1623         /// If the position inheritance is disabled, sets the world position.<br />
1624         /// </summary>
1625         /// <remarks>
1626         /// <para>
1627         /// Animatable - This property can be animated using <c>Animation</c> class.
1628         /// <code>
1629         /// animation.AnimateTo(view, "Position", new Position(50, 0));
1630         /// </code>
1631         /// </para>
1632         /// The property cascade chaining set is not recommended.
1633         /// </remarks>
1634         /// <example>
1635         /// This way is recommended for setting the property
1636         /// <code>
1637         /// var view = new View();
1638         /// view.Position = new Position(100, 200.5f, 0);
1639         /// </code>
1640         /// This way to set the property is prohibited
1641         /// <code>
1642         /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1643         /// </code>
1644         /// </example>
1645         /// <since_tizen> 3 </since_tizen>
1646         public Position Position
1647         {
1648             get
1649             {
1650                 return (Position)GetValue(PositionProperty);
1651             }
1652             set
1653             {
1654                 SetValue(PositionProperty, value);
1655                 NotifyPropertyChanged();
1656             }
1657         }
1658
1659         /// <summary>
1660         /// Gets or sets the position X of the view.
1661         /// </summary>
1662         /// <remarks>
1663         /// <para>
1664         /// Animatable - This property can be animated using <c>Animation</c> class.
1665         /// <code>
1666         /// animation.AnimateTo(view, "PositionX", 50.0f);
1667         /// </code>
1668         /// </para>
1669         /// </remarks>
1670         /// <since_tizen> 3 </since_tizen>
1671         public float PositionX
1672         {
1673             get
1674             {
1675                 return (float)GetValue(PositionXProperty);
1676             }
1677             set
1678             {
1679                 SetValue(PositionXProperty, value);
1680                 NotifyPropertyChanged();
1681             }
1682         }
1683
1684         /// <summary>
1685         /// Gets or sets the position Y of the view.
1686         /// </summary>
1687         /// <remarks>
1688         /// <para>
1689         /// Animatable - This property can be animated using <c>Animation</c> class.
1690         /// <code>
1691         /// animation.AnimateTo(view, "PositionY", 50.0f);
1692         /// </code>
1693         /// </para>
1694         /// </remarks>
1695         /// <since_tizen> 3 </since_tizen>
1696         public float PositionY
1697         {
1698             get
1699             {
1700                 return (float)GetValue(PositionYProperty);
1701             }
1702             set
1703             {
1704                 SetValue(PositionYProperty, value);
1705                 NotifyPropertyChanged();
1706             }
1707         }
1708
1709         /// <summary>
1710         /// Gets or sets the position Z of the view.
1711         /// </summary>
1712         /// <remarks>
1713         /// <para>
1714         /// Animatable - This property can be animated using <c>Animation</c> class.
1715         /// <code>
1716         /// animation.AnimateTo(view, "PositionZ", 50.0f);
1717         /// </code>
1718         /// </para>
1719         /// </remarks>
1720         /// <since_tizen> 3 </since_tizen>
1721         public float PositionZ
1722         {
1723             get
1724             {
1725                 return (float)GetValue(PositionZProperty);
1726             }
1727             set
1728             {
1729                 SetValue(PositionZProperty, value);
1730                 NotifyPropertyChanged();
1731             }
1732         }
1733
1734         /// <summary>
1735         /// Gets or sets the world position of the view.
1736         /// </summary>
1737         /// <since_tizen> 3 </since_tizen>
1738         public Vector3 WorldPosition
1739         {
1740             get
1741             {
1742                 return GetCurrentWorldPosition();
1743             }
1744         }
1745
1746         /// <summary>
1747         /// Gets or sets the orientation of the view.<br />
1748         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1749         /// </summary>
1750         /// <remarks>
1751         /// <para>
1752         /// This is an asynchronous method.
1753         /// </para>
1754         /// <para>
1755         /// Animatable - This property can be animated using <c>Animation</c> class.
1756         /// <code>
1757         /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1758         /// </code>
1759         /// </para>
1760         /// </remarks>
1761         /// <since_tizen> 3 </since_tizen>
1762         public Rotation Orientation
1763         {
1764             get
1765             {
1766                 return (Rotation)GetValue(OrientationProperty);
1767             }
1768             set
1769             {
1770                 SetValue(OrientationProperty, value);
1771                 NotifyPropertyChanged();
1772             }
1773         }
1774
1775         /// <summary>
1776         /// Gets or sets the world orientation of the view.<br />
1777         /// </summary>
1778         /// <since_tizen> 3 </since_tizen>
1779         public Rotation WorldOrientation
1780         {
1781             get
1782             {
1783                 Rotation temp = new Rotation();
1784                 var pValue = GetProperty(View.Property.WorldOrientation);
1785                 pValue.Get(temp);
1786                 pValue.Dispose();
1787                 return temp;
1788             }
1789         }
1790
1791         /// <summary>
1792         /// Gets or sets the scale factor applied to the view.<br />
1793         /// </summary>
1794         /// <remarks>
1795         /// <para>
1796         /// Animatable - This property can be animated using <c>Animation</c> class.
1797         /// <code>
1798         /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1799         /// </code>
1800         /// </para>
1801         /// The property cascade chaining set is not recommended.
1802         /// </remarks>
1803         /// <example>
1804         /// This way is recommended for setting the property
1805         /// <code>
1806         /// var view = new View();
1807         /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1808         /// </code>
1809         /// This way to set the property is prohibited
1810         /// <code>
1811         /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1812         /// </code>
1813         /// </example>
1814         /// <since_tizen> 3 </since_tizen>
1815         public Vector3 Scale
1816         {
1817             get
1818             {
1819                 return (Vector3)GetValue(ScaleProperty);
1820             }
1821             set
1822             {
1823                 SetValue(ScaleProperty, value);
1824                 NotifyPropertyChanged();
1825             }
1826         }
1827
1828         /// <summary>
1829         /// Gets or sets the scale X factor applied to the view.
1830         /// </summary>
1831         /// <remarks>
1832         /// <para>
1833         /// Animatable - This property can be animated using <c>Animation</c> class.
1834         /// <code>
1835         /// animation.AnimateTo(view, "ScaleX", 1.5f);
1836         /// </code>
1837         /// </para>
1838         /// </remarks>
1839         /// <since_tizen> 3 </since_tizen>
1840         public float ScaleX
1841         {
1842             get
1843             {
1844                 return (float)GetValue(ScaleXProperty);
1845             }
1846             set
1847             {
1848                 SetValue(ScaleXProperty, value);
1849                 NotifyPropertyChanged();
1850             }
1851         }
1852
1853         /// <summary>
1854         /// Gets or sets the scale Y factor applied to the view.
1855         /// </summary>
1856         /// <remarks>
1857         /// <para>
1858         /// Animatable - This property can be animated using <c>Animation</c> class.
1859         /// <code>
1860         /// animation.AnimateTo(view, "ScaleY", 1.5f);
1861         /// </code>
1862         /// </para>
1863         /// </remarks>
1864         /// <since_tizen> 3 </since_tizen>
1865         public float ScaleY
1866         {
1867             get
1868             {
1869                 return (float)GetValue(ScaleYProperty);
1870             }
1871             set
1872             {
1873                 SetValue(ScaleYProperty, value);
1874                 NotifyPropertyChanged();
1875             }
1876         }
1877
1878         /// <summary>
1879         /// Gets or sets the scale Z factor applied to the view.
1880         /// </summary>
1881         /// <remarks>
1882         /// <para>
1883         /// Animatable - This property can be animated using <c>Animation</c> class.
1884         /// <code>
1885         /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1886         /// </code>
1887         /// </para>
1888         /// </remarks>
1889         /// <since_tizen> 3 </since_tizen>
1890         public float ScaleZ
1891         {
1892             get
1893             {
1894                 return (float)GetValue(ScaleZProperty);
1895             }
1896             set
1897             {
1898                 SetValue(ScaleZProperty, value);
1899                 NotifyPropertyChanged();
1900             }
1901         }
1902
1903         /// <summary>
1904         /// Gets the world scale of the view.
1905         /// </summary>
1906         /// <since_tizen> 3 </since_tizen>
1907         public Vector3 WorldScale
1908         {
1909             get
1910             {
1911                 return GetCurrentWorldScale();
1912             }
1913         }
1914
1915         /// <summary>
1916         /// Retrieves the visibility flag of the view.
1917         /// </summary>
1918         /// <remarks>
1919         /// <para>
1920         /// If the view is not visible, then the view and its children will not be rendered.
1921         /// 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.
1922         /// </para>
1923         /// <para>
1924         /// Animatable - This property can be animated using <c>Animation</c> class.
1925         /// <code>
1926         /// animation.AnimateTo(view, "Visibility", false);
1927         /// </code>
1928         /// </para>
1929         /// </remarks>
1930         /// <since_tizen> 3 </since_tizen>
1931         public bool Visibility
1932         {
1933             get
1934             {
1935                 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1936             }
1937         }
1938
1939         /// <summary>
1940         /// Gets the view's world color.
1941         /// </summary>
1942         /// <since_tizen> 3 </since_tizen>
1943         public Vector4 WorldColor
1944         {
1945             get
1946             {
1947                 return GetCurrentWorldColor();
1948             }
1949         }
1950
1951         /// <summary>
1952         /// Gets or sets the view's name.
1953         /// </summary>
1954         /// <since_tizen> 3 </since_tizen>
1955         public string Name
1956         {
1957             get
1958             {
1959                 return (string)GetValue(NameProperty);
1960             }
1961             set
1962             {
1963                 SetValue(NameProperty, value);
1964                 NotifyPropertyChanged();
1965             }
1966         }
1967
1968         /// <summary>
1969         /// Get the number of children held by the view.
1970         /// </summary>
1971         /// <since_tizen> 3 </since_tizen>
1972         public new uint ChildCount
1973         {
1974             get
1975             {
1976                 return Convert.ToUInt32(Children.Count);
1977             }
1978         }
1979
1980         /// <summary>
1981         /// Gets the view's ID.
1982         /// Read-only
1983         /// </summary>
1984         /// <since_tizen> 3 </since_tizen>
1985         public uint ID
1986         {
1987             get
1988             {
1989                 return GetId();
1990             }
1991         }
1992
1993         /// <summary>
1994         /// Gets or sets the status of whether the view should emit touch or hover signals.
1995         /// If a View is made insensitive, then the View and its children are not hittable.
1996         /// </summary>
1997         /// <since_tizen> 3 </since_tizen>
1998         public bool Sensitive
1999         {
2000             get
2001             {
2002                 return (bool)GetValue(SensitiveProperty);
2003             }
2004             set
2005             {
2006                 SetValue(SensitiveProperty, value);
2007                 NotifyPropertyChanged();
2008             }
2009         }
2010
2011         /// <summary>
2012         /// Gets or sets the status of whether the view should be enabled user interactions.
2013         /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2014         /// </summary>
2015         /// <since_tizen> tizen_next </since_tizen>
2016         [EditorBrowsable(EditorBrowsableState.Never)]
2017         public bool IsEnabled
2018         {
2019             get
2020             {
2021                 return (bool)GetValue(IsEnabledProperty);
2022             }
2023             set
2024             {
2025                 SetValue(IsEnabledProperty, value);
2026                 NotifyPropertyChanged();
2027             }
2028         }
2029
2030         /// <summary>
2031         /// 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.
2032         /// </summary>
2033         /// <since_tizen> 3 </since_tizen>
2034         public bool LeaveRequired
2035         {
2036             get
2037             {
2038                 return (bool)GetValue(LeaveRequiredProperty);
2039             }
2040             set
2041             {
2042                 SetValue(LeaveRequiredProperty, value);
2043                 NotifyPropertyChanged();
2044             }
2045         }
2046
2047         /// <summary>
2048         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2049         /// </summary>
2050         /// <since_tizen> 3 </since_tizen>
2051         public bool InheritOrientation
2052         {
2053             get
2054             {
2055                 return (bool)GetValue(InheritOrientationProperty);
2056             }
2057             set
2058             {
2059                 SetValue(InheritOrientationProperty, value);
2060                 NotifyPropertyChanged();
2061             }
2062         }
2063
2064         /// <summary>
2065         /// Gets or sets the status of whether a child view inherits it's parent's scale.
2066         /// </summary>
2067         /// <since_tizen> 3 </since_tizen>
2068         public bool InheritScale
2069         {
2070             get
2071             {
2072                 return (bool)GetValue(InheritScaleProperty);
2073             }
2074             set
2075             {
2076                 SetValue(InheritScaleProperty, value);
2077                 NotifyPropertyChanged();
2078             }
2079         }
2080
2081         /// <summary>
2082         /// Gets or sets the status of how the view and its children should be drawn.<br />
2083         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2084         /// 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 />
2085         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2086         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2087         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2088         /// </summary>
2089         /// <since_tizen> 3 </since_tizen>
2090         public DrawModeType DrawMode
2091         {
2092             get
2093             {
2094                 return (DrawModeType)GetValue(DrawModeProperty);
2095             }
2096             set
2097             {
2098                 SetValue(DrawModeProperty, value);
2099                 NotifyPropertyChanged();
2100             }
2101         }
2102
2103         /// <summary>
2104         /// Gets or sets the relative to parent size factor of the view.<br />
2105         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2106         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2107         /// </summary>
2108         /// <remarks>
2109         /// The property cascade chaining set is not recommended.
2110         /// </remarks>
2111         /// <example>
2112         /// This way is recommended for setting the property
2113         /// <code>
2114         /// var text = new TextField();
2115         /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2116         /// </code>
2117         /// This way to set the property is prohibited
2118         /// <code>
2119         /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2120         /// </code>
2121         /// </example>
2122         /// <since_tizen> 3 </since_tizen>
2123         public Vector3 SizeModeFactor
2124         {
2125             get
2126             {
2127                 return (Vector3)GetValue(SizeModeFactorProperty);
2128             }
2129             set
2130             {
2131                 SetValue(SizeModeFactorProperty, value);
2132                 NotifyPropertyChanged();
2133             }
2134         }
2135
2136         /// <summary>
2137         /// Gets or sets the width resize policy to be used.
2138         /// </summary>
2139         /// <since_tizen> 3 </since_tizen>
2140         public ResizePolicyType WidthResizePolicy
2141         {
2142             get
2143             {
2144                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2145             }
2146             set
2147             {
2148                 SetValue(WidthResizePolicyProperty, value);
2149                 NotifyPropertyChanged();
2150             }
2151         }
2152
2153         /// <summary>
2154         /// Gets or sets the height resize policy to be used.
2155         /// </summary>
2156         /// <since_tizen> 3 </since_tizen>
2157         public ResizePolicyType HeightResizePolicy
2158         {
2159             get
2160             {
2161                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2162             }
2163             set
2164             {
2165                 SetValue(HeightResizePolicyProperty, value);
2166                 NotifyPropertyChanged();
2167             }
2168         }
2169
2170         /// <summary>
2171         /// Gets or sets the policy to use when setting size with size negotiation.<br />
2172         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2173         /// </summary>
2174         /// <since_tizen> 3 </since_tizen>
2175         public SizeScalePolicyType SizeScalePolicy
2176         {
2177             get
2178             {
2179                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2180             }
2181             set
2182             {
2183                 SetValue(SizeScalePolicyProperty, value);
2184                 NotifyPropertyChanged();
2185             }
2186         }
2187
2188         /// <summary>
2189         ///  Gets or sets the status of whether the width size is dependent on the height size.
2190         /// </summary>
2191         /// <since_tizen> 3 </since_tizen>
2192         public bool WidthForHeight
2193         {
2194             get
2195             {
2196                 return (bool)GetValue(WidthForHeightProperty);
2197             }
2198             set
2199             {
2200                 SetValue(WidthForHeightProperty, value);
2201                 NotifyPropertyChanged();
2202             }
2203         }
2204
2205         /// <summary>
2206         /// Gets or sets the status of whether the height size is dependent on the width size.
2207         /// </summary>
2208         /// <since_tizen> 3 </since_tizen>
2209         public bool HeightForWidth
2210         {
2211             get
2212             {
2213                 return (bool)GetValue(HeightForWidthProperty);
2214             }
2215             set
2216             {
2217                 SetValue(HeightForWidthProperty, value);
2218                 NotifyPropertyChanged();
2219             }
2220         }
2221
2222         /// <summary>
2223         /// Gets or sets the padding for use in layout.
2224         /// </summary>
2225         /// <remarks>
2226         /// The property cascade chaining set is not recommended.
2227         /// </remarks>
2228         /// <example>
2229         /// This way is recommended for setting the property
2230         /// <code>
2231         /// var view = new View();
2232         /// view.Padding = new Extents(5, 5, 5, 5);
2233         /// </code>
2234         /// This way to set the property is prohibited
2235         /// <code>
2236         /// view.Padding.Start = 5; //This does not guarantee a proper operation
2237         /// </code>
2238         /// </example>
2239         /// <since_tizen> 5 </since_tizen>
2240         public Extents Padding
2241         {
2242             get
2243             {
2244                 return (Extents)GetValue(PaddingProperty);
2245             }
2246             set
2247             {
2248                 SetValue(PaddingProperty, value);
2249                 NotifyPropertyChanged();
2250             }
2251         }
2252
2253         /// <summary>
2254         /// Gets or sets the minimum size the view can be assigned in size negotiation.
2255         /// </summary>
2256         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2257         /// <remarks>
2258         /// The property cascade chaining set is not recommended.
2259         /// </remarks>
2260         /// <example>
2261         /// This way is recommended for setting the property
2262         /// <code>
2263         /// var view = new View();
2264         /// view.MinimumSize = new Size2D(100, 200);
2265         /// </code>
2266         /// This way to set the property is prohibited
2267         /// <code>
2268         /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2269         /// </code>
2270         /// </example>
2271         /// <since_tizen> 3 </since_tizen>
2272         public Size2D MinimumSize
2273         {
2274             get
2275             {
2276                 return (Size2D)GetValue(MinimumSizeProperty);
2277             }
2278             set
2279             {
2280                 if (value == null)
2281                 {
2282                     throw new ArgumentNullException(nameof(value));
2283                 }
2284                 if (layout != null)
2285                 {
2286                     // Note: it only works if minimum size is >= than natural size.
2287                     // To force the size it should be done through the width&height spec or Size2D.
2288                     layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2289                     layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2290                     layout.RequestLayout();
2291                 }
2292                 SetValue(MinimumSizeProperty, value);
2293                 NotifyPropertyChanged();
2294             }
2295         }
2296
2297         /// <summary>
2298         /// Gets or sets the maximum size the view can be assigned in size negotiation.
2299         /// </summary>
2300         /// <example>
2301         /// This way is recommended for setting the property
2302         /// <code>
2303         /// var view = new View();
2304         /// view.MaximumSize = new Size2D(100, 200);
2305         /// </code>
2306         /// This way to set the property is prohibited
2307         /// <code>
2308         /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2309         /// </code>
2310         /// </example>
2311         /// <since_tizen> 3 </since_tizen>
2312         public Size2D MaximumSize
2313         {
2314             get
2315             {
2316                 return (Size2D)GetValue(MaximumSizeProperty);
2317             }
2318             set
2319             {
2320                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2321                 // MATCH_PARENT spec + parent container size can be used to limit
2322                 if (layout != null)
2323                 {
2324                     layout.RequestLayout();
2325                 }
2326                 SetValue(MaximumSizeProperty, value);
2327                 NotifyPropertyChanged();
2328             }
2329         }
2330
2331         /// <summary>
2332         /// Gets or sets whether a child view inherits it's parent's position.<br />
2333         /// Default is to inherit.<br />
2334         /// 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 />
2335         /// </summary>
2336         /// <since_tizen> 3 </since_tizen>
2337         public bool InheritPosition
2338         {
2339             get
2340             {
2341                 return (bool)GetValue(InheritPositionProperty);
2342             }
2343             set
2344             {
2345                 SetValue(InheritPositionProperty, value);
2346                 NotifyPropertyChanged();
2347             }
2348         }
2349
2350         /// <summary>
2351         /// Gets or sets the clipping behavior (mode) of it's children.
2352         /// </summary>
2353         /// <since_tizen> 3 </since_tizen>
2354         public ClippingModeType ClippingMode
2355         {
2356             get
2357             {
2358                 return (ClippingModeType)GetValue(ClippingModeProperty);
2359             }
2360             set
2361             {
2362                 SetValue(ClippingModeProperty, value);
2363                 NotifyPropertyChanged();
2364             }
2365         }
2366
2367         /// <summary>
2368         /// Gets the number of renderers held by the view.
2369         /// </summary>
2370         /// <since_tizen> 3 </since_tizen>
2371         public uint RendererCount
2372         {
2373             get
2374             {
2375                 return GetRendererCount();
2376             }
2377         }
2378
2379         /// <summary>
2380         /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2381         /// </summary>
2382         /// <remarks>
2383         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2384         /// </remarks>
2385         /// <since_tizen> 3 </since_tizen>
2386         [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2387             "Like: " +
2388             "View view = new View(); " +
2389             "view.PivotPoint = PivotPoint.Center; " +
2390             "view.PositionUsesPivotPoint = true;")]
2391         [EditorBrowsable(EditorBrowsableState.Never)]
2392         public Position AnchorPoint
2393         {
2394             get
2395             {
2396                 return GetValue(AnchorPointProperty) as Position;
2397             }
2398             set
2399             {
2400                 SetValue(AnchorPointProperty, value);
2401             }
2402         }
2403
2404         private Position InternalAnchorPoint
2405         {
2406             get
2407             {
2408                 return GetCurrentAnchorPoint();
2409             }
2410             set
2411             {
2412                 SetAnchorPoint(value);
2413                 NotifyPropertyChanged();
2414             }
2415         }
2416
2417         /// <summary>
2418         /// Sets the size of a view for the width, the height and the depth.<br />
2419         /// Geometry can be scaled to fit within this area.<br />
2420         /// This does not interfere with the view's scale factor.<br />
2421         /// The views default depth is the minimum of width and height.<br />
2422         /// </summary>
2423         /// <remarks>
2424         /// <para>
2425         /// Animatable - This property can be animated using <c>Animation</c> class.
2426         /// <code>
2427         /// animation.AnimateTo(view, "Size", new Size(100, 100));
2428         /// </code>
2429         /// </para>
2430         /// The property cascade chaining set is not recommended.
2431         /// </remarks>
2432         /// <example>
2433         /// This way is recommended for setting the property
2434         /// <code>
2435         /// var view = new View();
2436         /// view.Size = new Size(100.5f, 200, 0);
2437         /// </code>
2438         /// This way to set the property is prohibited
2439         /// <code>
2440         /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2441         /// </code>
2442         /// </example>
2443         /// <since_tizen> 5 </since_tizen>
2444         public Size Size
2445         {
2446             get
2447             {
2448                 return (Size)GetValue(SizeProperty);
2449             }
2450             set
2451             {
2452                 SetValue(SizeProperty, value);
2453                 NotifyPropertyChanged();
2454             }
2455         }
2456
2457         /// <summary>
2458         /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2459         /// </summary>
2460         /// <since_tizen> 3 </since_tizen>
2461         [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2462             "Like: " +
2463             "Container parent =  view.GetParent(); " +
2464             "View view = parent as View;")]
2465         [EditorBrowsable(EditorBrowsableState.Never)]
2466         public new View Parent
2467         {
2468             get
2469             {
2470                 View ret;
2471                 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2472                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2473                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2474
2475                 if (basehandle is Layer layer)
2476                 {
2477                     ret = new View(Layer.getCPtr(layer).Handle, false);
2478                     NUILog.Error("This Parent property is deprecated, should do not be used");
2479                 }
2480                 else
2481                 {
2482                     ret = basehandle as View;
2483                 }
2484
2485                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2486                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2487
2488                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2489                 return ret;
2490             }
2491         }
2492
2493         /// <summary>
2494         /// Gets/Sets whether inherit parent's the layout Direction.
2495         /// </summary>
2496         /// <since_tizen> 4 </since_tizen>
2497         public bool InheritLayoutDirection
2498         {
2499             get
2500             {
2501                 return (bool)GetValue(InheritLayoutDirectionProperty);
2502             }
2503             set
2504             {
2505                 SetValue(InheritLayoutDirectionProperty, value);
2506                 NotifyPropertyChanged();
2507             }
2508         }
2509
2510         /// <summary>
2511         /// Gets/Sets the layout Direction.
2512         /// </summary>
2513         /// <since_tizen> 4 </since_tizen>
2514         public ViewLayoutDirectionType LayoutDirection
2515         {
2516             get
2517             {
2518                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2519             }
2520             set
2521             {
2522                 SetValue(LayoutDirectionProperty, value);
2523                 NotifyPropertyChanged();
2524                 layout?.RequestLayout();
2525             }
2526         }
2527
2528         /// <summary>
2529         /// Gets or sets the Margin for use in layout.
2530         /// </summary>
2531         /// <remarks>
2532         /// Margin property is supported by Layout algorithms and containers.
2533         /// Please Set Layout if you want to use Margin property.
2534         /// The property cascade chaining set is not recommended.
2535         /// </remarks>
2536         /// <example>
2537         /// This way is recommended for setting the property
2538         /// <code>
2539         /// var view = new View();
2540         /// view.Margin = new Extents(10, 5, 15, 20);
2541         /// </code>
2542         /// This way to set the property is prohibited
2543         /// <code>
2544         /// view.Margin.Top = 15; //This does not guarantee a proper operation
2545         /// </code>
2546         /// </example>
2547         /// <since_tizen> 4 </since_tizen>
2548         public Extents Margin
2549         {
2550             get
2551             {
2552                 return (Extents)GetValue(MarginProperty);
2553             }
2554             set
2555             {
2556                 SetValue(MarginProperty, value);
2557                 NotifyPropertyChanged();
2558             }
2559         }
2560
2561         ///<summary>
2562         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2563         ///</summary>
2564         /// <example>
2565         /// <code>
2566         /// // matchParentView matches its size to its parent size.
2567         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2568         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2569         ///
2570         /// // wrapContentView wraps its children with their desired size.
2571         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2572         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2573         ///
2574         /// // exactSizeView shows itself with an exact size.
2575         /// exactSizeView.WidthSpecification = 100;
2576         /// exactSizeView.HeightSpecification = 100;
2577         /// </code>
2578         /// </example>
2579         /// <since_tizen> 6 </since_tizen>
2580         [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2581         public int WidthSpecification
2582         {
2583             get
2584             {
2585                 return (int)GetValue(WidthSpecificationProperty);
2586             }
2587             set
2588             {
2589                 SetValue(WidthSpecificationProperty, value);
2590                 NotifyPropertyChanged();
2591             }
2592         }
2593
2594         private int InternalWidthSpecification
2595         {
2596             get
2597             {
2598                 return widthPolicy;
2599             }
2600             set
2601             {
2602                 if (value == widthPolicy)
2603                     return;
2604
2605                 widthPolicy = value;
2606                 if (widthPolicy >= 0)
2607                 {
2608                     if (heightPolicy >= 0) // Policy an exact value
2609                     {
2610                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2611                         Size2D = new Size2D(widthPolicy, heightPolicy);
2612                     }
2613                 }
2614                 layout?.RequestLayout();
2615             }
2616         }
2617
2618         ///<summary>
2619         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2620         ///</summary>
2621         /// <example>
2622         /// <code>
2623         /// // matchParentView matches its size to its parent size.
2624         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2625         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2626         ///
2627         /// // wrapContentView wraps its children with their desired size.
2628         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2629         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2630         ///
2631         /// // exactSizeView shows itself with an exact size.
2632         /// exactSizeView.WidthSpecification = 100;
2633         /// exactSizeView.HeightSpecification = 100;
2634         /// </code>
2635         /// </example>
2636         /// <since_tizen> 6 </since_tizen>
2637         [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2638         public int HeightSpecification
2639         {
2640             get
2641             {
2642                 return (int)GetValue(HeightSpecificationProperty);
2643             }
2644             set
2645             {
2646                 SetValue(HeightSpecificationProperty, value);
2647                 NotifyPropertyChanged();
2648             }
2649         }
2650
2651         private int InternalHeightSpecification
2652         {
2653             get
2654             {
2655                 return heightPolicy;
2656             }
2657             set
2658             {
2659                 if (value == heightPolicy)
2660                     return;
2661
2662                 heightPolicy = value;
2663                 if (heightPolicy >= 0)
2664                 {
2665                     if (widthPolicy >= 0) // Policy an exact value
2666                     {
2667                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2668                         Size2D = new Size2D(widthPolicy, heightPolicy);
2669                     }
2670                 }
2671                 layout?.RequestLayout();
2672             }
2673         }
2674
2675         ///<summary>
2676         /// Gets the List of transitions for this View.
2677         ///</summary>
2678         /// <since_tizen> 6 </since_tizen>
2679         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2680         {
2681             get
2682             {
2683                 if (layoutTransitions == null)
2684                 {
2685                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2686                 }
2687                 return layoutTransitions;
2688             }
2689         }
2690
2691         ///<summary>
2692         /// Sets a layout transitions for this View.
2693         ///</summary>
2694         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2695         /// <remarks>
2696         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2697         /// </remarks>
2698         /// <since_tizen> 6 </since_tizen>
2699         public LayoutTransition LayoutTransition
2700         {
2701             get
2702             {
2703                 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2704             }
2705             set
2706             {
2707                 SetValue(LayoutTransitionProperty, value);
2708                 NotifyPropertyChanged();
2709             }
2710         }
2711
2712         private LayoutTransition InternalLayoutTransition
2713         {
2714             get
2715             {
2716                 return layoutTransition;
2717             }
2718             set
2719             {
2720                 if (value == null)
2721                 {
2722                     throw new global::System.ArgumentNullException(nameof(value));
2723                 }
2724                 if (layoutTransitions == null)
2725                 {
2726                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2727                 }
2728
2729                 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2730
2731                 AttachTransitionsToChildren(value);
2732
2733                 layoutTransition = value;
2734             }
2735         }
2736
2737         /// <summary>
2738         /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2739         /// </summary>
2740         /// <remarks>
2741         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2742         /// </remarks>
2743         /// <since_tizen> 4 </since_tizen>
2744         [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2745         [EditorBrowsable(EditorBrowsableState.Never)]
2746         public Extents PaddingEX
2747         {
2748             get
2749             {
2750                 return GetValue(PaddingEXProperty) as Extents;
2751             }
2752             set
2753             {
2754                 SetValue(PaddingEXProperty, value);
2755             }
2756         }
2757
2758         private Extents InternalPaddingEX
2759         {
2760             get
2761             {
2762                 Extents temp = new Extents(0, 0, 0, 0);
2763                 var pValue = GetProperty(View.Property.PADDING);
2764                 pValue.Get(temp);
2765                 pValue.Dispose();
2766                 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2767                 temp.Dispose();
2768                 return ret;
2769             }
2770             set
2771             {
2772                 var temp = new Tizen.NUI.PropertyValue(value);
2773                 SetProperty(View.Property.PADDING, temp);
2774                 temp.Dispose();
2775                 NotifyPropertyChanged();
2776                 layout?.RequestLayout();
2777             }
2778         }
2779
2780         /// <summary>
2781         /// The Color of View. This is an RGBA value.
2782         /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2783         /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2784         /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2785         /// Inherient of color value depend on <see cref="ColorMode"/>.
2786         /// </summary>
2787         /// <remarks>
2788         /// <para>
2789         /// Animatable - This property can be animated using <c>Animation</c> class.
2790         /// </para>
2791         /// The property cascade chaining set is not recommended.
2792         /// </remarks>
2793         /// <example>
2794         /// This way is recommended for setting the property
2795         /// <code>
2796         /// var view = new View();
2797         /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2798         /// </code>
2799         /// This way to set the property is prohibited
2800         /// <code>
2801         /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2802         /// </code>
2803         /// </example>
2804         [EditorBrowsable(EditorBrowsableState.Never)]
2805         public Color Color
2806         {
2807             get
2808             {
2809                 return (Color)GetValue(ColorProperty);
2810             }
2811             set
2812             {
2813                 SetValue(ColorProperty, value);
2814                 NotifyPropertyChanged();
2815             }
2816         }
2817
2818         /// <summary>
2819         /// The Red component of View.Color.
2820         /// </summary>
2821         /// <remarks>
2822         /// <para>
2823         /// Animatable - This property can be animated using <c>Animation</c> class.
2824         /// </para>
2825         /// </remarks>
2826         [EditorBrowsable(EditorBrowsableState.Never)]
2827         public float ColorRed
2828         {
2829             get
2830             {
2831                 return (float)GetValue(ColorRedProperty);
2832             }
2833             set
2834             {
2835                 SetValue(ColorRedProperty, value);
2836                 NotifyPropertyChanged();
2837             }
2838         }
2839
2840         /// <summary>
2841         /// The Green component of View.Color.
2842         /// </summary>
2843         /// <remarks>
2844         /// <para>
2845         /// Animatable - This property can be animated using <c>Animation</c> class.
2846         /// </para>
2847         /// </remarks>
2848         [EditorBrowsable(EditorBrowsableState.Never)]
2849         public float ColorGreen
2850         {
2851             get
2852             {
2853                 return (float)GetValue(ColorGreenProperty);
2854             }
2855             set
2856             {
2857                 SetValue(ColorGreenProperty, value);
2858                 NotifyPropertyChanged();
2859             }
2860         }
2861
2862         /// <summary>
2863         /// The Blue component of View.Color.
2864         /// </summary>
2865         /// <remarks>
2866         /// <para>
2867         /// Animatable - This property can be animated using <c>Animation</c> class.
2868         /// </para>
2869         /// </remarks>
2870         [EditorBrowsable(EditorBrowsableState.Never)]
2871         public float ColorBlue
2872         {
2873             get
2874             {
2875                 return (float)GetValue(ColorBlueProperty);
2876             }
2877             set
2878             {
2879                 SetValue(ColorBlueProperty, value);
2880                 NotifyPropertyChanged();
2881             }
2882         }
2883
2884         /// <summary>
2885         /// Set the layout on this View. Replaces any existing Layout.
2886         /// </summary>
2887         /// <remarks>
2888         /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2889         /// </remarks>
2890         /// <since_tizen> 6 </since_tizen>
2891         public LayoutItem Layout
2892         {
2893             get
2894             {
2895                 return GetValue(LayoutProperty) as LayoutItem;
2896             }
2897             set
2898             {
2899                 SetValue(LayoutProperty, value);
2900             }
2901         }
2902
2903         private LayoutItem InternalLayout
2904         {
2905             get
2906             {
2907                 return layout;
2908             }
2909             set
2910             {
2911                 // Do nothing if layout provided is already set on this View.
2912                 if (value == layout)
2913                 {
2914                     return;
2915                 }
2916
2917                 LayoutingDisabled = false;
2918                 layoutSet = true;
2919
2920                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2921                 // First check if the layout to be set already has a owner.
2922                 if (value?.Owner != null)
2923                 {
2924                     // Previous owner of the layout gets a default layout as a replacement.
2925                     value.Owner.Layout = new AbsoluteLayout()
2926                     {
2927                         // Copy Margin and Padding to replacement LayoutGroup.
2928                         Margin = value.Margin,
2929                         Padding = value.Padding,
2930                     };
2931                 }
2932
2933                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2934                 // View if no replacement. Previously margin and padding values would have been moved from
2935                 // the View to the layout.
2936                 if (layout != null) // Existing layout
2937                 {
2938                     if (value != null)
2939                     {
2940                         // Existing layout being replaced so copy over margin and padding values.
2941                         value.Margin = layout.Margin;
2942                         value.Padding = layout.Padding;
2943                         value.SetPositionByLayout = !excludeLayouting;
2944                     }
2945                     else
2946                     {
2947                         // Layout not being replaced so restore margin and padding to View.
2948                         SetValue(MarginProperty, layout.Margin);
2949                         SetValue(PaddingProperty, layout.Padding);
2950                         NotifyPropertyChanged();
2951                     }
2952                 }
2953                 else
2954                 {
2955                     // First Layout to be added to the View hence copy
2956
2957                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2958                     if (value != null)
2959                     {
2960                         Extents margin = Margin;
2961                         Extents padding = Padding;
2962                         bool setMargin = false;
2963                         bool setPadding = false;
2964
2965                         if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2966                         {
2967                             // If View already has a margin set then store it in Layout instead.
2968                             value.Margin = margin;
2969                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2970                             setMargin = true;
2971                         }
2972
2973                         if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2974                         {
2975                             // If View already has a padding set then store it in Layout instead.
2976                             value.Padding = padding;
2977                             SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2978                             setPadding = true;
2979                         }
2980
2981                         if (setMargin || setPadding)
2982                         {
2983                             NotifyPropertyChanged();
2984                         }
2985
2986                         value.SetPositionByLayout = !excludeLayouting;
2987                     }
2988                 }
2989
2990                 // Remove existing layout from it's parent layout group.
2991                 layout?.Unparent();
2992
2993                 // Set layout to this view
2994                 SetLayout(value);
2995             }
2996         }
2997
2998         /// <summary>
2999         /// The weight of the View, used to share available space in a layout with siblings.
3000         /// </summary>
3001         /// <since_tizen> 6 </since_tizen>
3002         public float Weight
3003         {
3004             get
3005             {
3006                 return weight;
3007             }
3008             set
3009             {
3010                 weight = value;
3011                 layout?.RequestLayout();
3012             }
3013         }
3014
3015         /// <summary>
3016         ///  Whether to load the BackgroundImage synchronously.
3017         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3018         ///  Note: For Normal Quad images only.
3019         /// </summary>
3020         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3021         [EditorBrowsable(EditorBrowsableState.Never)]
3022         public bool BackgroundImageSynchronosLoading
3023         {
3024             get
3025             {
3026                 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3027             }
3028             set
3029             {
3030                 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3031                 NotifyPropertyChanged();
3032             }
3033         }
3034
3035         private bool InternalBackgroundImageSynchronosLoading
3036         {
3037             get
3038             {
3039                 return BackgroundImageSynchronousLoading;
3040             }
3041             set
3042             {
3043                 BackgroundImageSynchronousLoading = value;
3044             }
3045         }
3046
3047         /// <summary>
3048         ///  Whether to load the BackgroundImage synchronously.
3049         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3050         ///  Note: For Normal Quad images only.
3051         /// </summary>
3052         /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3053         [EditorBrowsable(EditorBrowsableState.Never)]
3054         public bool BackgroundImageSynchronousLoading
3055         {
3056             get
3057             {
3058                 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3059             }
3060             set
3061             {
3062                 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3063                 NotifyPropertyChanged();
3064             }
3065         }
3066
3067         private bool InternalBackgroundImageSynchronousLoading
3068         {
3069             get
3070             {
3071                 return backgroundImageSynchronousLoading;
3072             }
3073             set
3074             {
3075                 backgroundImageSynchronousLoading = value;
3076
3077                 if (!string.IsNullOrEmpty(BackgroundImage))
3078                 {
3079                     PropertyMap bgMap = this.Background;
3080                     var temp = new PropertyValue(backgroundImageSynchronousLoading);
3081                     bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3082                     temp.Dispose();
3083                     Background = bgMap;
3084                 }
3085             }
3086         }
3087
3088         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3089         [EditorBrowsable(EditorBrowsableState.Never)]
3090         public Vector4 UpdateAreaHint
3091         {
3092             get
3093             {
3094                 return (Vector4)GetValue(UpdateAreaHintProperty);
3095             }
3096             set
3097             {
3098                 SetValue(UpdateAreaHintProperty, value);
3099                 NotifyPropertyChanged();
3100             }
3101         }
3102
3103         /// <summary>
3104         /// Enable/Disable ControlState propagation for children.
3105         /// It is false by default.
3106         /// If the View needs to share ControlState with descendants, please set it true.
3107         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3108         /// </summary>
3109         [EditorBrowsable(EditorBrowsableState.Never)]
3110         public bool EnableControlStatePropagation
3111         {
3112             get
3113             {
3114                 return (bool)GetValue(EnableControlStatePropagationProperty);
3115             }
3116             set
3117             {
3118                 SetValue(EnableControlStatePropagationProperty, value);
3119                 NotifyPropertyChanged();
3120             }
3121         }
3122
3123         private bool InternalEnableControlStatePropagation
3124         {
3125             get => themeData?.ControlStatePropagation ?? false;
3126             set
3127             {
3128                 if (InternalEnableControlStatePropagation == value) return;
3129
3130                 if (themeData == null) themeData = new ThemeData();
3131
3132                 themeData.ControlStatePropagation = value;
3133
3134                 foreach (View child in Children)
3135                 {
3136                     child.EnableControlStatePropagation = value;
3137                 }
3138             }
3139         }
3140
3141         /// <summary>
3142         /// The ControlStates can propagate from the parent.
3143         /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3144         /// if parent view EnableControlState is true.
3145         /// <see cref="EnableControlState"/>.
3146         /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3147         /// </summary>
3148         [EditorBrowsable(EditorBrowsableState.Never)]
3149         public ControlState PropagatableControlStates
3150         {
3151             get
3152             {
3153                 return (ControlState)GetValue(PropagatableControlStatesProperty);
3154             }
3155             set
3156             {
3157                 SetValue(PropagatableControlStatesProperty, value);
3158                 NotifyPropertyChanged();
3159             }
3160         }
3161
3162         private ControlState InternalPropagatableControlStates
3163         {
3164             get => propagatableControlStates;
3165             set => propagatableControlStates = value;
3166         }
3167
3168         /// <summary>
3169         /// By default, it is false in View, true in Control.
3170         /// Note that if the value is true, the View will be a touch receptor.
3171         /// </summary>
3172         [EditorBrowsable(EditorBrowsableState.Never)]
3173         public bool EnableControlState
3174         {
3175             get
3176             {
3177                 return (bool)GetValue(EnableControlStateProperty);
3178             }
3179             set
3180             {
3181                 SetValue(EnableControlStateProperty, value);
3182             }
3183         }
3184
3185         /// <summary>
3186         /// Whether the actor grab all touches even if touch leaves its boundary.
3187         /// </summary>
3188         /// <returns>true, if it grab all touch after start</returns>
3189         [EditorBrowsable(EditorBrowsableState.Never)]
3190         public bool GrabTouchAfterLeave
3191         {
3192             get
3193             {
3194                 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3195             }
3196             set
3197             {
3198                 SetValue(GrabTouchAfterLeaveProperty, value);
3199             }
3200         }
3201
3202         private bool InternalGrabTouchAfterLeave
3203         {
3204             get
3205             {
3206                 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3207             }
3208             set
3209             {
3210                 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3211                 NotifyPropertyChanged();
3212             }
3213         }
3214
3215         /// <summary>
3216         /// Whether the view will only receive own touch.
3217         /// </summary>
3218         /// <returns>true, if it only receives touches that started from itself.</returns>
3219         [EditorBrowsable(EditorBrowsableState.Never)]
3220         public bool AllowOnlyOwnTouch
3221         {
3222             get
3223             {
3224                 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3225             }
3226             set
3227             {
3228                 SetValue(AllowOnlyOwnTouchProperty, value);
3229             }
3230         }
3231
3232         private bool InternalAllowOnlyOwnTouch
3233         {
3234             get
3235             {
3236                 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3237             }
3238             set
3239             {
3240                 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3241                 NotifyPropertyChanged();
3242             }
3243         }
3244
3245         /// <summary>
3246         /// Determines which blend equation will be used to render renderers of this actor.
3247         /// </summary>
3248         /// <returns>blend equation enum currently assigned</returns>
3249         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3250         [EditorBrowsable(EditorBrowsableState.Never)]
3251         public BlendEquationType BlendEquation
3252         {
3253             get
3254             {
3255                 return (BlendEquationType)GetValue(BlendEquationProperty);
3256             }
3257             set
3258             {
3259                 SetValue(BlendEquationProperty, value);
3260             }
3261         }
3262
3263         private BlendEquationType InternalBlendEquation
3264         {
3265             get
3266             {
3267                 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3268             }
3269             set
3270             {
3271                 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3272                 NotifyPropertyChanged();
3273             }
3274         }
3275
3276         /// <summary>
3277         /// If the value is true, the View will change its style as the theme changes.
3278         /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3279         /// </summary>
3280         /// <since_tizen> 9 </since_tizen>
3281         public bool ThemeChangeSensitive
3282         {
3283             get => (bool)GetValue(ThemeChangeSensitiveProperty);
3284             set => SetValue(ThemeChangeSensitiveProperty, value);
3285         }
3286
3287         /// <summary>
3288         /// Create Style, it is abstract function and must be override.
3289         /// </summary>
3290         [EditorBrowsable(EditorBrowsableState.Never)]
3291         protected virtual ViewStyle CreateViewStyle()
3292         {
3293             return new ViewStyle();
3294         }
3295
3296         /// <summary>
3297         /// Called after the View's ControlStates changed.
3298         /// </summary>
3299         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3300         [EditorBrowsable(EditorBrowsableState.Never)]
3301         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3302         {
3303         }
3304
3305         /// <summary>
3306         /// </summary>
3307         [EditorBrowsable(EditorBrowsableState.Never)]
3308         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3309         {
3310             isThemeChanged = true;
3311             if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3312             else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3313             isThemeChanged = false;
3314         }
3315
3316         /// <summary>
3317         /// Apply style instance to the view.
3318         /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3319         /// </summary>
3320         /// <since_tizen> 9 </since_tizen>
3321         public virtual void ApplyStyle(ViewStyle viewStyle)
3322         {
3323             if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3324
3325             if (themeData == null) themeData = new ThemeData();
3326
3327             themeData.viewStyle = viewStyle;
3328
3329             if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3330             {
3331                 // Nothing to apply
3332                 return;
3333             }
3334
3335             BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3336
3337             if (bindablePropertyOfView == null)
3338             {
3339                 return;
3340             }
3341
3342             var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3343             viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3344
3345             foreach (var sourceProperty in dirtyStyleProperties)
3346             {
3347                 var sourceValue = viewStyle.GetValue(sourceProperty);
3348
3349                 if (sourceValue == null)
3350                 {
3351                     continue;
3352                 }
3353
3354                 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3355
3356                 // Do not set value again when theme is changed and the value has been set already.
3357                 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3358                 {
3359                     continue;
3360                 }
3361
3362                 if (destinationProperty != null)
3363                 {
3364                     InternalSetValue(destinationProperty, sourceValue);
3365                 }
3366             }
3367         }
3368
3369         /// <summary>
3370         /// Get whether the View is culled or not.
3371         /// True means that the View is out of the view frustum.
3372         /// </summary>
3373         /// <remarks>
3374         /// Hidden-API (Inhouse-API).
3375         /// </remarks>
3376         [EditorBrowsable(EditorBrowsableState.Never)]
3377         public bool Culled
3378         {
3379             get
3380             {
3381                 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3382             }
3383         }
3384
3385         /// <summary>
3386         /// Set or Get TransitionOptions for the page transition.
3387         /// This property is used to define how this view will be transitioned during Page switching.
3388         /// </summary>
3389         /// <since_tizen> 9 </since_tizen>
3390         public TransitionOptions TransitionOptions
3391         {
3392             get
3393             {
3394                 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3395             }
3396             set
3397             {
3398                 SetValue(TransitionOptionsProperty, value);
3399                 NotifyPropertyChanged();
3400             }
3401         }
3402
3403         private TransitionOptions InternalTransitionOptions
3404         {
3405             set
3406             {
3407                 transitionOptions = value;
3408             }
3409             get
3410             {
3411                 return transitionOptions;
3412             }
3413         }
3414
3415         /// <summary>
3416         /// Gets or sets the status of whether the view should emit key event signals.
3417         /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3418         /// </summary>
3419         [EditorBrowsable(EditorBrowsableState.Never)]
3420         public bool DispatchKeyEvents
3421         {
3422             get
3423             {
3424                 return (bool)GetValue(DispatchKeyEventsProperty);
3425             }
3426             set
3427             {
3428                 SetValue(DispatchKeyEventsProperty, value);
3429                 NotifyPropertyChanged();
3430             }
3431         }
3432
3433         /// <summary>
3434         /// Gets or sets the status of whether touch events can be dispatched.
3435         /// 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.
3436         /// This works without adding a TouchEvent callback in the View.
3437         /// <note>
3438         /// 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.
3439         /// </note>
3440         /// </summary>
3441         [EditorBrowsable(EditorBrowsableState.Never)]
3442         public bool DispatchTouchEvents
3443         {
3444             get
3445             {
3446                 return dispatchTouchEvents;
3447             }
3448             set
3449             {
3450                 if (dispatchTouchEvents != value)
3451                 {
3452                     dispatchTouchEvents = value;
3453                     if (dispatchTouchEvents == false)
3454                     {
3455                         TouchEvent += OnDispatchTouchEvent;
3456                     }
3457                     else
3458                     {
3459                         TouchEvent -= OnDispatchTouchEvent;
3460                     }
3461                 }
3462             }
3463         }
3464
3465         private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3466         {
3467             return true;
3468         }
3469
3470         /// <summary>
3471         /// Gets or sets the status of whether the view should emit Gesture event signals.
3472         /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3473         /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3474         /// </summary>
3475         [EditorBrowsable(EditorBrowsableState.Never)]
3476         public bool DispatchGestureEvents
3477         {
3478             get
3479             {
3480                 return dispatchGestureEvents;
3481             }
3482             set
3483             {
3484                 if (dispatchGestureEvents != value)
3485                 {
3486                     dispatchGestureEvents = value;
3487                     ConfigGestureDetector(dispatchGestureEvents);
3488                 }
3489             }
3490         }
3491
3492         /// <summary>
3493         /// Gets or sets the status of whether the view should emit Gesture event signals.
3494         /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3495         /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3496         /// </summary>
3497         [EditorBrowsable(EditorBrowsableState.Never)]
3498         public bool DispatchParentGestureEvents
3499         {
3500             get
3501             {
3502                 return dispatchParentGestureEvents;
3503             }
3504             set
3505             {
3506                 if (dispatchParentGestureEvents != value)
3507                 {
3508                     dispatchParentGestureEvents = value;
3509                     ConfigGestureDetector(dispatchParentGestureEvents);
3510                 }
3511             }
3512         }
3513
3514         private void ConfigGestureDetector(bool dispatch)
3515         {
3516             if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3517             if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3518             if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3519             if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3520             if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3521
3522             if (dispatch == true)
3523             {
3524                 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3525                 if (configGestureCount == 0)
3526                 {
3527                     panGestureDetector.Detach(this);
3528                     longGestureDetector.Detach(this);
3529                     pinchGestureDetector.Detach(this);
3530                     tapGestureDetector.Detach(this);
3531                     rotationGestureDetector.Detach(this);
3532
3533                     panGestureDetector.Detected -= OnGestureDetected;
3534                     longGestureDetector.Detected -= OnGestureDetected;
3535                     pinchGestureDetector.Detected -= OnGestureDetected;
3536                     tapGestureDetector.Detected -= OnGestureDetected;
3537                     rotationGestureDetector.Detected -= OnGestureDetected;
3538
3539                     panGestureDetector = null;
3540                     longGestureDetector = null;
3541                     pinchGestureDetector = null;
3542                     tapGestureDetector = null;
3543                     rotationGestureDetector = null;
3544                 }
3545             }
3546             else
3547             {
3548                 if (configGestureCount == 0)
3549                 {
3550                     panGestureDetector.Attach(this);
3551                     longGestureDetector.Attach(this);
3552                     pinchGestureDetector.Attach(this);
3553                     tapGestureDetector.Attach(this);
3554                     rotationGestureDetector.Attach(this);
3555
3556                     panGestureDetector.Detected += OnGestureDetected;
3557                     longGestureDetector.Detected += OnGestureDetected;
3558                     pinchGestureDetector.Detected += OnGestureDetected;
3559                     tapGestureDetector.Detected += OnGestureDetected;
3560                     rotationGestureDetector.Detected += OnGestureDetected;
3561                 }
3562                 configGestureCount++;
3563             }
3564         }
3565
3566         private void OnGestureDetected(object source, EventArgs e)
3567         {
3568             // Does notting. This is to consume the gesture.
3569         }
3570
3571         /// <summary>
3572         /// Called when the view is hit through TouchEvent or GestureEvent.
3573         /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3574         /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3575         /// User can override whether hit or not in HitTest.
3576         /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3577         /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3578         /// </summary>
3579         // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3580         [EditorBrowsable(EditorBrowsableState.Never)]
3581         protected virtual bool HitTest(Touch touch)
3582         {
3583             return true;
3584         }
3585
3586         /// <summary>
3587         /// Retrieve the View's current Color.
3588         /// </summary>
3589         /// <remarks>
3590         /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3591         /// 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).
3592         /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3593         /// and users can get the current actual values through them.
3594         /// </remarks>
3595         [EditorBrowsable(EditorBrowsableState.Never)]
3596         public Color CurrentColor => GetCurrentColor();
3597
3598         /// <summary>
3599         /// Retrieve the current scale factor applied to the View.
3600         /// </summary>
3601         /// <remarks>
3602         /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3603         /// 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).
3604         /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3605         /// and users can get the current actual values through them.
3606         /// </remarks>
3607         [EditorBrowsable(EditorBrowsableState.Never)]
3608         public Vector3 CurrentScale => GetCurrentScale();
3609
3610     }
3611 }