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