Merge "Fix Left/Right/Up/DownFocusableView bug =>If app set the Left/Right/Up/DownFoc...
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
index cd80218..f312226 100755 (executable)
@@ -91,7 +91,7 @@ namespace Tizen.NUI.BaseComponents
         /// Retrieves the number of children held by the view.
         /// </summary>
         /// <seealso cref="Container.GetChildCount" />
-        protected override uint GetChildCount()
+        public override uint GetChildCount()
         {
             return Convert.ToUInt32(Children.Count);
         }
@@ -100,7 +100,7 @@ namespace Tizen.NUI.BaseComponents
         /// Gets the views parent.
         /// </summary>
         /// <seealso cref="Container.GetParent()" />
-        protected override Container GetParent()
+        public override Container GetParent()
         {
             IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
 
@@ -112,19 +112,9 @@ namespace Tizen.NUI.BaseComponents
             return basehandle as Container;
         }
 
-        /// <summary>
-        /// This is temporal API. Currently Parent returns View but Container class has been introduced so 'View Parent' will be changed 'Container Parent' later soon, then this will be removed
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
-        public Container GetContainerParent()
-        {
-            return this.GetParent();
-        }
-
         internal bool IsTopLevelView()
         {
-            if(GetContainerParent() is Layer)
+            if(GetParent() is Layer)
             {
                 return true;
             }
@@ -1107,6 +1097,8 @@ namespace Tizen.NUI.BaseComponents
             internal static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get();
             internal static readonly int INHERIT_LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_INHERIT_LAYOUT_DIRECTION_get();
             internal static readonly int LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_LAYOUT_DIRECTION_get();
+            internal static readonly int MARGIN = NDalicPINVOKE.View_Property_MARGIN_get();
+            internal static readonly int PADDINGEX = NDalicPINVOKE.View_Property_PADDING_get();
         }
 
         /// <summary>
@@ -1922,7 +1914,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                LeftFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    LeftFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    LeftFocusableViewId = -1;
+                }
             }
         }
 
@@ -1945,7 +1944,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                RightFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    RightFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    RightFocusableViewId = -1;
+                }
             }
         }
 
@@ -1968,7 +1974,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                UpFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    UpFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    UpFocusableViewId = -1;
+                }
             }
         }
 
@@ -1991,7 +2004,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                DownFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    DownFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    DownFocusableViewId = -1;
+                }
             }
         }
 
@@ -4434,6 +4454,40 @@ namespace Tizen.NUI.BaseComponents
                 SetProperty(View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)value));
             }
         }
+
+        /// <summary>
+        /// Gets or sets the Margin for use in layout.
+        /// </summary>
+        public Extents Margin
+        {
+            get
+            {
+                Extents temp = new Extents(0, 0, 0, 0);
+                GetProperty(View.Property.MARGIN).Get(temp);
+                return temp;
+            }
+            set
+            {
+                SetProperty(View.Property.MARGIN, new Tizen.NUI.PropertyValue(value));
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the Padding for use in layout.
+        /// </summary>
+        public Extents PaddingEX
+        {
+            get
+            {
+                Extents temp = new Extents(0, 0, 0, 0);
+                GetProperty(View.Property.PADDINGEX).Get(temp);
+                return temp;
+            }
+            set
+            {
+                SetProperty(View.Property.PADDINGEX, new Tizen.NUI.PropertyValue(value));
+            }
+        }
     }
 
     /// <summary>
@@ -4451,4 +4505,4 @@ namespace Tizen.NUI.BaseComponents
         /// </summary>
         RTL
     }
-}
\ No newline at end of file
+}