[Tizen] Remove Visible propert in View.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
index 6ae6886..acb9cd9 100755 (executable)
@@ -376,15 +376,23 @@ namespace Tizen.NUI.BaseComponents
         {
             KeyEventArgs e = new KeyEventArgs();
 
+            bool result = false;
+
             e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
 
             if (_keyEventHandler != null)
             {
-                return _keyEventHandler(this, e);
+                Delegate[] delegateList = _keyEventHandler.GetInvocationList();
+
+                // Oring the result of each callback.
+                foreach ( EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList )
+                {
+                    result |= del( this, e );
+                }
             }
-            return false;
-        }
 
+            return result;
+        }
 
         private EventHandler _onRelayoutEventHandler;
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
@@ -980,7 +988,7 @@ namespace Tizen.NUI.BaseComponents
         /// </summary>
         /// <param name="handle">Handle to an object</param>
         /// <returns>A handle to a View or an uninitialized handle</returns>
-        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
+        [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
         public new static View DownCast(BaseHandle handle)
         {
             View ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as View;
@@ -988,7 +996,7 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
-        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
+        [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
         public static T DownCast<T>(View view) where T : View
         {
             T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T;
@@ -1853,7 +1861,19 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        public bool Visibility
+        /// <summary>
+        /// Retrieves the view's parent.<br>
+        /// </summary>
+        public View Parent
+        {
+            get
+            {
+                return GetParent();
+            }
+        }
+
+        [Obsolete("Please do not use! this will be deprecated. Please use Visibility instead.")]
+        public bool Visible
         {
             get
             {
@@ -2003,7 +2023,13 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        [Obsolete("Please do not use! this will be internal property")]
+        /// <summary>
+        /// Returns the natural size of the view.
+        /// </summary>
+        /// <remarks>
+        /// Deriving classes stipulate the natural size and by default a view has a ZERO natural size.
+        /// </remarks>
+        [Obsolete("Please do not use! this will be deprecated, please use NaturalSize2D instead")]
         public Vector3 NaturalSize
         {
             get
@@ -2016,6 +2042,24 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// Returns the natural size (Size2D) of the view.
+        /// </summary>
+        /// <remarks>
+        /// Deriving classes stipulate the natural size and by default a view has a ZERO natural size.
+        /// </remarks>
+        public Size2D NaturalSize2D
+        {
+            get
+            {
+                Vector3 temp = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true);
+                if (NDalicPINVOKE.SWIGPendingException.Pending)
+                    throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+                return new Size2D((int)temp.Width, (int)temp.Height);
+            }
+        }
+
+        /// <summary>
         /// Shows the View.
         /// </summary>
         /// <remarks>
@@ -2212,6 +2256,47 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
+        /*internal View GetParent()
+        {
+            View ret;
+            IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+
+            BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+            if(basehandle is Layer)
+            {
+                ret = new View(cPtr,false);
+            }
+            else
+            {
+                ret = basehandle as View;
+            }
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }*/
+
+        internal View GetParent()
+        {
+            View ret;
+            IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+
+            BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+            if(basehandle is Layer)
+            {
+                View ret2 = new View(cPtr,false);
+                return ret2;
+            }
+
+            ret = basehandle as View;
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         internal void SetParentOrigin(Vector3 origin)
         {
             NDalicPINVOKE.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin));
@@ -3254,18 +3339,14 @@ namespace Tizen.NUI.BaseComponents
         /// If an view is not visible, then the view and its children will not be rendered.
         /// This is regardless of the individual visibility values of the children i.e.an view will only be rendered if all of its parents have visibility set to true.
         /// </remarks>
-        public bool Visible
+        public bool Visibility
         {
             get
             {
                 bool temp = false;
                 GetProperty(View.Property.VISIBLE).Get(out temp);
                 return temp;
-            }/* only get is required : removed
-            set
-            {
-                SetProperty(View.Property.VISIBLE, new Tizen.NUI.PropertyValue(value));
-            }*/
+            }
         }
 
         /// <summary>
@@ -3816,7 +3897,7 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        [Obsolete("Please do not use! this will be deprecated")]
+        [Obsolete("Please do not use! this will be deprecated, please use Size2D instead")]
         public Size Size
         {
             get