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