[NUI] Add AliveCount property to get currently alived View number
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
index d62c459..947edad 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,6 +31,8 @@ namespace Tizen.NUI.BaseComponents
         private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
         private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
         private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
+        private static bool defaultGrabTouchAfterLeave = false;
+        private static bool defaultAllowOnlyOwnTouch = false;
 
         internal BackgroundExtraData backgroundExtraData;
 
@@ -47,6 +49,7 @@ namespace Tizen.NUI.BaseComponents
         private LayoutTransition layoutTransition;
         private TransitionOptions transitionOptions = null;
         private ThemeData themeData;
+        private bool isThemeChanged = false;
 
         // List of constraints
         private Constraint widthConstraint = null;
@@ -66,6 +69,23 @@ namespace Tizen.NUI.BaseComponents
         private Vector3 internalScale = null;
         private Size internalSize = null;
         private Size2D internalSize2D = null;
+        private int layoutCount = 0;
+        private ControlState propagatableControlStates = ControlState.All;
+
+        private string internalName = string.Empty;
+        private Position internalCurrentParentOrigin = null;
+        private Position internalCurrentAnchorPoint = null;
+        private Vector3 internalTargetSize = null;
+        private Size2D internalCurrentSize = null;
+        private Position internalCurrentPosition = null;
+        private Vector3 internalCurrentWorldPosition = null;
+        private Vector3 internalCurrentScale = null;
+        private Vector3 internalCurrentWorldScale = null;
+        private Vector4 internalCurrentColor = null;
+        private Vector4 internalCurrentWorldColor = null;
+        private Vector2 internalCurrentScreenPosition = null;
+
+        private static int aliveCount = 0;
 
         static View()
         {
@@ -83,13 +103,69 @@ namespace Tizen.NUI.BaseComponents
             RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
             RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
             RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
+
+            RegisterAccessibilityDelegate();
+        }
+
+        static internal new void Preload()
+        {
+            Container.Preload();
+
+            // Do nothing. Just call for load static values.
+            var temporalPositionPropertyGroup = positionPropertyGroup;
+            var temporalSizePropertyGroup = sizePropertyGroup;
+            var temporalScalePropertyGroup = scalePropertyGroup;
+        }
+
+        /// <summary>
+        /// Accessibility mode for controlling View's Accessible implementation.
+        /// It is only relevant when deriving custom controls from View directly,
+        /// as classes derived from CustomView (or any of its subclasses) get the
+        /// Custom mode by default.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum ViewAccessibilityMode
+        {
+            /// <summary>
+            /// Default accessibility implementation. Overriding View.Accessibility...()
+            /// virtual methods will have no effect.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Default,
+            /// <summary>
+            /// Custom accessibility implementation. Overriding View.Accessibility...()
+            /// will be necessary to provide accessibility support for the View.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Custom,
+        }
+
+        private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
+        {
+            switch (accessibilityMode)
+            {
+                case ViewAccessibilityMode.Custom:
+                {
+                    return Interop.View.NewCustom();
+                }
+                case ViewAccessibilityMode.Default:
+                default:
+                {
+                    return Interop.View.New();
+                }
+            }
         }
 
         /// <summary>
         /// Creates a new instance of a view.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        public View() : this(Interop.View.New(), true)
+        public View() : this(ViewAccessibilityMode.Default)
+        {
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
@@ -112,37 +188,30 @@ namespace Tizen.NUI.BaseComponents
             SetVisible(shown);
         }
 
-        internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
+        internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
         {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            if (!shown)
-            {
-                SetVisible(false);
-            }
-
-            backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
+            InitializeStyle(viewStyle);
         }
 
-        internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
+        internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : this(cPtr, cMemoryOwn, shown, cMemoryOwn)
         {
-            InitializeStyle(viewStyle);
         }
 
-        internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
+        internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
         {
             if (HasBody())
             {
                 PositionUsesPivotPoint = false;
+                GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
+                AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
             }
 
-            onWindowSendEventCallback = SendViewAddedEventToWindow;
-            using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
-            signal?.Connect(onWindowSendEventCallback);
-
             if (!shown)
             {
                 SetVisible(false);
             }
+
+            aliveCount++;
         }
 
         internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
@@ -187,9 +256,29 @@ namespace Tizen.NUI.BaseComponents
         public static bool LayoutingDisabled { get; set; } = true;
 
         /// <summary>
-        /// Deprecate. Please do not use this.
+        /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
+        /// </summary>
+        /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void SetDefaultGrabTouchAfterLeave(bool enable)
+        {
+            defaultGrabTouchAfterLeave = enable;
+        }
+
+        /// <summary>
+        /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
+        /// </summary>
+        /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void SetDefaultAllowOnlyOwnTouch(bool enable)
+        {
+            defaultAllowOnlyOwnTouch = enable;
+        }
+
+        /// <summary>
+        /// Deprecate. Do not use this.
         /// The style instance applied to this view.
-        /// Note that please do not modify the ViewStyle.
+        /// Note that do not modify the ViewStyle.
         /// Modifying ViewStyle will affect other views with same ViewStyle.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -241,7 +330,90 @@ namespace Tizen.NUI.BaseComponents
                 {
                     foreach (View child in Children)
                     {
-                        child.ControlState = value;
+                        ControlState allowed = child.PropagatableControlStates;
+                        if (allowed.Contains(ControlState.All))
+                        {
+                            child.ControlState = value;
+                        }
+                        else
+                        {
+                            ControlState newControlState = child.ControlState;
+
+                            if (allowed.Contains(ControlState.Normal))
+                            {
+                                if (value.Contains(ControlState.Normal))
+                                {
+                                    newControlState += ControlState.Normal;
+                                }
+                                else
+                                {
+                                    newControlState -= ControlState.Normal;
+                                }
+                            }
+
+                            if (allowed.Contains(ControlState.Disabled))
+                            {
+                                if (value.Contains(ControlState.Disabled))
+                                {
+                                    newControlState += ControlState.Disabled;
+                                }
+                                else
+                                {
+                                    newControlState -= ControlState.Disabled;
+                                }
+                            }
+
+                            if (allowed.Contains(ControlState.Selected))
+                            {
+                                if (value.Contains(ControlState.Selected))
+                                {
+                                    newControlState += ControlState.Selected;
+                                }
+                                else
+                                {
+                                    newControlState -= ControlState.Selected;
+                                }
+                            }
+
+                            if (allowed.Contains(ControlState.Pressed))
+                            {
+                                if (value.Contains(ControlState.Pressed))
+                                {
+                                    newControlState += ControlState.Pressed;
+                                }
+                                else
+                                {
+                                    newControlState -= ControlState.Pressed;
+                                }
+                            }
+
+                            if (allowed.Contains(ControlState.Focused))
+                            {
+                                if (value.Contains(ControlState.Focused))
+                                {
+                                    newControlState += ControlState.Focused;
+                                }
+                                else
+                                {
+                                    newControlState -= ControlState.Focused;
+                                }
+                            }
+
+                            if (allowed.Contains(ControlState.Other))
+                            {
+                                if (value.Contains(ControlState.Other))
+                                {
+                                    newControlState += ControlState.Other;
+                                }
+                                else
+                                {
+                                    newControlState -= ControlState.Other;
+                                }
+                            }
+
+                            if (child.ControlState != newControlState)
+                            child.ControlState = newControlState;
+                        }
                     }
                 }
 
@@ -286,30 +458,6 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public bool IsResourcesCreated
-        {
-            get
-            {
-                return Application.Current.IsResourcesCreated;
-            }
-        }
-
-        /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public ResourceDictionary XamlResources
-        {
-            get
-            {
-                return Application.Current.XamlResources;
-            }
-            set
-            {
-                Application.Current.XamlResources = value;
-            }
-        }
-
         /// <summary>
         /// The StyleName, type string.
         /// The value indicates DALi style name defined in json theme file.
@@ -595,6 +743,24 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// The color selector for the borderline of the View.
+        /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
+        /// So this API is internally used only.
+        /// </summary>
+        internal Selector<Color> BorderlineColorSelector
+        {
+            get
+            {
+                return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
+            }
+            set
+            {
+                SetValue(BorderlineColorSelectorProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
         /// The Relative offset for the borderline of the View.
         /// Recommended range : [-1.0f to 1.0f].
         /// If -1.0f, draw borderline inside of the View.
@@ -697,12 +863,24 @@ namespace Tizen.NUI.BaseComponents
             {
                 using (var propertyValue = GetProperty(Property.TOOLTIP))
                 {
-                    if (propertyValue != null && propertyValue.Get(out string retrivedValue))
+                    using var propertyMap = new PropertyMap();
+                    if (propertyValue != null && propertyValue.Get(propertyMap))
                     {
-                        return retrivedValue;
+                        using var retrivedContentValue = propertyMap?.Find(NDalic.TooltipContent);
+                        if (retrivedContentValue != null)
+                        {
+                            using var contextPropertyMap = new PropertyMap();
+                            if (retrivedContentValue.Get(contextPropertyMap))
+                            {
+                                using var retrivedTextValue = contextPropertyMap?.Find(NDalic.TextVisualText);
+                                if (retrivedTextValue != null && retrivedTextValue.Get(out string retrivedValue))
+                                {
+                                    return retrivedValue;
+                                }
+                            }
+                        }
                     }
-                    NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
-                    return "error to get TooltipText";
+                    return "";
                 }
             }
             set
@@ -812,7 +990,7 @@ namespace Tizen.NUI.BaseComponents
         /// The number of rows this child occupies, if not set, the default value is 1.
         /// </summary>
         /// <remarks>
-        /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
+        /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public float RowSpan
@@ -832,7 +1010,7 @@ namespace Tizen.NUI.BaseComponents
         /// The number of columns this child occupies, if not set, the default value is 1.
         /// </summary>
         /// <remarks>
-        /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
+        /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public float ColumnSpan
@@ -852,7 +1030,7 @@ namespace Tizen.NUI.BaseComponents
         /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
         /// </summary>
         /// <remarks>
-        /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
+        /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
@@ -872,7 +1050,7 @@ namespace Tizen.NUI.BaseComponents
         /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
         /// </summary>
         /// <remarks>
-        /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
+        /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
@@ -969,6 +1147,46 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// The clockwise focusable view by rotary wheel.<br />
+        /// This will return null if not set.<br />
+        /// This will also return null if the specified clockwise focusable view is not on a window.<br />
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public View ClockwiseFocusableView
+        {
+            // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+            get
+            {
+                return (View)GetValue(ClockwiseFocusableViewProperty);
+            }
+            set
+            {
+                SetValue(ClockwiseFocusableViewProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// The counter clockwise focusable view by rotary wheel.<br />
+        /// This will return null if not set.<br />
+        /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public View CounterClockwiseFocusableView
+        {
+            // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+            get
+            {
+                return (View)GetValue(CounterClockwiseFocusableViewProperty);
+            }
+            set
+            {
+                SetValue(CounterClockwiseFocusableViewProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
         /// Whether the view should be focusable by keyboard navigation.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
@@ -1023,9 +1241,15 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        ///  Retrieves the position of the view.<br />
-        ///  The coordinates are relative to the view's parent.<br />
+        /// Retrieves the position of the view.
+        /// The coordinates are relative to the view's parent.
         /// </summary>
+        /// <remarks>
+        /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+        /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+        /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+        /// and users can get the current actual values through them.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Position CurrentPosition
         {
@@ -1079,9 +1303,15 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        ///  Retrieves the size of the view.<br />
-        ///  The coordinates are relative to the view's parent.<br />
+        /// Retrieves the size of the view.
+        /// The coordinates are relative to the view's parent.
         /// </summary>
+        /// <remarks>
+        /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+        /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+        /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+        /// and users can get the current actual values through them.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Size2D CurrentSize
         {
@@ -1157,11 +1387,24 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                Vector2 temp = new Vector2(0.0f, 0.0f);
-                var pValue = GetProperty(View.Property.ScreenPosition);
-                pValue.Get(temp);
-                pValue.Dispose();
-                return temp;
+                return GetCurrentScreenPosition();
+            }
+        }
+
+        /// <summary>
+        /// Retrieves the screen position and size of the view.<br />
+        /// </summary>
+        /// <remarks>
+        /// The float type Rectangle class is not ready yet.
+        /// Therefore, it transmits data in Vector4 class.
+        /// This type should later be changed to the appropriate data type.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Vector4 ScreenPositionSize
+        {
+            get
+            {
+                return GetCurrentScreenPositionSize();
             }
         }
 
@@ -1187,15 +1430,15 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
+        /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
+        [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
             "Like: " +
             "View view = new View(); " +
             "view.PivotPoint = PivotPoint.Center; " +
             "view.PositionUsesPivotPoint = true;" +
-            " Deprecated in API5: Will be removed in API8")]
+            " This has been deprecated in API5 and will be removed in API8")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool PositionUsesAnchorPoint
         {
@@ -1213,17 +1456,11 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                bool temp = false;
-                var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
-                pValue.Get(out temp);
-                pValue.Dispose();
-                return temp;
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
             }
             set
             {
-                var temp = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.PositionUsesAnchorPoint, temp);
-                temp.Dispose();
+                Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
                 NotifyPropertyChanged();
             }
         }
@@ -1289,7 +1526,7 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
+                Vector3 ret = GetNaturalSize();
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
                 return ret;
             }
@@ -1306,11 +1543,14 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
+                Vector3 temp = GetNaturalSize();
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
-
-                Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
-                temp.Dispose();
+                Size2D sz = null;
+                if (temp != null)
+                {
+                    sz = new Size2D((int)temp.Width, (int)temp.Height);
+                    temp.Dispose();
+                }
                 return sz;
             }
         }
@@ -1545,11 +1785,7 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
-                var pValue = GetProperty(View.Property.WorldPosition);
-                pValue.Get(temp);
-                pValue.Dispose();
-                return temp;
+                return GetCurrentWorldPosition();
             }
         }
 
@@ -1718,11 +1954,7 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
-                var pValue = GetProperty(View.Property.WorldScale);
-                pValue.Get(temp);
-                pValue.Dispose();
-                return temp;
+                return GetCurrentWorldScale();
             }
         }
 
@@ -1746,11 +1978,7 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                bool temp = false;
-                var pValue = GetProperty(View.Property.VISIBLE);
-                pValue.Get(out temp);
-                pValue.Dispose();
-                return temp;
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
             }
         }
 
@@ -1762,11 +1990,7 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
-                var pValue = GetProperty(View.Property.WorldColor);
-                pValue.Get(temp);
-                pValue.Dispose();
-                return temp;
+                return GetCurrentWorldColor();
             }
         }
 
@@ -1831,6 +2055,25 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// Gets or sets the status of whether the view should be enabled user interactions.
+        /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
+        /// </summary>
+        /// <since_tizen> tizen_next </since_tizen>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsEnabled
+        {
+            get
+            {
+                return (bool)GetValue(IsEnabledProperty);
+            }
+            set
+            {
+                SetValue(IsEnabledProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
         /// 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.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
@@ -2044,35 +2287,11 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                // If View has a Layout then padding in stored in the base Layout class
-                if (Layout != null)
-                {
-                    return Layout.Padding;
-                }
-                else
-                {
-                    return (Extents)GetValue(PaddingProperty);
-                }
-                // Two return points to prevent creating a zeroed Extent native object before assignment
+                return (Extents)GetValue(PaddingProperty);
             }
             set
             {
-                Extents padding = value;
-                if (Layout != null)
-                {
-                    // Layout set so store Padding in LayoutItem instead of in View.
-                    // If View stores the Padding value then Legacy Size Negotiation will overwrite
-                    // the position and sizes measure in the Layouting.
-                    Layout.Padding = value;
-                    // If Layout is a LayoutItem then it could be a View that handles it's own padding.
-                    // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
-                    if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
-                    {
-                        padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
-                    }
-                }
-
-                SetValue(PaddingProperty, padding);
+                SetValue(PaddingProperty, value);
                 NotifyPropertyChanged();
             }
         }
@@ -2204,13 +2423,13 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
+        /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
         /// </summary>
         /// <remarks>
         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
-        [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
+        [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
             "Like: " +
             "View view = new View(); " +
             "view.PivotPoint = PivotPoint.Center; " +
@@ -2232,19 +2451,11 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                Position temp = new Position(0.0f, 0.0f, 0.0f);
-                var pValue = GetProperty(View.Property.AnchorPoint);
-                pValue.Get(temp);
-                pValue.Dispose();
-                Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
-                temp.Dispose();
-                return ret;
+                return GetCurrentAnchorPoint();
             }
             set
             {
-                var temp = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.AnchorPoint, temp);
-                temp.Dispose();
+                SetAnchorPoint(value);
                 NotifyPropertyChanged();
             }
         }
@@ -2290,10 +2501,10 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
+        /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
+        [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
             "Like: " +
             "Container parent =  view.GetParent(); " +
             "View view = parent as View;")]
@@ -2384,35 +2595,12 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                // If View has a Layout then margin is stored in Layout.
-                if (Layout != null)
-                {
-                    return Layout.Margin;
-                }
-                else
-                {
-                    // If Layout not set then return margin stored in View.
-                    return (Extents)GetValue(MarginProperty);
-                }
-                // Two return points to prevent creating a zeroed Extent native object before assignment
+                return (Extents)GetValue(MarginProperty);
             }
             set
             {
-                if (Layout != null)
-                {
-                    // Layout set so store Margin in LayoutItem instead of View.
-                    // If View stores the Margin too then the Legacy Size Negotiation will
-                    // overwrite the position and size values measured in the Layouting.
-                    Layout.Margin = value;
-                    SetValue(MarginProperty, new Extents(0, 0, 0, 0));
-                    layout?.RequestLayout();
-                }
-                else
-                {
-                    SetValue(MarginProperty, value);
-                }
+                SetValue(MarginProperty, value);
                 NotifyPropertyChanged();
-                layout?.RequestLayout();
             }
         }
 
@@ -2435,7 +2623,7 @@ namespace Tizen.NUI.BaseComponents
         /// </code>
         /// </example>
         /// <since_tizen> 6 </since_tizen>
-        [Binding.TypeConverter(typeof(IntDpTypeConverter))]
+        [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
         public int WidthSpecification
         {
             get
@@ -2463,11 +2651,7 @@ namespace Tizen.NUI.BaseComponents
                 widthPolicy = value;
                 if (widthPolicy >= 0)
                 {
-                    if (heightPolicy >= 0) // Policy an exact value
-                    {
-                        // Create Size2D only both _widthPolicy and _heightPolicy are set.
-                        Size2D = new Size2D(widthPolicy, heightPolicy);
-                    }
+                    SizeWidth = widthPolicy;
                 }
                 layout?.RequestLayout();
             }
@@ -2492,7 +2676,7 @@ namespace Tizen.NUI.BaseComponents
         /// </code>
         /// </example>
         /// <since_tizen> 6 </since_tizen>
-        [Binding.TypeConverter(typeof(IntDpTypeConverter))]
+        [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
         public int HeightSpecification
         {
             get
@@ -2520,11 +2704,7 @@ namespace Tizen.NUI.BaseComponents
                 heightPolicy = value;
                 if (heightPolicy >= 0)
                 {
-                    if (widthPolicy >= 0) // Policy an exact value
-                    {
-                        // Create Size2D only both _widthPolicy and _heightPolicy are set.
-                        Size2D = new Size2D(widthPolicy, heightPolicy);
-                    }
+                    SizeHeight = heightPolicy;
                 }
                 layout?.RequestLayout();
             }
@@ -2593,13 +2773,13 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
+        /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
         /// </summary>
         /// <remarks>
         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
         /// </remarks>
         /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
+        [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Extents PaddingEX
         {
@@ -2635,21 +2815,12 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public XamlStyle XamlStyle
-        {
-            get
-            {
-                return (XamlStyle)GetValue(XamlStyleProperty);
-            }
-            set
-            {
-                SetValue(XamlStyleProperty, value);
-            }
-        }
-
         /// <summary>
         /// The Color of View. This is an RGBA value.
+        /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
+        /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
+        /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
+        /// Inherient of color value depend on <see cref="ColorMode"/>.
         /// </summary>
         /// <remarks>
         /// <para>
@@ -2683,6 +2854,72 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// The Red component of View.Color.
+        /// </summary>
+        /// <remarks>
+        /// <para>
+        /// Animatable - This property can be animated using <c>Animation</c> class.
+        /// </para>
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float ColorRed
+        {
+            get
+            {
+                return (float)GetValue(ColorRedProperty);
+            }
+            set
+            {
+                SetValue(ColorRedProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// The Green component of View.Color.
+        /// </summary>
+        /// <remarks>
+        /// <para>
+        /// Animatable - This property can be animated using <c>Animation</c> class.
+        /// </para>
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float ColorGreen
+        {
+            get
+            {
+                return (float)GetValue(ColorGreenProperty);
+            }
+            set
+            {
+                SetValue(ColorGreenProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// The Blue component of View.Color.
+        /// </summary>
+        /// <remarks>
+        /// <para>
+        /// Animatable - This property can be animated using <c>Animation</c> class.
+        /// </para>
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float ColorBlue
+        {
+            get
+            {
+                return (float)GetValue(ColorBlueProperty);
+            }
+            set
+            {
+                SetValue(ColorBlueProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
         /// Set the layout on this View. Replaces any existing Layout.
         /// </summary>
         /// <remarks>
@@ -2760,26 +2997,28 @@ namespace Tizen.NUI.BaseComponents
                     {
                         Extents margin = Margin;
                         Extents padding = Padding;
+                        bool setMargin = false;
+                        bool setPadding = false;
+
                         if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
                         {
                             // If View already has a margin set then store it in Layout instead.
                             value.Margin = margin;
                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
-                            NotifyPropertyChanged();
+                            setMargin = true;
                         }
 
                         if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
                         {
                             // If View already has a padding set then store it in Layout instead.
                             value.Padding = padding;
+                            SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
+                            setPadding = true;
+                        }
 
-                            // If Layout is a LayoutItem then it could be a View that handles it's own padding.
-                            // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
-                            if (typeof(LayoutGroup).IsAssignableFrom(value.GetType()))
-                            {
-                                SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
-                                NotifyPropertyChanged();
-                            }
+                        if (setMargin || setPadding)
+                        {
+                            NotifyPropertyChanged();
                         }
 
                         value.SetPositionByLayout = !excludeLayouting;
@@ -2873,12 +3112,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 backgroundImageSynchronousLoading = value;
 
-                string bgUrl = null;
-                var pValue = Background.Find(ImageVisualProperty.URL);
-                pValue?.Get(out bgUrl);
-                pValue?.Dispose();
-
-                if (!string.IsNullOrEmpty(bgUrl))
+                if (!string.IsNullOrEmpty(BackgroundImage))
                 {
                     PropertyMap bgMap = this.Background;
                     var temp = new PropertyValue(backgroundImageSynchronousLoading);
@@ -2891,15 +3125,15 @@ namespace Tizen.NUI.BaseComponents
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Vector2 UpdateSizeHint
+        public Vector4 UpdateAreaHint
         {
             get
             {
-                return (Vector2)GetValue(UpdateSizeHintProperty);
+                return (Vector4)GetValue(UpdateAreaHintProperty);
             }
             set
             {
-                SetValue(UpdateSizeHintProperty, value);
+                SetValue(UpdateAreaHintProperty, value);
                 NotifyPropertyChanged();
             }
         }
@@ -2943,6 +3177,33 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// The ControlStates can propagate from the parent.
+        /// Listed ControlStates will be accepted propagation of the parent ControlState changes
+        /// if parent view EnableControlState is true.
+        /// <see cref="EnableControlState"/>.
+        /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ControlState PropagatableControlStates
+        {
+            get
+            {
+                return (ControlState)GetValue(PropagatableControlStatesProperty);
+            }
+            set
+            {
+                SetValue(PropagatableControlStatesProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        private ControlState InternalPropagatableControlStates
+        {
+            get => propagatableControlStates;
+            set => propagatableControlStates = value;
+        }
+
+        /// <summary>
         /// By default, it is false in View, true in Control.
         /// Note that if the value is true, the View will be a touch receptor.
         /// </summary>
@@ -2980,17 +3241,52 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                bool temp = false;
-                var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
-                pValue.Get(out temp);
-                pValue.Dispose();
-                return temp;
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
             }
             set
             {
-                var temp = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
-                temp.Dispose();
+                Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
+
+                // Use custom HitTest callback only if GrabTouchAfterLeave is true.
+                if (value)
+                {
+                    RegisterHitTestCallback();
+                }
+                else
+                {
+                    UnregisterHitTestCallback();
+                }
+
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// Whether the view will only receive own touch.
+        /// </summary>
+        /// <returns>true, if it only receives touches that started from itself.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool AllowOnlyOwnTouch
+        {
+            get
+            {
+                return (bool)GetValue(AllowOnlyOwnTouchProperty);
+            }
+            set
+            {
+                SetValue(AllowOnlyOwnTouchProperty, value);
+            }
+        }
+
+        private bool InternalAllowOnlyOwnTouch
+        {
+            get
+            {
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
+            }
+            set
+            {
+                Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
                 NotifyPropertyChanged();
             }
         }
@@ -3017,17 +3313,11 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                int temp = 0;
-                var pValue = GetProperty(View.Property.BlendEquation);
-                pValue.Get(out temp);
-                pValue.Dispose();
-                return (BlendEquationType)temp;
+                return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
             }
             set
             {
-                var temp = new Tizen.NUI.PropertyValue((int)value);
-                SetProperty(View.Property.BlendEquation, temp);
-                temp.Dispose();
+                Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
                 NotifyPropertyChanged();
             }
         }
@@ -3066,8 +3356,10 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
         {
+            isThemeChanged = true;
             if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
             else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
+            isThemeChanged = false;
         }
 
         /// <summary>
@@ -3110,9 +3402,15 @@ namespace Tizen.NUI.BaseComponents
 
                 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
 
+                // Do not set value again when theme is changed and the value has been set already.
+                if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
+                {
+                    continue;
+                }
+
                 if (destinationProperty != null)
                 {
-                    SetValue(destinationProperty, sourceValue);
+                    InternalSetValue(destinationProperty, sourceValue);
                 }
             }
         }
@@ -3129,11 +3427,7 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                bool temp = false;
-                var pValue = GetProperty(View.Property.Culled);
-                pValue.Get(out temp);
-                pValue.Dispose();
-                return temp;
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
             }
         }
 
@@ -3168,25 +3462,49 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Gets or sets the status of whether the view should emit key event signals.
-        /// If a View's DispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
+        /// Called when the view is hit through TouchEvent or GestureEvent.
+        /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
+        /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
+        /// User can override whether hit or not in HitTest.
+        /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
+        /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
         /// </summary>
+        // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public bool DispatchKeyEvents
+        protected virtual bool HitTest(Touch touch)
         {
-            get
-            {
-                return (bool)GetValue(DispatchKeyEventsProperty);
-            }
-            set
-            {
-                SetValue(DispatchKeyEventsProperty, value);
-                NotifyPropertyChanged();
-            }
+            return true;
         }
 
+        /// <summary>
+        /// Retrieve the View's current Color.
+        /// </summary>
+        /// <remarks>
+        /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+        /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+        /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+        /// and users can get the current actual values through them.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Color CurrentColor => GetCurrentColor();
 
+        /// <summary>
+        /// Retrieve the current scale factor applied to the View.
+        /// </summary>
+        /// <remarks>
+        /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+        /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+        /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+        /// and users can get the current actual values through them.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Vector3 CurrentScale => GetCurrentScale();
 
+        /// <summary>
+        /// Gets the number of currently alived View object.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static int AliveCount => aliveCount;
 
     }
 }