[NUI] Fix some typo and grammar mistake
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 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         internal BackgroundExtraData backgroundExtraData;
32
33         private bool layoutSet = false;
34         private LayoutItem layout; // Exclusive layout assigned to this View.
35
36         // List of transitions paired with the condition that uses the transition.
37         private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
38         private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
39         private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
40         private float weight = 0.0f; // Weighting of child View in a Layout
41         private bool backgroundImageSynchronosLoading = false;
42         private bool controlStatePropagation = false;
43         private ViewStyle viewStyle;
44         private bool themeChangeSensitive = false;
45         private bool excludeLayouting = false;
46         private LayoutTransition layoutTransition;
47         private ControlState controlStates = ControlState.Normal;
48         private TransitionOptions transitionOptions = null;
49
50         static View() { }
51
52         /// <summary>
53         /// Creates a new instance of a view.
54         /// </summary>
55         /// <since_tizen> 3 </since_tizen>
56         public View() : this(Interop.View.New(), true)
57         {
58             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59         }
60
61         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
62         [EditorBrowsable(EditorBrowsableState.Never)]
63         public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
64         {
65         }
66
67         /// <summary>
68         /// Create a new instance of a View with setting the status of shown or hidden.
69         /// </summary>
70         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
71         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
72         [EditorBrowsable(EditorBrowsableState.Never)]
73         public View(bool shown) : this(Interop.View.New(), true)
74         {
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76             SetVisible(shown);
77         }
78
79         internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
80         {
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82             if (!shown)
83             {
84                 SetVisible(false);
85             }
86
87             backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
88         }
89
90         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
91         {
92             InitializeStyle(viewStyle);
93         }
94
95         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
96         {
97             if (HasBody())
98             {
99                 PositionUsesPivotPoint = false;
100             }
101
102             onWindowSendEventCallback = SendViewAddedEventToWindow;
103             this.OnWindowSignal().Connect(onWindowSendEventCallback);
104
105             if (!shown)
106             {
107                 SetVisible(false);
108             }
109         }
110
111         internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
112         {
113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114
115             if (!shown)
116             {
117                 SetVisible(false);
118             }
119         }
120
121         /// <summary>
122         /// The event that is triggered when the View's ControlState is changed.
123         /// </summary>
124         [EditorBrowsable(EditorBrowsableState.Never)]
125         public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
126
127         internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
128
129
130         /// <summary>
131         /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
132         /// </summary>
133         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
134         [EditorBrowsable(EditorBrowsableState.Never)]
135         public bool LayoutSet
136         {
137             get
138             {
139                 return layoutSet;
140             }
141         }
142
143         /// <summary>
144         /// Flag to allow Layouting to be disabled for Views.
145         /// Once a View has a Layout set then any children added to Views from then on will receive
146         /// automatic Layouts.
147         /// </summary>
148         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
149         [EditorBrowsable(EditorBrowsableState.Never)]
150         public static bool LayoutingDisabled { get; set; } = true;
151
152         /// <summary>
153         /// The style instance applied to this view.
154         /// Note that please do not modify the ViewStyle.
155         /// Modifying ViewStyle will affect other views with same ViewStyle.
156         /// </summary>
157         [EditorBrowsable(EditorBrowsableState.Never)]
158         protected ViewStyle ViewStyle
159         {
160             get
161             {
162                 if (null == viewStyle)
163                 {
164                     ApplyStyle(CreateViewStyle());
165                 }
166
167                 return viewStyle;
168             }
169         }
170
171         /// <summary>
172         /// Get/Set the control state.
173         /// Note that the ControlState only available for the classes derived from Control.
174         /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
175         /// please set <see cref="EnableControlState"/> to true.
176         /// </summary>
177         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
178         [EditorBrowsable(EditorBrowsableState.Never)]
179         public ControlState ControlState
180         {
181             get
182             {
183                 return controlStates;
184             }
185             protected set
186             {
187                 if (controlStates == value)
188                 {
189                     return;
190                 }
191
192                 var prevState = controlStates;
193
194                 controlStates = value;
195
196                 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
197
198                 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
199
200                 if (controlStatePropagation)
201                 {
202                     foreach (View child in Children)
203                     {
204                         child.ControlState = value;
205                     }
206                 }
207
208                 OnControlStateChanged(changeInfo);
209
210                 ControlStateChangedEvent?.Invoke(this, changeInfo);
211             }
212         }
213
214         /// <summary>
215         /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
216         /// </summary>
217         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
218         [EditorBrowsable(EditorBrowsableState.Never)]
219         public bool ExcludeLayouting
220         {
221             get
222             {
223                 return excludeLayouting;
224             }
225             set
226             {
227                 excludeLayouting = value;
228                 if (Layout != null && Layout.SetPositionByLayout == value)
229                 {
230                     Layout.SetPositionByLayout = !value;
231                     Layout.RequestLayout();
232                 }
233             }
234         }
235
236         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
237         [EditorBrowsable(EditorBrowsableState.Never)]
238         public bool IsResourcesCreated
239         {
240             get
241             {
242                 return Application.Current.IsResourcesCreated;
243             }
244         }
245
246         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
247         [EditorBrowsable(EditorBrowsableState.Never)]
248         public ResourceDictionary XamlResources
249         {
250             get
251             {
252                 return Application.Current.XamlResources;
253             }
254             set
255             {
256                 Application.Current.XamlResources = value;
257             }
258         }
259
260         /// <summary>
261         /// The StyleName, type string.
262         /// The value indicates DALi style name defined in json theme file.
263         /// </summary>
264         /// <since_tizen> 3 </since_tizen>
265         public string StyleName
266         {
267             get
268             {
269                 return (string)GetValue(StyleNameProperty);
270             }
271             set
272             {
273                 SetValue(StyleNameProperty, value);
274                 NotifyPropertyChanged();
275             }
276         }
277
278         /// <summary>
279         /// The KeyInputFocus, type bool.
280         /// </summary>
281         [EditorBrowsable(EditorBrowsableState.Never)]
282         public bool KeyInputFocus
283         {
284             get
285             {
286                 return (bool)GetValue(KeyInputFocusProperty);
287             }
288             set
289             {
290                 SetValue(KeyInputFocusProperty, value);
291                 NotifyPropertyChanged();
292             }
293         }
294
295         /// <summary>
296         /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
297         /// </summary>
298         /// <remarks>
299         /// <para>
300         /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
301         /// </para>
302         /// <para>
303         /// Animatable - This property can be animated using <c>Animation</c> class.
304         /// <code>
305         /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
306         /// </code>
307         /// </para>
308         /// </remarks>
309         /// <since_tizen> 3 </since_tizen>
310         public Color BackgroundColor
311         {
312             get
313             {
314                 Color temp = (Color)GetValue(BackgroundColorProperty);
315                 return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
316             }
317             set
318             {
319                 SetValue(BackgroundColorProperty, value);
320                 NotifyPropertyChanged();
321             }
322         }
323
324         /// <summary>
325         /// The mutually exclusive with "backgroundColor" and "background" type Map.
326         /// </summary>
327         /// <since_tizen> 3 </since_tizen>
328         public string BackgroundImage
329         {
330             get
331             {
332                 return (string)GetValue(BackgroundImageProperty);
333             }
334             set
335             {
336                 SetValue(BackgroundImageProperty, value);
337                 NotifyPropertyChanged();
338             }
339         }
340
341         /// <summary>
342         /// Get or set the border of background image.
343         /// </summary>
344         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
345         [EditorBrowsable(EditorBrowsableState.Never)]
346         public Rectangle BackgroundImageBorder
347         {
348             get
349             {
350                 return (Rectangle)GetValue(BackgroundImageBorderProperty);
351             }
352             set
353             {
354                 SetValue(BackgroundImageBorderProperty, value);
355                 NotifyPropertyChanged();
356             }
357         }
358
359         /// <summary>
360         /// The background of view.
361         /// </summary>
362         /// <since_tizen> 3 </since_tizen>
363         public Tizen.NUI.PropertyMap Background
364         {
365             get
366             {
367                 return (PropertyMap)GetValue(BackgroundProperty);
368             }
369             set
370             {
371                 SetValue(BackgroundProperty, value);
372                 NotifyPropertyChanged();
373             }
374         }
375
376         /// <summary>
377         /// Describes a shadow as an image for a View.
378         /// It is null by default.
379         /// </summary>
380         /// <remarks>
381         /// Getter returns copied instance of current shadow.
382         /// </remarks>
383         /// <remarks>
384         /// The mutually exclusive with "BoxShadow".
385         /// </remarks>
386         /// <remarks>
387         /// <para>
388         /// Animatable - This property can be animated using <c>Animation</c> class.
389         /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
390         /// <code>
391         /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
392         /// </code>
393         /// Animatable sub-property : Offset.
394         /// </para>
395         /// </remarks>
396         [EditorBrowsable(EditorBrowsableState.Never)]
397         public ImageShadow ImageShadow
398         {
399             get
400             {
401                 return (ImageShadow)GetValue(ImageShadowProperty);
402             }
403             set
404             {
405                 SetValue(ImageShadowProperty, value);
406                 NotifyPropertyChanged();
407             }
408         }
409
410         /// <summary>
411         /// Describes a box shaped shadow drawing for a View.
412         /// It is null by default.
413         /// </summary>
414         /// <remarks>
415         /// The mutually exclusive with "ImageShadow".
416         /// </remarks>
417         /// <remarks>
418         /// <para>
419         /// Animatable - This property can be animated using <c>Animation</c> class.
420         /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
421         /// <code>
422         /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
423         /// </code>
424         /// Animatable sub-property : Offset, Color, BlurRadius.
425         /// </para>
426         /// </remarks>
427         /// <since_tizen> 9 </since_tizen>
428         public Shadow BoxShadow
429         {
430             get
431             {
432                 return (Shadow)GetValue(BoxShadowProperty);
433             }
434             set
435             {
436                 SetValue(BoxShadowProperty, value);
437                 NotifyPropertyChanged();
438             }
439         }
440
441         /// <summary>
442         /// The radius for the rounded corners of the View.
443         /// This will rounds background and shadow edges.
444         /// 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).
445         /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
446         /// </summary>
447         /// <remarks>
448         /// <para>
449         /// Animatable - This property can be animated using <c>Animation</c> class.
450         /// </para>
451         /// </remarks>
452         /// <since_tizen> 9 </since_tizen>
453         public Vector4 CornerRadius
454         {
455             get
456             {
457                 return (Vector4)GetValue(CornerRadiusProperty);
458             }
459             set
460             {
461                 SetValue(CornerRadiusProperty, value);
462                 NotifyPropertyChanged();
463             }
464         }
465
466         //
467         // Accessibility
468         //
469
470         [EditorBrowsable(EditorBrowsableState.Never)]
471         protected bool IsHighlighted
472         {
473             get
474             {
475                 using (View view = Accessibility.Accessibility.Instance.GetCurrentlyHighlightedView())
476                 {
477                     return view == this;
478                 }
479             }
480         }
481
482         [EditorBrowsable(EditorBrowsableState.Never)]
483         protected static readonly string AccessibilityActivateAction = "activate";
484         [EditorBrowsable(EditorBrowsableState.Never)]
485         protected static readonly string AccessibilityReadingSkippedAction = "ReadingSkipped";
486         [EditorBrowsable(EditorBrowsableState.Never)]
487         protected static readonly string AccessibilityReadingCancelledAction = "ReadingCancelled";
488         [EditorBrowsable(EditorBrowsableState.Never)]
489         protected static readonly string AccessibilityReadingStoppedAction = "ReadingStopped";
490         [EditorBrowsable(EditorBrowsableState.Never)]
491         protected static readonly string AccessibilityReadingPausedAction = "ReadingPaused";
492         [EditorBrowsable(EditorBrowsableState.Never)]
493         protected static readonly string AccessibilityReadingResumedAction = "ReadingResumed";
494
495         [EditorBrowsable(EditorBrowsableState.Never)]
496         private static readonly string[] AccessibilityActions = {
497             AccessibilityActivateAction,
498             AccessibilityReadingSkippedAction,
499             AccessibilityReadingCancelledAction,
500             AccessibilityReadingStoppedAction,
501             AccessibilityReadingPausedAction,
502             AccessibilityReadingResumedAction,
503         };
504
505         [EditorBrowsable(EditorBrowsableState.Never)]
506         protected virtual string AccessibilityGetName()
507         {
508             return "";
509         }
510
511         [EditorBrowsable(EditorBrowsableState.Never)]
512         protected virtual string AccessibilityGetDescription()
513         {
514             return "";
515         }
516
517         [EditorBrowsable(EditorBrowsableState.Never)]
518         protected virtual bool AccessibilityDoAction(string name)
519         {
520             return false;
521         }
522
523         [EditorBrowsable(EditorBrowsableState.Never)]
524         protected virtual AccessibilityStates AccessibilityCalculateStates()
525         {
526             var states = new AccessibilityStates();
527             states.Set(AccessibilityState.Highlightable, this.AccessibilityHighlightable);
528             states.Set(AccessibilityState.Focusable, this.Focusable);
529             states.Set(AccessibilityState.Focused, this.State == States.Focused);
530             states.Set(AccessibilityState.Highlighted, this.IsHighlighted);
531             states.Set(AccessibilityState.Enabled, this.State != States.Disabled);
532             states.Set(AccessibilityState.Sensitive, this.Sensitive);
533             states.Set(AccessibilityState.Animated, this.AccessibilityAnimated);
534             states.Set(AccessibilityState.Visible, true);
535             states.Set(AccessibilityState.Showing, this.Visibility);
536             states.Set(AccessibilityState.Defunct, !this.IsOnWindow);
537             return states;
538         }
539
540         [EditorBrowsable(EditorBrowsableState.Never)]
541         protected virtual int AccessibilityGetActionCount()
542         {
543             return AccessibilityActions.Length;
544         }
545
546         [EditorBrowsable(EditorBrowsableState.Never)]
547         protected virtual string AccessibilityGetActionName(int index)
548         {
549             if (index >= 0 && index < AccessibilityActions.Length)
550                 return AccessibilityActions[index];
551             else
552                 return "";
553         }
554
555         [EditorBrowsable(EditorBrowsableState.Never)]
556         protected virtual bool AccessibilityShouldReportZeroChildren()
557         {
558             return false;
559         }
560
561         [EditorBrowsable(EditorBrowsableState.Never)]
562         protected virtual double AccessibilityGetMinimum()
563         {
564             return 0.0;
565         }
566
567         [EditorBrowsable(EditorBrowsableState.Never)]
568         protected virtual double AccessibilityGetCurrent()
569         {
570             return 0.0;
571         }
572
573         [EditorBrowsable(EditorBrowsableState.Never)]
574         protected virtual double AccessibilityGetMaximum()
575         {
576             return 0.0;
577         }
578
579         [EditorBrowsable(EditorBrowsableState.Never)]
580         protected virtual bool AccessibilitySetCurrent(double value)
581         {
582             return false;
583         }
584
585         [EditorBrowsable(EditorBrowsableState.Never)]
586         protected virtual double AccessibilityGetMinimumIncrement()
587         {
588             return 0.0;
589         }
590
591         [EditorBrowsable(EditorBrowsableState.Never)]
592         protected virtual bool AccessibilityIsScrollable()
593         {
594             return false;
595         }
596
597         [EditorBrowsable(EditorBrowsableState.Never)]
598         protected virtual string AccessibilityGetText(int startOffset, int endOffset)
599         {
600             return "";
601         }
602
603         [EditorBrowsable(EditorBrowsableState.Never)]
604         protected virtual int AccessibilityGetCharacterCount()
605         {
606             return 0;
607         }
608
609         [EditorBrowsable(EditorBrowsableState.Never)]
610         protected virtual int AccessibilityGetCaretOffset()
611         {
612             return 0;
613         }
614
615         [EditorBrowsable(EditorBrowsableState.Never)]
616         protected virtual bool AccessibilitySetCaretOffset(int offset)
617         {
618             return false;
619         }
620
621         [EditorBrowsable(EditorBrowsableState.Never)]
622         protected virtual AccessibilityRange AccessibilityGetTextAtOffset(int offset, TextBoundary boundary)
623         {
624             return new AccessibilityRange();
625         }
626
627         [EditorBrowsable(EditorBrowsableState.Never)]
628         protected virtual AccessibilityRange AccessibilityGetSelection(int selectionNum)
629         {
630             return new AccessibilityRange();
631         }
632
633         [EditorBrowsable(EditorBrowsableState.Never)]
634         protected virtual bool AccessibilityRemoveSelection(int selectionNum)
635         {
636             return false;
637         }
638
639         [EditorBrowsable(EditorBrowsableState.Never)]
640         protected virtual bool AccessibilitySetSelection(int selectionNum, int startOffset, int endOffset)
641         {
642             return false;
643         }
644
645         [EditorBrowsable(EditorBrowsableState.Never)]
646         protected virtual bool AccessibilityCopyText(int startPosition, int endPosition)
647         {
648             return false;
649         }
650
651         [EditorBrowsable(EditorBrowsableState.Never)]
652         protected virtual bool AccessibilityCutText(int startPosition, int endPosition)
653         {
654             return false;
655         }
656
657         /// <summary>
658         /// Whether the CornerRadius property value is relative (percentage [0.0f to 1.0f] of the view size) or absolute (in world units).
659         /// It is absolute by default.
660         /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
661         /// </summary>
662         /// <since_tizen> 9 </since_tizen>
663         public VisualTransformPolicyType CornerRadiusPolicy
664         {
665             get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
666             set => SetValue(CornerRadiusPolicyProperty, value);
667         }
668
669         /// <summary>
670         /// The current state of the view.
671         /// </summary>
672         /// <since_tizen> 3 </since_tizen>
673         public States State
674         {
675             get
676             {
677                 return (States)GetValue(StateProperty);
678             }
679             set
680             {
681                 SetValue(StateProperty, value);
682                 NotifyPropertyChanged();
683             }
684         }
685
686         /// <summary>
687         /// The current sub state of the view.
688         /// </summary>
689         /// <since_tizen> 3 </since_tizen>
690         public States SubState
691         {
692             get
693             {
694                 return (States)GetValue(SubStateProperty);
695             }
696             set
697             {
698                 SetValue(SubStateProperty, value);
699                 NotifyPropertyChanged();
700             }
701         }
702
703         /// <summary>
704         /// Displays a tooltip
705         /// </summary>
706         /// <since_tizen> 3 </since_tizen>
707         public Tizen.NUI.PropertyMap Tooltip
708         {
709             get
710             {
711                 return (PropertyMap)GetValue(TooltipProperty);
712             }
713             set
714             {
715                 SetValue(TooltipProperty, value);
716                 NotifyPropertyChanged();
717             }
718         }
719
720         /// <summary>
721         /// Displays a tooltip as a text.
722         /// </summary>
723         /// <since_tizen> 3 </since_tizen>
724         public string TooltipText
725         {
726             get
727             {
728                 using (var propertyValue = GetProperty(Property.TOOLTIP))
729                 {
730                     if (propertyValue != null && propertyValue.Get(out string retrivedValue))
731                     {
732                         return retrivedValue;
733                     }
734                     NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
735                     return "error to get TooltipText";
736                 }
737             }
738             set
739             {
740                 var temp = new Tizen.NUI.PropertyValue(value);
741                 SetProperty(View.Property.TOOLTIP, temp);
742                 temp.Dispose();
743                 NotifyPropertyChanged();
744             }
745         }
746
747         /// <summary>
748         /// The Child property of FlexContainer.<br />
749         /// The proportion of the free space in the container, the flex item will receive.<br />
750         /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
751         /// </summary>
752         /// <since_tizen> 3 </since_tizen>
753         [Obsolete("Deprecated in API8, will be removed in API10.")]
754         public float Flex
755         {
756             get
757             {
758                 return (float)GetValue(FlexProperty);
759             }
760             set
761             {
762                 SetValue(FlexProperty, value);
763                 NotifyPropertyChanged();
764             }
765         }
766
767         /// <summary>
768         /// The Child property of FlexContainer.<br />
769         /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
770         /// </summary>
771         /// <since_tizen> 3 </since_tizen>
772         [Obsolete("Deprecated in API8, will be removed in API10.")]
773         public int AlignSelf
774         {
775             get
776             {
777                 return (int)GetValue(AlignSelfProperty);
778             }
779             set
780             {
781                 SetValue(AlignSelfProperty, value);
782                 NotifyPropertyChanged();
783             }
784         }
785
786         /// <summary>
787         /// The Child property of FlexContainer.<br />
788         /// The space around the flex item.<br />
789         /// </summary>
790         /// <remarks>
791         /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
792         /// </remarks>
793         /// <since_tizen> 3 </since_tizen>
794         [Obsolete("Deprecated in API8, will be removed in API10.")]
795         public Vector4 FlexMargin
796         {
797             get
798             {
799                 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
800                 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
801             }
802             set
803             {
804                 SetValue(FlexMarginProperty, value);
805                 NotifyPropertyChanged();
806             }
807         }
808
809         /// <summary>
810         /// The top-left cell this child occupies, if not set, the first available cell is used.
811         /// </summary>
812         /// <remarks>
813         /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
814         /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
815         /// </remarks>
816         /// <since_tizen> 3 </since_tizen>
817         public Vector2 CellIndex
818         {
819             get
820             {
821                 Vector2 temp = (Vector2)GetValue(CellIndexProperty);
822                 return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
823             }
824             set
825             {
826                 SetValue(CellIndexProperty, value);
827                 NotifyPropertyChanged();
828             }
829         }
830
831         /// <summary>
832         /// The number of rows this child occupies, if not set, the default value is 1.
833         /// </summary>
834         /// <remarks>
835         /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
836         /// </remarks>
837         /// <since_tizen> 3 </since_tizen>
838         public float RowSpan
839         {
840             get
841             {
842                 return (float)GetValue(RowSpanProperty);
843             }
844             set
845             {
846                 SetValue(RowSpanProperty, value);
847                 NotifyPropertyChanged();
848             }
849         }
850
851         /// <summary>
852         /// The number of columns this child occupies, if not set, the default value is 1.
853         /// </summary>
854         /// <remarks>
855         /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
856         /// </remarks>
857         /// <since_tizen> 3 </since_tizen>
858         public float ColumnSpan
859         {
860             get
861             {
862                 return (float)GetValue(ColumnSpanProperty);
863             }
864             set
865             {
866                 SetValue(ColumnSpanProperty, value);
867                 NotifyPropertyChanged();
868             }
869         }
870
871         /// <summary>
872         /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
873         /// </summary>
874         /// <remarks>
875         /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
876         /// </remarks>
877         /// <since_tizen> 3 </since_tizen>
878         public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
879         {
880             get
881             {
882                 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
883             }
884             set
885             {
886                 SetValue(CellHorizontalAlignmentProperty, value);
887                 NotifyPropertyChanged();
888             }
889         }
890
891         /// <summary>
892         /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
893         /// </summary>
894         /// <remarks>
895         /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
896         /// </remarks>
897         /// <since_tizen> 3 </since_tizen>
898         public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
899         {
900             get
901             {
902                 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
903             }
904             set
905             {
906                 SetValue(CellVerticalAlignmentProperty, value);
907                 NotifyPropertyChanged();
908             }
909         }
910
911         /// <summary>
912         /// The left focusable view.<br />
913         /// This will return null if not set.<br />
914         /// This will also return null if the specified left focusable view is not on a window.<br />
915         /// </summary>
916         /// <since_tizen> 3 </since_tizen>
917         public View LeftFocusableView
918         {
919             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
920             get
921             {
922                 return (View)GetValue(LeftFocusableViewProperty);
923             }
924             set
925             {
926                 SetValue(LeftFocusableViewProperty, value);
927                 NotifyPropertyChanged();
928             }
929         }
930
931         /// <summary>
932         /// The right focusable view.<br />
933         /// This will return null if not set.<br />
934         /// This will also return null if the specified right focusable view is not on a window.<br />
935         /// </summary>
936         /// <since_tizen> 3 </since_tizen>
937         public View RightFocusableView
938         {
939             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
940             get
941             {
942                 return (View)GetValue(RightFocusableViewProperty);
943             }
944             set
945             {
946                 SetValue(RightFocusableViewProperty, value);
947                 NotifyPropertyChanged();
948             }
949         }
950
951         /// <summary>
952         /// The up focusable view.<br />
953         /// This will return null if not set.<br />
954         /// This will also return null if the specified up focusable view is not on a window.<br />
955         /// </summary>
956         /// <since_tizen> 3 </since_tizen>
957         public View UpFocusableView
958         {
959             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
960             get
961             {
962                 return (View)GetValue(UpFocusableViewProperty);
963             }
964             set
965             {
966                 SetValue(UpFocusableViewProperty, value);
967                 NotifyPropertyChanged();
968             }
969         }
970
971         /// <summary>
972         /// The down focusable view.<br />
973         /// This will return null if not set.<br />
974         /// This will also return null if the specified down focusable view is not on a window.<br />
975         /// </summary>
976         /// <since_tizen> 3 </since_tizen>
977         public View DownFocusableView
978         {
979             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
980             get
981             {
982                 return (View)GetValue(DownFocusableViewProperty);
983             }
984             set
985             {
986                 SetValue(DownFocusableViewProperty, value);
987                 NotifyPropertyChanged();
988             }
989         }
990
991         /// <summary>
992         /// Whether the view should be focusable by keyboard navigation.
993         /// </summary>
994         /// <since_tizen> 3 </since_tizen>
995         public bool Focusable
996         {
997             set
998             {
999                 SetValue(FocusableProperty, value);
1000                 NotifyPropertyChanged();
1001             }
1002             get
1003             {
1004                 return (bool)GetValue(FocusableProperty);
1005             }
1006         }
1007
1008         /// <summary>
1009         ///  Retrieves the position of the view.<br />
1010         ///  The coordinates are relative to the view's parent.<br />
1011         /// </summary>
1012         /// <since_tizen> 3 </since_tizen>
1013         public Position CurrentPosition
1014         {
1015             get
1016             {
1017                 return GetCurrentPosition();
1018             }
1019         }
1020
1021         /// <summary>
1022         /// Sets the size of a view for the width and the height.<br />
1023         /// Geometry can be scaled to fit within this area.<br />
1024         /// This does not interfere with the view's scale factor.<br />
1025         /// The views default depth is the minimum of width and height.<br />
1026         /// </summary>
1027         /// <remarks>
1028         /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
1029         /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
1030         /// </remarks>
1031         /// <since_tizen> 3 </since_tizen>
1032         public Size2D Size2D
1033         {
1034             get
1035             {
1036                 Size2D temp = (Size2D)GetValue(Size2DProperty);
1037                 int width = temp.Width;
1038                 int height = temp.Height;
1039
1040                 if (this.Layout == null)
1041                 {
1042                     if (width < 0) { width = 0; }
1043                     if (height < 0) { height = 0; }
1044                 }
1045
1046                 return new Size2D(OnSize2DChanged, width, height);
1047             }
1048             set
1049             {
1050                 SetValue(Size2DProperty, value);
1051
1052                 NotifyPropertyChanged();
1053             }
1054         }
1055
1056         /// <summary>
1057         ///  Retrieves the size of the view.<br />
1058         ///  The coordinates are relative to the view's parent.<br />
1059         /// </summary>
1060         /// <since_tizen> 3 </since_tizen>
1061         public Size2D CurrentSize
1062         {
1063             get
1064             {
1065                 return GetCurrentSize();
1066             }
1067         }
1068
1069         /// <summary>
1070         /// Retrieves and sets the view's opacity.<br />
1071         /// </summary>
1072         /// <since_tizen> 3 </since_tizen>
1073         public float Opacity
1074         {
1075             get
1076             {
1077                 return (float)GetValue(OpacityProperty);
1078             }
1079             set
1080             {
1081                 SetValue(OpacityProperty, value);
1082                 NotifyPropertyChanged();
1083             }
1084         }
1085
1086         /// <summary>
1087         /// Sets the position of the view for X and Y.<br />
1088         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1089         /// If the position inheritance is disabled, sets the world position.<br />
1090         /// </summary>
1091         /// <remarks>
1092         /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
1093         /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
1094         /// </remarks>
1095         /// <since_tizen> 3 </since_tizen>
1096         public Position2D Position2D
1097         {
1098             get
1099             {
1100                 Position2D temp = (Position2D)GetValue(Position2DProperty);
1101                 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
1102             }
1103             set
1104             {
1105                 SetValue(Position2DProperty, value);
1106                 NotifyPropertyChanged();
1107             }
1108         }
1109
1110         /// <summary>
1111         /// Retrieves the screen position of the view.<br />
1112         /// </summary>
1113         /// <since_tizen> 3 </since_tizen>
1114         public Vector2 ScreenPosition
1115         {
1116             get
1117             {
1118                 Vector2 temp = new Vector2(0.0f, 0.0f);
1119                 var pValue = GetProperty(View.Property.ScreenPosition);
1120                 pValue.Get(temp);
1121                 pValue.Dispose();
1122                 return temp;
1123             }
1124         }
1125
1126         /// <summary>
1127         /// Determines whether the pivot point should be used to determine the position of the view.
1128         /// This is false by default.
1129         /// </summary>
1130         /// <remarks>If false, then the top-left of the view is used for the position.
1131         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1132         /// </remarks>
1133         /// <since_tizen> 3 </since_tizen>
1134         public bool PositionUsesPivotPoint
1135         {
1136             get
1137             {
1138                 return (bool)GetValue(PositionUsesPivotPointProperty);
1139             }
1140             set
1141             {
1142                 SetValue(PositionUsesPivotPointProperty, value);
1143                 NotifyPropertyChanged();
1144             }
1145         }
1146
1147         /// <summary>
1148         /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
1149         /// </summary>
1150         /// <since_tizen> 3 </since_tizen>
1151         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
1152             "Like: " +
1153             "View view = new View(); " +
1154             "view.PivotPoint = PivotPoint.Center; " +
1155             "view.PositionUsesPivotPoint = true;" +
1156             " Deprecated in API5: Will be removed in API8")]
1157         [EditorBrowsable(EditorBrowsableState.Never)]
1158         public bool PositionUsesAnchorPoint
1159         {
1160             get
1161             {
1162                 bool temp = false;
1163                 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1164                 pValue.Get(out temp);
1165                 pValue.Dispose();
1166                 return temp;
1167             }
1168             set
1169             {
1170                 var temp = new Tizen.NUI.PropertyValue(value);
1171                 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1172                 temp.Dispose();
1173                 NotifyPropertyChanged();
1174             }
1175         }
1176
1177         /// <summary>
1178         /// Queries whether the view is connected to the stage.<br />
1179         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1180         /// </summary>
1181         /// <since_tizen> 3 </since_tizen>
1182         public bool IsOnWindow
1183         {
1184             get
1185             {
1186                 return OnWindow();
1187             }
1188         }
1189
1190         /// <summary>
1191         /// Gets the depth in the hierarchy for the view.
1192         /// </summary>
1193         /// <since_tizen> 3 </since_tizen>
1194         public int HierarchyDepth
1195         {
1196             get
1197             {
1198                 return GetHierarchyDepth();
1199             }
1200         }
1201
1202         /// <summary>
1203         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1204         /// </summary>
1205         /// <remarks>
1206         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1207         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1208         /// The values set by this property will likely change.
1209         /// </remarks>
1210         /// <since_tizen> 3 </since_tizen>
1211         public int SiblingOrder
1212         {
1213             get
1214             {
1215                 return (int)GetValue(SiblingOrderProperty);
1216             }
1217             set
1218             {
1219                 SetValue(SiblingOrderProperty, value);
1220
1221                 LayoutGroup layout = Layout as LayoutGroup;
1222                 layout?.ChangeLayoutSiblingOrder(value);
1223
1224                 NotifyPropertyChanged();
1225             }
1226         }
1227
1228         /// <summary>
1229         /// Returns the natural size of the view.
1230         /// </summary>
1231         /// <remarks>
1232         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1233         /// </remarks>
1234         /// <since_tizen> 5 </since_tizen>
1235         public Vector3 NaturalSize
1236         {
1237             get
1238             {
1239                 Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1240                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1241                 return ret;
1242             }
1243         }
1244
1245         /// <summary>
1246         /// Returns the natural size (Size2D) of the view.
1247         /// </summary>
1248         /// <remarks>
1249         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1250         /// </remarks>
1251         /// <since_tizen> 4 </since_tizen>
1252         public Size2D NaturalSize2D
1253         {
1254             get
1255             {
1256                 Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1257                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1258
1259                 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1260                 temp.Dispose();
1261                 return sz;
1262             }
1263         }
1264
1265         /// <summary>
1266         /// Gets or sets the origin of a view within its parent's area.<br />
1267         /// 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 />
1268         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1269         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1270         /// </summary>
1271         /// <pre>The view has been initialized.</pre>
1272         /// <since_tizen> 3 </since_tizen>
1273         public Position ParentOrigin
1274         {
1275             get
1276             {
1277                 Position tmp = (Position)GetValue(ParentOriginProperty);
1278                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1279             }
1280             set
1281             {
1282                 SetValue(ParentOriginProperty, value);
1283                 NotifyPropertyChanged();
1284             }
1285         }
1286
1287         /// <summary>
1288         /// Gets or sets the anchor-point of a view.<br />
1289         /// 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 />
1290         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1291         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1292         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1293         /// <pre>The view has been initialized.</pre>
1294         /// </summary>
1295         /// <remarks>
1296         /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
1297         /// </remarks>
1298         /// <since_tizen> 3 </since_tizen>
1299         public Position PivotPoint
1300         {
1301             get
1302             {
1303                 Position tmp = (Position)GetValue(PivotPointProperty);
1304                 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
1305             }
1306             set
1307             {
1308                 SetValue(PivotPointProperty, value);
1309                 NotifyPropertyChanged();
1310             }
1311         }
1312
1313         /// <summary>
1314         /// Gets or sets the size width of the view.
1315         /// </summary>
1316         /// <remarks>
1317         /// <para>
1318         /// Animatable - This property can be animated using <c>Animation</c> class.
1319         /// </para>
1320         /// </remarks>
1321         /// <since_tizen> 3 </since_tizen>
1322         public float SizeWidth
1323         {
1324             get
1325             {
1326                 return (float)GetValue(SizeWidthProperty);
1327             }
1328             set
1329             {
1330                 SetValue(SizeWidthProperty, value);
1331                 NotifyPropertyChanged();
1332             }
1333         }
1334
1335         /// <summary>
1336         /// Gets or sets the size height of the view.
1337         /// </summary>
1338         /// <remarks>
1339         /// <para>
1340         /// Animatable - This property can be animated using <c>Animation</c> class.
1341         /// </para>
1342         /// </remarks>
1343         /// <since_tizen> 3 </since_tizen>
1344         public float SizeHeight
1345         {
1346             get
1347             {
1348                 return (float)GetValue(SizeHeightProperty);
1349             }
1350             set
1351             {
1352                 SetValue(SizeHeightProperty, value);
1353                 NotifyPropertyChanged();
1354             }
1355         }
1356
1357         /// <summary>
1358         /// Gets or sets the position of the view.<br />
1359         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1360         /// If the position inheritance is disabled, sets the world position.<br />
1361         /// </summary>
1362         /// <remarks>
1363         /// <para>
1364         /// Animatable - This property can be animated using <c>Animation</c> class.
1365         /// </para>
1366         /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1367         /// </remarks>
1368         /// <since_tizen> 3 </since_tizen>
1369         public Position Position
1370         {
1371             get
1372             {
1373                 Position tmp = (Position)GetValue(PositionProperty);
1374                 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1375             }
1376             set
1377             {
1378                 SetValue(PositionProperty, value);
1379                 NotifyPropertyChanged();
1380             }
1381         }
1382
1383         /// <summary>
1384         /// Gets or sets the position X of the view.
1385         /// </summary>
1386         /// <remarks>
1387         /// <para>
1388         /// Animatable - This property can be animated using <c>Animation</c> class.
1389         /// </para>
1390         /// </remarks>
1391         /// <since_tizen> 3 </since_tizen>
1392         public float PositionX
1393         {
1394             get
1395             {
1396                 return (float)GetValue(PositionXProperty);
1397             }
1398             set
1399             {
1400                 SetValue(PositionXProperty, value);
1401                 NotifyPropertyChanged();
1402             }
1403         }
1404
1405         /// <summary>
1406         /// Gets or sets the position Y of the view.
1407         /// </summary>
1408         /// <remarks>
1409         /// <para>
1410         /// Animatable - This property can be animated using <c>Animation</c> class.
1411         /// </para>
1412         /// </remarks>
1413         /// <since_tizen> 3 </since_tizen>
1414         public float PositionY
1415         {
1416             get
1417             {
1418                 return (float)GetValue(PositionYProperty);
1419             }
1420             set
1421             {
1422                 SetValue(PositionYProperty, value);
1423                 NotifyPropertyChanged();
1424             }
1425         }
1426
1427         /// <summary>
1428         /// Gets or sets the position Z of the view.
1429         /// </summary>
1430         /// <remarks>
1431         /// <para>
1432         /// Animatable - This property can be animated using <c>Animation</c> class.
1433         /// </para>
1434         /// </remarks>
1435         /// <since_tizen> 3 </since_tizen>
1436         public float PositionZ
1437         {
1438             get
1439             {
1440                 return (float)GetValue(PositionZProperty);
1441             }
1442             set
1443             {
1444                 SetValue(PositionZProperty, value);
1445                 NotifyPropertyChanged();
1446             }
1447         }
1448
1449         /// <summary>
1450         /// Gets or sets the world position of the view.
1451         /// </summary>
1452         /// <since_tizen> 3 </since_tizen>
1453         public Vector3 WorldPosition
1454         {
1455             get
1456             {
1457                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1458                 var pValue = GetProperty(View.Property.WorldPosition);
1459                 pValue.Get(temp);
1460                 pValue.Dispose();
1461                 return temp;
1462             }
1463         }
1464
1465         /// <summary>
1466         /// Gets or sets the orientation of the view.<br />
1467         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1468         /// </summary>
1469         /// <remarks>
1470         /// <para>
1471         /// This is an asynchronous method.
1472         /// </para>
1473         /// <para>
1474         /// Animatable - This property can be animated using <c>Animation</c> class.
1475         /// </para>
1476         /// </remarks>
1477         /// <since_tizen> 3 </since_tizen>
1478         public Rotation Orientation
1479         {
1480             get
1481             {
1482                 return (Rotation)GetValue(OrientationProperty);
1483             }
1484             set
1485             {
1486                 SetValue(OrientationProperty, value);
1487                 NotifyPropertyChanged();
1488             }
1489         }
1490
1491         /// <summary>
1492         /// Gets or sets the world orientation of the view.<br />
1493         /// </summary>
1494         /// <since_tizen> 3 </since_tizen>
1495         public Rotation WorldOrientation
1496         {
1497             get
1498             {
1499                 Rotation temp = new Rotation();
1500                 var pValue = GetProperty(View.Property.WorldOrientation);
1501                 pValue.Get(temp);
1502                 pValue.Dispose();
1503                 return temp;
1504             }
1505         }
1506
1507         /// <summary>
1508         /// Gets or sets the scale factor applied to the view.<br />
1509         /// </summary>
1510         /// <remarks>
1511         /// <para>
1512         /// Animatable - This property can be animated using <c>Animation</c> class.
1513         /// </para>
1514         /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1515         /// </remarks>
1516         /// <since_tizen> 3 </since_tizen>
1517         public Vector3 Scale
1518         {
1519             get
1520             {
1521                 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1522                 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1523             }
1524             set
1525             {
1526                 SetValue(ScaleProperty, value);
1527                 NotifyPropertyChanged();
1528             }
1529         }
1530
1531         /// <summary>
1532         /// Gets or sets the scale X factor applied to the view.
1533         /// </summary>
1534         /// <remarks>
1535         /// <para>
1536         /// Animatable - This property can be animated using <c>Animation</c> class.
1537         /// </para>
1538         /// </remarks>
1539         /// <since_tizen> 3 </since_tizen>
1540         public float ScaleX
1541         {
1542             get
1543             {
1544                 return (float)GetValue(ScaleXProperty);
1545             }
1546             set
1547             {
1548                 SetValue(ScaleXProperty, value);
1549                 NotifyPropertyChanged();
1550             }
1551         }
1552
1553         /// <summary>
1554         /// Gets or sets the scale Y factor applied to the view.
1555         /// </summary>
1556         /// <remarks>
1557         /// <para>
1558         /// Animatable - This property can be animated using <c>Animation</c> class.
1559         /// </para>
1560         /// </remarks>
1561         /// <since_tizen> 3 </since_tizen>
1562         public float ScaleY
1563         {
1564             get
1565             {
1566                 return (float)GetValue(ScaleYProperty);
1567             }
1568             set
1569             {
1570                 SetValue(ScaleYProperty, value);
1571                 NotifyPropertyChanged();
1572             }
1573         }
1574
1575         /// <summary>
1576         /// Gets or sets the scale Z factor applied to the view.
1577         /// </summary>
1578         /// <remarks>
1579         /// <para>
1580         /// Animatable - This property can be animated using <c>Animation</c> class.
1581         /// </para>
1582         /// </remarks>
1583         /// <since_tizen> 3 </since_tizen>
1584         public float ScaleZ
1585         {
1586             get
1587             {
1588                 return (float)GetValue(ScaleZProperty);
1589             }
1590             set
1591             {
1592                 SetValue(ScaleZProperty, value);
1593                 NotifyPropertyChanged();
1594             }
1595         }
1596
1597         /// <summary>
1598         /// Gets the world scale of the view.
1599         /// </summary>
1600         /// <since_tizen> 3 </since_tizen>
1601         public Vector3 WorldScale
1602         {
1603             get
1604             {
1605                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1606                 var pValue = GetProperty(View.Property.WorldScale);
1607                 pValue.Get(temp);
1608                 pValue.Dispose();
1609                 return temp;
1610             }
1611         }
1612
1613         /// <summary>
1614         /// Retrieves the visibility flag of the view.
1615         /// </summary>
1616         /// <remarks>
1617         /// <para>
1618         /// If the view is not visible, then the view and its children will not be rendered.
1619         /// 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.
1620         /// </para>
1621         /// <para>
1622         /// Animatable - This property can be animated using <c>Animation</c> class.
1623         /// </para>
1624         /// </remarks>
1625         /// <since_tizen> 3 </since_tizen>
1626         public bool Visibility
1627         {
1628             get
1629             {
1630                 bool temp = false;
1631                 var pValue = GetProperty(View.Property.VISIBLE);
1632                 pValue.Get(out temp);
1633                 pValue.Dispose();
1634                 return temp;
1635             }
1636         }
1637
1638         /// <summary>
1639         /// Gets the view's world color.
1640         /// </summary>
1641         /// <since_tizen> 3 </since_tizen>
1642         public Vector4 WorldColor
1643         {
1644             get
1645             {
1646                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1647                 var pValue = GetProperty(View.Property.WorldColor);
1648                 pValue.Get(temp);
1649                 pValue.Dispose();
1650                 return temp;
1651             }
1652         }
1653
1654         /// <summary>
1655         /// Gets or sets the view's name.
1656         /// </summary>
1657         /// <since_tizen> 3 </since_tizen>
1658         public string Name
1659         {
1660             get
1661             {
1662                 return (string)GetValue(NameProperty);
1663             }
1664             set
1665             {
1666                 SetValue(NameProperty, value);
1667                 NotifyPropertyChanged();
1668             }
1669         }
1670
1671         /// <summary>
1672         /// Get the number of children held by the view.
1673         /// </summary>
1674         /// <since_tizen> 3 </since_tizen>
1675         public new uint ChildCount
1676         {
1677             get
1678             {
1679                 return Convert.ToUInt32(Children.Count);
1680             }
1681         }
1682
1683         /// <summary>
1684         /// Gets the view's ID.
1685         /// Read-only
1686         /// </summary>
1687         /// <since_tizen> 3 </since_tizen>
1688         public uint ID
1689         {
1690             get
1691             {
1692                 return GetId();
1693             }
1694         }
1695
1696         /// <summary>
1697         /// Gets or sets the status of whether the view should emit touch or hover signals.
1698         /// </summary>
1699         /// <since_tizen> 3 </since_tizen>
1700         public bool Sensitive
1701         {
1702             get
1703             {
1704                 return (bool)GetValue(SensitiveProperty);
1705             }
1706             set
1707             {
1708                 SetValue(SensitiveProperty, value);
1709                 NotifyPropertyChanged();
1710             }
1711         }
1712
1713         /// <summary>
1714         /// 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.
1715         /// </summary>
1716         /// <since_tizen> 3 </since_tizen>
1717         public bool LeaveRequired
1718         {
1719             get
1720             {
1721                 return (bool)GetValue(LeaveRequiredProperty);
1722             }
1723             set
1724             {
1725                 SetValue(LeaveRequiredProperty, value);
1726                 NotifyPropertyChanged();
1727             }
1728         }
1729
1730         /// <summary>
1731         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1732         /// </summary>
1733         /// <since_tizen> 3 </since_tizen>
1734         public bool InheritOrientation
1735         {
1736             get
1737             {
1738                 return (bool)GetValue(InheritOrientationProperty);
1739             }
1740             set
1741             {
1742                 SetValue(InheritOrientationProperty, value);
1743                 NotifyPropertyChanged();
1744             }
1745         }
1746
1747         /// <summary>
1748         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1749         /// </summary>
1750         /// <since_tizen> 3 </since_tizen>
1751         public bool InheritScale
1752         {
1753             get
1754             {
1755                 return (bool)GetValue(InheritScaleProperty);
1756             }
1757             set
1758             {
1759                 SetValue(InheritScaleProperty, value);
1760                 NotifyPropertyChanged();
1761             }
1762         }
1763
1764         /// <summary>
1765         /// Gets or sets the status of how the view and its children should be drawn.<br />
1766         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1767         /// 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 />
1768         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1769         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1770         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1771         /// </summary>
1772         /// <since_tizen> 3 </since_tizen>
1773         public DrawModeType DrawMode
1774         {
1775             get
1776             {
1777                 return (DrawModeType)GetValue(DrawModeProperty);
1778             }
1779             set
1780             {
1781                 SetValue(DrawModeProperty, value);
1782                 NotifyPropertyChanged();
1783             }
1784         }
1785
1786         /// <summary>
1787         /// Gets or sets the relative to parent size factor of the view.<br />
1788         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1789         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1790         /// </summary>
1791         /// <remarks>
1792         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1793         /// </remarks>
1794         /// <since_tizen> 3 </since_tizen>
1795         public Vector3 SizeModeFactor
1796         {
1797             get
1798             {
1799                 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1800                 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1801             }
1802             set
1803             {
1804                 SetValue(SizeModeFactorProperty, value);
1805                 NotifyPropertyChanged();
1806             }
1807         }
1808
1809         /// <summary>
1810         /// Gets or sets the width resize policy to be used.
1811         /// </summary>
1812         /// <since_tizen> 3 </since_tizen>
1813         public ResizePolicyType WidthResizePolicy
1814         {
1815             get
1816             {
1817                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1818             }
1819             set
1820             {
1821                 SetValue(WidthResizePolicyProperty, value);
1822                 NotifyPropertyChanged();
1823             }
1824         }
1825
1826         /// <summary>
1827         /// Gets or sets the height resize policy to be used.
1828         /// </summary>
1829         /// <since_tizen> 3 </since_tizen>
1830         public ResizePolicyType HeightResizePolicy
1831         {
1832             get
1833             {
1834                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1835             }
1836             set
1837             {
1838                 SetValue(HeightResizePolicyProperty, value);
1839                 NotifyPropertyChanged();
1840             }
1841         }
1842
1843         /// <summary>
1844         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1845         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1846         /// </summary>
1847         /// <since_tizen> 3 </since_tizen>
1848         public SizeScalePolicyType SizeScalePolicy
1849         {
1850             get
1851             {
1852                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1853             }
1854             set
1855             {
1856                 SetValue(SizeScalePolicyProperty, value);
1857                 NotifyPropertyChanged();
1858             }
1859         }
1860
1861         /// <summary>
1862         ///  Gets or sets the status of whether the width size is dependent on the height size.
1863         /// </summary>
1864         /// <since_tizen> 3 </since_tizen>
1865         public bool WidthForHeight
1866         {
1867             get
1868             {
1869                 return (bool)GetValue(WidthForHeightProperty);
1870             }
1871             set
1872             {
1873                 SetValue(WidthForHeightProperty, value);
1874                 NotifyPropertyChanged();
1875             }
1876         }
1877
1878         /// <summary>
1879         /// Gets or sets the status of whether the height size is dependent on the width size.
1880         /// </summary>
1881         /// <since_tizen> 3 </since_tizen>
1882         public bool HeightForWidth
1883         {
1884             get
1885             {
1886                 return (bool)GetValue(HeightForWidthProperty);
1887             }
1888             set
1889             {
1890                 SetValue(HeightForWidthProperty, value);
1891                 NotifyPropertyChanged();
1892             }
1893         }
1894
1895         /// <summary>
1896         /// Gets or sets the padding for use in layout.
1897         /// </summary>
1898         /// <remarks>
1899         /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1900         /// </remarks>
1901         /// <since_tizen> 5 </since_tizen>
1902         public Extents Padding
1903         {
1904             get
1905             {
1906                 // If View has a Layout then padding in stored in the base Layout class
1907                 if (Layout != null)
1908                 {
1909                     return Layout.Padding;
1910                 }
1911                 else
1912                 {
1913                     Extents temp = (Extents)GetValue(PaddingProperty);
1914                     return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1915                 }
1916                 // Two return points to prevent creating a zeroed Extent native object before assignment
1917             }
1918             set
1919             {
1920                 Extents padding = value;
1921                 if (Layout != null)
1922                 {
1923                     // Layout set so store Padding in LayoutItem instead of in View.
1924                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
1925                     // the position and sizes measure in the Layouting.
1926                     Layout.Padding = value;
1927                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1928                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
1929                     if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
1930                     {
1931                         padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
1932                     }
1933                 }
1934
1935                 SetValue(PaddingProperty, padding);
1936                 NotifyPropertyChanged();
1937             }
1938         }
1939
1940         /// <summary>
1941         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1942         /// </summary>
1943         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
1944         /// <remarks>
1945         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1946         /// </remarks>
1947         /// <since_tizen> 3 </since_tizen>
1948         public Size2D MinimumSize
1949         {
1950             get
1951             {
1952                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1953                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1954             }
1955             set
1956             {
1957                 if (value == null)
1958                 {
1959                     throw new ArgumentNullException(nameof(value));
1960                 }
1961                 if (layout != null)
1962                 {
1963                     // Note: it only works if minimum size is >= than natural size.
1964                     // To force the size it should be done through the width&height spec or Size2D.
1965                     layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1966                     layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1967                     layout.RequestLayout();
1968                 }
1969                 SetValue(MinimumSizeProperty, value);
1970                 NotifyPropertyChanged();
1971             }
1972         }
1973
1974         /// <summary>
1975         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1976         /// </summary>
1977         /// <remarks>
1978         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1979         /// </remarks>
1980         /// <since_tizen> 3 </since_tizen>
1981         public Size2D MaximumSize
1982         {
1983             get
1984             {
1985                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1986                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1987             }
1988             set
1989             {
1990                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1991                 // MATCH_PARENT spec + parent container size can be used to limit
1992                 if (layout != null)
1993                 {
1994                     layout.RequestLayout();
1995                 }
1996                 SetValue(MaximumSizeProperty, value);
1997                 NotifyPropertyChanged();
1998             }
1999         }
2000
2001         /// <summary>
2002         /// Gets or sets whether a child view inherits it's parent's position.<br />
2003         /// Default is to inherit.<br />
2004         /// 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 />
2005         /// </summary>
2006         /// <since_tizen> 3 </since_tizen>
2007         public bool InheritPosition
2008         {
2009             get
2010             {
2011                 return (bool)GetValue(InheritPositionProperty);
2012             }
2013             set
2014             {
2015                 SetValue(InheritPositionProperty, value);
2016                 NotifyPropertyChanged();
2017             }
2018         }
2019
2020         /// <summary>
2021         /// Gets or sets the clipping behavior (mode) of it's children.
2022         /// </summary>
2023         /// <since_tizen> 3 </since_tizen>
2024         public ClippingModeType ClippingMode
2025         {
2026             get
2027             {
2028                 return (ClippingModeType)GetValue(ClippingModeProperty);
2029             }
2030             set
2031             {
2032                 SetValue(ClippingModeProperty, value);
2033                 NotifyPropertyChanged();
2034             }
2035         }
2036
2037         /// <summary>
2038         /// Gets the number of renderers held by the view.
2039         /// </summary>
2040         /// <since_tizen> 3 </since_tizen>
2041         public uint RendererCount
2042         {
2043             get
2044             {
2045                 return GetRendererCount();
2046             }
2047         }
2048
2049         /// <summary>
2050         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
2051         /// </summary>
2052         /// <remarks>
2053         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2054         /// </remarks>
2055         /// <since_tizen> 3 </since_tizen>
2056         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
2057             "Like: " +
2058             "View view = new View(); " +
2059             "view.PivotPoint = PivotPoint.Center; " +
2060             "view.PositionUsesPivotPoint = true;")]
2061         [EditorBrowsable(EditorBrowsableState.Never)]
2062         public Position AnchorPoint
2063         {
2064             get
2065             {
2066                 Position temp = new Position(0.0f, 0.0f, 0.0f);
2067                 var pValue = GetProperty(View.Property.AnchorPoint);
2068                 pValue.Get(temp);
2069                 pValue.Dispose();
2070                 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2071                 temp.Dispose();
2072                 return ret;
2073             }
2074             set
2075             {
2076                 var temp = new Tizen.NUI.PropertyValue(value);
2077                 SetProperty(View.Property.AnchorPoint, temp);
2078                 temp.Dispose();
2079                 NotifyPropertyChanged();
2080             }
2081         }
2082
2083         /// <summary>
2084         /// Sets the size of a view for the width, the height and the depth.<br />
2085         /// Geometry can be scaled to fit within this area.<br />
2086         /// This does not interfere with the view's scale factor.<br />
2087         /// The views default depth is the minimum of width and height.<br />
2088         /// </summary>
2089         /// <remarks>
2090         /// <para>
2091         /// Animatable - This property can be animated using <c>Animation</c> class.
2092         /// </para>
2093         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
2094         /// </remarks>
2095         /// <since_tizen> 5 </since_tizen>
2096         public Size Size
2097         {
2098             get
2099             {
2100                 Size tmp = (Size)GetValue(SizeProperty);
2101                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
2102             }
2103             set
2104             {
2105                 SetValue(SizeProperty, value);
2106                 NotifyPropertyChanged();
2107             }
2108         }
2109
2110         /// <summary>
2111         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
2112         /// </summary>
2113         /// <since_tizen> 3 </since_tizen>
2114         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
2115             "Like: " +
2116             "Container parent =  view.GetParent(); " +
2117             "View view = parent as View;")]
2118         [EditorBrowsable(EditorBrowsableState.Never)]
2119         public new View Parent
2120         {
2121             get
2122             {
2123                 View ret;
2124                 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2125                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2126                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2127
2128                 if (basehandle is Layer layer)
2129                 {
2130                     ret = new View(Layer.getCPtr(layer).Handle, false);
2131                     NUILog.Error("This Parent property is deprecated, should do not be used");
2132                 }
2133                 else
2134                 {
2135                     ret = basehandle as View;
2136                 }
2137
2138                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2139                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2140
2141                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2142                 return ret;
2143             }
2144         }
2145
2146         /// <summary>
2147         /// Gets/Sets whether inherit parent's the layout Direction.
2148         /// </summary>
2149         /// <since_tizen> 4 </since_tizen>
2150         public bool InheritLayoutDirection
2151         {
2152             get
2153             {
2154                 return (bool)GetValue(InheritLayoutDirectionProperty);
2155             }
2156             set
2157             {
2158                 SetValue(InheritLayoutDirectionProperty, value);
2159                 NotifyPropertyChanged();
2160             }
2161         }
2162
2163         /// <summary>
2164         /// Gets/Sets the layout Direction.
2165         /// </summary>
2166         /// <since_tizen> 4 </since_tizen>
2167         public ViewLayoutDirectionType LayoutDirection
2168         {
2169             get
2170             {
2171                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2172             }
2173             set
2174             {
2175                 SetValue(LayoutDirectionProperty, value);
2176                 NotifyPropertyChanged();
2177                 layout?.RequestLayout();
2178             }
2179         }
2180
2181         /// <summary>
2182         /// Gets or sets the Margin for use in layout.
2183         /// </summary>
2184         /// <remarks>
2185         /// Margin property is supported by Layout algorithms and containers.
2186         /// Please Set Layout if you want to use Margin property.
2187         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
2188         /// </remarks>
2189         /// <since_tizen> 4 </since_tizen>
2190         public Extents Margin
2191         {
2192             get
2193             {
2194                 // If View has a Layout then margin is stored in Layout.
2195                 if (Layout != null)
2196                 {
2197                     return Layout.Margin;
2198                 }
2199                 else
2200                 {
2201                     // If Layout not set then return margin stored in View.
2202                     Extents temp = (Extents)GetValue(MarginProperty);
2203                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2204                 }
2205                 // Two return points to prevent creating a zeroed Extent native object before assignment
2206             }
2207             set
2208             {
2209                 if (Layout != null)
2210                 {
2211                     // Layout set so store Margin in LayoutItem instead of View.
2212                     // If View stores the Margin too then the Legacy Size Negotiation will
2213                     // overwrite the position and size values measured in the Layouting.
2214                     Layout.Margin = value;
2215                     SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2216                     layout?.RequestLayout();
2217                 }
2218                 else
2219                 {
2220                     SetValue(MarginProperty, value);
2221                 }
2222                 NotifyPropertyChanged();
2223                 layout?.RequestLayout();
2224             }
2225         }
2226
2227         ///<summary>
2228         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2229         ///</summary>
2230         /// <example>
2231         /// <code>
2232         /// // matchParentView matches its size to its parent size.
2233         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2234         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2235         ///
2236         /// // wrapContentView wraps its children with their desired size.
2237         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2238         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2239         ///
2240         /// // exactSizeView shows itself with an exact size.
2241         /// exactSizeView.WidthSpecification = 100;
2242         /// exactSizeView.HeightSpecification = 100;
2243         /// </code>
2244         /// </example>
2245         /// <since_tizen> 6 </since_tizen>
2246         public int WidthSpecification
2247         {
2248             get
2249             {
2250                 return widthPolicy;
2251             }
2252             set
2253             {
2254                 if (value == widthPolicy)
2255                     return;
2256
2257                 widthPolicy = value;
2258                 if (widthPolicy >= 0)
2259                 {
2260                     if (heightPolicy >= 0) // Policy an exact value
2261                     {
2262                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2263                         Size2D = new Size2D(widthPolicy, heightPolicy);
2264                     }
2265                 }
2266                 layout?.RequestLayout();
2267             }
2268         }
2269
2270         ///<summary>
2271         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2272         ///</summary>
2273         /// <example>
2274         /// <code>
2275         /// // matchParentView matches its size to its parent size.
2276         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2277         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2278         ///
2279         /// // wrapContentView wraps its children with their desired size.
2280         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2281         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2282         ///
2283         /// // exactSizeView shows itself with an exact size.
2284         /// exactSizeView.WidthSpecification = 100;
2285         /// exactSizeView.HeightSpecification = 100;
2286         /// </code>
2287         /// </example>
2288         /// <since_tizen> 6 </since_tizen>
2289         public int HeightSpecification
2290         {
2291             get
2292             {
2293                 return heightPolicy;
2294             }
2295             set
2296             {
2297                 if (value == heightPolicy)
2298                     return;
2299
2300                 heightPolicy = value;
2301                 if (heightPolicy >= 0)
2302                 {
2303                     if (widthPolicy >= 0) // Policy an exact value
2304                     {
2305                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2306                         Size2D = new Size2D(widthPolicy, heightPolicy);
2307                     }
2308                 }
2309                 layout?.RequestLayout();
2310             }
2311         }
2312
2313         ///<summary>
2314         /// Gets the List of transitions for this View.
2315         ///</summary>
2316         /// <since_tizen> 6 </since_tizen>
2317         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2318         {
2319             get
2320             {
2321                 if (layoutTransitions == null)
2322                 {
2323                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2324                 }
2325                 return layoutTransitions;
2326             }
2327         }
2328
2329         ///<summary>
2330         /// Sets a layout transitions for this View.
2331         ///</summary>
2332         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2333         /// <remarks>
2334         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2335         /// </remarks>
2336         /// <since_tizen> 6 </since_tizen>
2337         public LayoutTransition LayoutTransition
2338         {
2339             get
2340             {
2341                 return layoutTransition;
2342             }
2343             set
2344             {
2345                 if (value == null)
2346                 {
2347                     throw new global::System.ArgumentNullException(nameof(value));
2348                 }
2349                 if (layoutTransitions == null)
2350                 {
2351                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2352                 }
2353
2354                 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2355
2356                 AttachTransitionsToChildren(value);
2357
2358                 layoutTransition = value;
2359             }
2360         }
2361
2362         /// <summary>
2363         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2364         /// </summary>
2365         /// <remarks>
2366         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2367         /// </remarks>
2368         /// <since_tizen> 4 </since_tizen>
2369         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2370         [EditorBrowsable(EditorBrowsableState.Never)]
2371         public Extents PaddingEX
2372         {
2373             get
2374             {
2375                 Extents temp = new Extents(0, 0, 0, 0);
2376                 var pValue = GetProperty(View.Property.PADDING);
2377                 pValue.Get(temp);
2378                 pValue.Dispose();
2379                 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2380                 temp.Dispose();
2381                 return ret;
2382             }
2383             set
2384             {
2385                 var temp = new Tizen.NUI.PropertyValue(value);
2386                 SetProperty(View.Property.PADDING, temp);
2387                 temp.Dispose();
2388                 NotifyPropertyChanged();
2389                 layout?.RequestLayout();
2390             }
2391         }
2392
2393         /// <summary>
2394         /// The Color of View. This is an RGBA value.
2395         /// </summary>
2396         /// <remarks>
2397         /// <para>
2398         /// Animatable - This property can be animated using <c>Animation</c> class.
2399         /// </para>
2400         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2401         /// </remarks>
2402         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2403         [EditorBrowsable(EditorBrowsableState.Never)]
2404         public Color Color
2405         {
2406             get
2407             {
2408                 Color temp = (Color)GetValue(ColorProperty);
2409                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2410             }
2411             set
2412             {
2413                 SetValue(ColorProperty, value);
2414                 NotifyPropertyChanged();
2415             }
2416         }
2417
2418         /// <summary>
2419         /// Set the layout on this View. Replaces any existing Layout.
2420         /// </summary>
2421         /// <remarks>
2422         /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2423         /// </remarks>
2424         /// <since_tizen> 6 </since_tizen>
2425         public LayoutItem Layout
2426         {
2427             get
2428             {
2429                 return layout;
2430             }
2431             set
2432             {
2433                 // Do nothing if layout provided is already set on this View.
2434                 if (value == layout)
2435                 {
2436                     return;
2437                 }
2438
2439                 LayoutingDisabled = false;
2440                 layoutSet = true;
2441
2442                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2443                 // First check if the layout to be set already has a owner.
2444                 if (value?.Owner != null)
2445                 {
2446                     // Previous owner of the layout gets a default layout as a replacement.
2447                     value.Owner.Layout = new AbsoluteLayout();
2448
2449                     // Copy Margin and Padding to replacement LayoutGroup.
2450                     if (value.Owner.Layout != null)
2451                     {
2452                         value.Owner.Layout.Margin = value.Margin;
2453                         value.Owner.Layout.Padding = value.Padding;
2454                     }
2455                 }
2456
2457                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2458                 // View if no replacement. Previously margin and padding values would have been moved from
2459                 // the View to the layout.
2460                 if (layout != null) // Existing layout
2461                 {
2462                     if (value != null)
2463                     {
2464                         // Existing layout being replaced so copy over margin and padding values.
2465                         value.Margin = layout.Margin;
2466                         value.Padding = layout.Padding;
2467                     }
2468                     else
2469                     {
2470                         // Layout not being replaced so restore margin and padding to View.
2471                         SetValue(MarginProperty, layout.Margin);
2472                         SetValue(PaddingProperty, layout.Padding);
2473                         NotifyPropertyChanged();
2474                     }
2475                 }
2476                 else
2477                 {
2478                     // First Layout to be added to the View hence copy
2479
2480                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2481                     if (value != null)
2482                     {
2483                         Extents margin = Margin;
2484                         Extents padding = Padding;
2485                         if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2486                         {
2487                             // If View already has a margin set then store it in Layout instead.
2488                             value.Margin = margin;
2489                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2490                             NotifyPropertyChanged();
2491                         }
2492
2493                         if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2494                         {
2495                             // If View already has a padding set then store it in Layout instead.
2496                             value.Padding = padding;
2497
2498                             // If Layout is a LayoutItem then it could be a View that handles it's own padding.
2499                             // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
2500                             if (typeof(LayoutGroup).IsAssignableFrom(value.GetType()))
2501                             {
2502                                 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2503                                 NotifyPropertyChanged();
2504                             }
2505                         }
2506                     }
2507                 }
2508
2509                 // Remove existing layout from it's parent layout group.
2510                 layout?.Unparent();
2511
2512                 value.SetPositionByLayout = !excludeLayouting;
2513
2514                 // Set layout to this view
2515                 SetLayout(value);
2516             }
2517         }
2518
2519         /// <summary>
2520         /// The weight of the View, used to share available space in a layout with siblings.
2521         /// </summary>
2522         /// <since_tizen> 6 </since_tizen>
2523         public float Weight
2524         {
2525             get
2526             {
2527                 return weight;
2528             }
2529             set
2530             {
2531                 weight = value;
2532                 layout?.RequestLayout();
2533             }
2534         }
2535
2536         /// <summary>
2537         ///  Whether to load the BackgroundImage synchronously.
2538         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2539         ///  Note: For Normal Quad images only.
2540         /// </summary>
2541         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2542         [EditorBrowsable(EditorBrowsableState.Never)]
2543         public bool BackgroundImageSynchronosLoading
2544         {
2545             get
2546             {
2547                 return backgroundImageSynchronosLoading;
2548             }
2549             set
2550             {
2551                 backgroundImageSynchronosLoading = value;
2552
2553                 string bgUrl = null;
2554                 var pValue = Background.Find(ImageVisualProperty.URL);
2555                 pValue?.Get(out bgUrl);
2556                 pValue?.Dispose();
2557
2558                 if (!string.IsNullOrEmpty(bgUrl))
2559                 {
2560                     PropertyMap bgMap = this.Background;
2561                     var temp = new PropertyValue(backgroundImageSynchronosLoading);
2562                     bgMap.Add("synchronousLoading", temp);
2563                     temp.Dispose();
2564                     Background = bgMap;
2565                 }
2566             }
2567         }
2568
2569         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2570         [EditorBrowsable(EditorBrowsableState.Never)]
2571         public Vector2 UpdateSizeHint
2572         {
2573             get
2574             {
2575                 return (Vector2)GetValue(UpdateSizeHintProperty);
2576             }
2577             set
2578             {
2579                 SetValue(UpdateSizeHintProperty, value);
2580                 NotifyPropertyChanged();
2581             }
2582         }
2583
2584         /// <summary>
2585         /// Enable/Disable ControlState propagation for children.
2586         /// It is false by default.
2587         /// If the View needs to share ControlState with descendants, please set it true.
2588         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2589         /// </summary>
2590         [EditorBrowsable(EditorBrowsableState.Never)]
2591         public bool EnableControlStatePropagation
2592         {
2593             get => controlStatePropagation;
2594             set
2595             {
2596                 controlStatePropagation = value;
2597
2598                 foreach (View child in Children)
2599                 {
2600                     child.EnableControlStatePropagation = value;
2601                 }
2602             }
2603         }
2604
2605         /// <summary>
2606         /// By default, it is false in View, true in Control.
2607         /// Note that if the value is true, the View will be a touch receptor.
2608         /// </summary>
2609         [EditorBrowsable(EditorBrowsableState.Never)]
2610         public bool EnableControlState
2611         {
2612             get
2613             {
2614                 return (bool)GetValue(EnableControlStateProperty);
2615             }
2616             set
2617             {
2618                 SetValue(EnableControlStateProperty, value);
2619             }
2620         }
2621
2622         /// <summary>
2623         /// Whether the actor grab all touches even if touch leaves its boundary.
2624         /// </summary>
2625         /// <returns>true, if it grab all touch after start</returns>
2626         [EditorBrowsable(EditorBrowsableState.Never)]
2627         public bool GrabTouchAfterLeave
2628         {
2629             get
2630             {
2631                 bool temp = false;
2632                 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
2633                 pValue.Get(out temp);
2634                 pValue.Dispose();
2635                 return temp;
2636             }
2637             set
2638             {
2639                 var temp = new Tizen.NUI.PropertyValue(value);
2640                 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
2641                 temp.Dispose();
2642                 NotifyPropertyChanged();
2643             }
2644         }
2645
2646         /// <summary>
2647         /// Determines which blend equation will be used to render renderers of this actor.
2648         /// </summary>
2649         /// <returns>blend equation enum currently assigned</returns>
2650         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
2651         [EditorBrowsable(EditorBrowsableState.Never)]
2652         public BlendEquationType BlendEquation
2653         {
2654             get
2655             {
2656                 int temp = 0;
2657                 var pValue = GetProperty(View.Property.BlendEquation);
2658                 pValue.Get(out temp);
2659                 pValue.Dispose();
2660                 return (BlendEquationType)temp;
2661             }
2662             set
2663             {
2664                 var temp = new Tizen.NUI.PropertyValue((int)value);
2665                 SetProperty(View.Property.BlendEquation, temp);
2666                 temp.Dispose();
2667                 NotifyPropertyChanged();
2668             }
2669         }
2670
2671         /// <summary>
2672         /// If the value is true, the View will change its style as the theme changes.
2673         /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
2674         /// </summary>
2675         /// <since_tizen> 9 </since_tizen>
2676         public bool ThemeChangeSensitive
2677         {
2678             get => (bool)GetValue(ThemeChangeSensitiveProperty);
2679             set => SetValue(ThemeChangeSensitiveProperty, value);
2680         }
2681
2682         /// <summary>
2683         /// Create Style, it is abstract function and must be override.
2684         /// </summary>
2685         [EditorBrowsable(EditorBrowsableState.Never)]
2686         protected virtual ViewStyle CreateViewStyle()
2687         {
2688             return new ViewStyle();
2689         }
2690
2691         /// <summary>
2692         /// Called after the View's ControlStates changed.
2693         /// </summary>
2694         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2695         [EditorBrowsable(EditorBrowsableState.Never)]
2696         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2697         {
2698         }
2699
2700         /// <summary>
2701         /// </summary>
2702         [EditorBrowsable(EditorBrowsableState.Never)]
2703         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
2704         {
2705             UpdateStyle();
2706         }
2707
2708         /// <summary>
2709         /// Apply style instance to the view.
2710         /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
2711         /// </summary>
2712         /// <since_tizen> 9 </since_tizen>
2713         public virtual void ApplyStyle(ViewStyle viewStyle)
2714         {
2715             if (viewStyle == null || this.viewStyle == viewStyle) return;
2716
2717             this.viewStyle = viewStyle;
2718
2719             if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
2720             {
2721                 // Nothing to apply
2722                 return;
2723             }
2724
2725             BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
2726
2727             if (bindablePropertyOfView == null)
2728             {
2729                 return;
2730             }
2731
2732             var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
2733             viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
2734
2735             foreach (var sourceProperty in dirtyStyleProperties)
2736             {
2737                 var sourceValue = viewStyle.GetValue(sourceProperty);
2738
2739                 if (sourceValue == null)
2740                 {
2741                     continue;
2742                 }
2743
2744                 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
2745
2746                 if (destinationProperty != null)
2747                 {
2748                     SetValue(destinationProperty, sourceValue);
2749                 }
2750             }
2751         }
2752
2753         /// <summary>
2754         /// Get whether the View is culled or not.
2755         /// True means that the View is out of the view frustum.
2756         /// </summary>
2757         /// <remarks>
2758         /// Hidden-API (Inhouse-API).
2759         /// </remarks>
2760         [EditorBrowsable(EditorBrowsableState.Never)]
2761         public bool Culled
2762         {
2763             get
2764             {
2765                 bool temp = false;
2766                 var pValue = GetProperty(View.Property.Culled);
2767                 pValue.Get(out temp);
2768                 pValue.Dispose();
2769                 return temp;
2770             }
2771         }
2772
2773         /// <summary>
2774         /// Set or Get TransitionOptions for the page transition.
2775         /// This property is used to define how this view will be transitioned during Page switching.
2776         /// </summary>
2777         /// <since_tizen> 9 </since_tizen>
2778         public TransitionOptions TransitionOptions
2779         {
2780             set
2781             {
2782                 transitionOptions = value;
2783             }
2784             get
2785             {
2786                 return transitionOptions;
2787             }
2788         }
2789     }
2790 }