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