Add SetParent interface (#992)
authorWonsik Jung <sidein@samsung.com>
Thu, 29 Aug 2019 02:09:31 +0000 (11:09 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 29 Aug 2019 02:09:31 +0000 (11:09 +0900)
Add SetParent, GetParent and Unparent interface.
It is to support transient_for function.

src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/public/Window.cs

index 1d2ec2b..0495689 100755 (executable)
@@ -191,6 +191,18 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetNativeWindowHandler")]
             public static extern System.IntPtr GetNativeWindowHandler(System.IntPtr Window);
+
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetParent")]
+            public static extern void SetParent(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Unparent")]
+            public static extern void Unparent(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetParent")]
+            public static extern global::System.IntPtr GetParent(global::System.Runtime.InteropServices.HandleRef jarg1);
         }
     }
 }
\ No newline at end of file
index 20d3a57..7da98b0 100755 (executable)
@@ -1459,6 +1459,46 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Sets parent window of the window.
+        /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
+        /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
+        /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
+        /// </summary>
+        /// <param name="parent">The parent window.</param>
+        /// <since_tizen> 6 </since_tizen>
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetParent(Window parent) {
+            Interop.Window.SetParent(swigCPtr, Window.getCPtr(parent));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Unsets parent window of the window.
+        /// After unsetting, the window is disconnected his parent window.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Unparent() {
+            Interop.Window.Unparent(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Gets parent window of the window.
+        /// </summary>
+        /// <returns>The parent window of the window.</returns>
+        /// <since_tizen> 6 </since_tizen>
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Window GetParent() {
+            Window ret = new Window(Interop.Window.GetParent(swigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Dispose for Window
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]