[NUI] Split NUI Interop class (#804)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Layouting / LayoutGroupWrapper.cs
index cf4cef1..a17f88d 100755 (executable)
  *
  */
 
+using System;
 using System.ComponentModel;
 using Tizen.NUI.BaseComponents;
 
 namespace Tizen.NUI
 {
-    /// 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 class LayoutGroupWrapper : LayoutItem//LayoutItemWrapper
+    internal class LayoutGroupWrapper : LayoutItem
     {
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
         internal LayoutGroupWrapperImpl layoutGroupWrapperImpl;
 
-        internal LayoutGroupWrapper(global::System.IntPtr cPtr, bool cMemoryOwn) : base(LayoutPINVOKE.LayoutGroupWrapper_SWIGUpcast(cPtr), cMemoryOwn)
+        internal LayoutGroupWrapper(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.LayoutGroupWrapper.LayoutGroupWrapper_SWIGUpcast(cPtr), cMemoryOwn)
         {
             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
         }
@@ -37,8 +36,6 @@ namespace Tizen.NUI
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
         }
 
-        /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
             if (disposed)
@@ -63,7 +60,7 @@ namespace Tizen.NUI
                 if (swigCMemOwn)
                 {
                     swigCMemOwn = false;
-                    LayoutPINVOKE.delete_LayoutGroupWrapper(swigCPtr);
+                    Interop.LayoutGroupWrapper.delete_LayoutGroupWrapper(swigCPtr);
                 }
                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
             }
@@ -71,78 +68,57 @@ namespace Tizen.NUI
             base.Dispose(type);
         }
 
-        /// 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 class ChildProperty
+        public new class ChildProperty
         {
-            public static readonly int MARGIN_SPECIFICATION = LayoutPINVOKE.LayoutGroupWrapper_ChildProperty_MARGIN_SPECIFICATION_get();
+            public static readonly int MARGIN_SPECIFICATION = Interop.LayoutGroupWrapper.LayoutGroupWrapper_ChildProperty_MARGIN_SPECIFICATION_get();
         }
 
-        /// 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 LayoutGroupWrapper() : this(LayoutPINVOKE.new_LayoutGroupWrapper__SWIG_0(), true)
+        public LayoutGroupWrapper() : this(Interop.LayoutGroupWrapper.new_LayoutGroupWrapper__SWIG_0(), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /// 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 LayoutGroupWrapper(LayoutGroupWrapper copy) : this(LayoutPINVOKE.new_LayoutGroupWrapper__SWIG_1(LayoutGroupWrapper.getCPtr(copy)), true)
+        public LayoutGroupWrapper(LayoutGroupWrapper copy) : this(Interop.LayoutGroupWrapper.new_LayoutGroupWrapper__SWIG_1(LayoutGroupWrapper.getCPtr(copy)), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /// 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 uint Add(LayoutItemWrapper childLayout)
         {
-            uint ret = LayoutPINVOKE.LayoutGroupWrapper_Add(swigCPtr, LayoutItemWrapper.getCPtr(childLayout));
+            uint ret = Interop.LayoutGroupWrapper.LayoutGroupWrapper_Add(swigCPtr, LayoutItemWrapper.getCPtr(childLayout));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            LayoutChildren.Add(childLayout);
             return ret;
         }
 
-        /// 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 void Remove(uint childId)
         {
-            LayoutPINVOKE.LayoutGroupWrapper_Remove__SWIG_0(swigCPtr, childId);
+            Interop.LayoutGroupWrapper.LayoutGroupWrapper_Remove__SWIG_0(swigCPtr, childId);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /// 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 void Remove(LayoutItemWrapper childLayout)
         {
-            LayoutPINVOKE.LayoutGroupWrapper_Remove__SWIG_1(swigCPtr, LayoutItemWrapper.getCPtr(childLayout));
+            Interop.LayoutGroupWrapper.LayoutGroupWrapper_Remove__SWIG_1(swigCPtr, LayoutItemWrapper.getCPtr(childLayout));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            LayoutChildren.Remove(childLayout);
         }
 
-        /// 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 LayoutItem GetChildAt(uint index)
         {
-            global::System.IntPtr cPtr = LayoutPINVOKE.LayoutGroupWrapper_GetChildAt(swigCPtr, index);
-
-
-            global::System.Runtime.InteropServices.HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
-            BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
-            NDalicPINVOKE.delete_BaseHandle(CPtr);
-            CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-            return basehandle as LayoutItem;
+            if(index >= 0 && index < LayoutChildren.Count)
+            {
+                LayoutItem layoutItem = LayoutChildren[Convert.ToInt32(index)] as LayoutItem;
+                return layoutItem;
+            }
+            return null;
         }
 
         private uint GetChildCount()
         {
-            uint ret = LayoutPINVOKE.LayoutGroupWrapper_GetChildCount(swigCPtr);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            return Convert.ToUInt32(LayoutChildren.Count);
         }
 
-        /// 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 uint ChildCount
         {
             get
@@ -151,23 +127,19 @@ namespace Tizen.NUI
             }
         }
 
-        /// 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 LayoutItemWrapper GetChild(uint childId)
         {
-            LayoutItemWrapper ret = new LayoutItemWrapper(LayoutPINVOKE.LayoutGroupWrapper_GetChild(swigCPtr, childId), true);
+            LayoutItemWrapper ret = new LayoutItemWrapper(Interop.LayoutGroupWrapper.LayoutGroupWrapper_GetChild(swigCPtr, childId), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        internal LayoutGroupWrapper(LayoutGroupWrapperImpl implementation) : this(LayoutPINVOKE.new_LayoutGroupWrapper__SWIG_2(LayoutGroupWrapperImpl.getCPtr(implementation)), true)
+        internal LayoutGroupWrapper(LayoutGroupWrapperImpl implementation) : this(Interop.LayoutGroupWrapper.new_LayoutGroupWrapper__SWIG_2(LayoutGroupWrapperImpl.getCPtr(implementation)), true)
         {
             layoutGroupWrapperImpl = implementation;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /// 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 static readonly uint UNKNOWN_ID = LayoutPINVOKE.LayoutGroupWrapper_UNKNOWN_ID_get();
+        public static readonly uint UNKNOWN_ID = Interop.LayoutGroupWrapper.LayoutGroupWrapper_UNKNOWN_ID_get();
     }
-}
\ No newline at end of file
+}