[NUI] Supports key event of repeat and delay of each way.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window / Window.cs
index a1c23f1..2cd8307 100755 (executable)
@@ -36,10 +36,14 @@ namespace Tizen.NUI
     {
         private HandleRef stageCPtr;
         private Layer rootLayer;
+        private Layer overlayLayer;
         private Layer borderLayer;
         private string windowTitle;
         private List<Layer> childLayers = new List<Layer>();
         private LayoutController localController;
+        private Key internalLastKeyEvent;
+        private Touch internalLastTouchEvent;
+        private Timer internalHoverTimer;
 
         static internal bool IsSupportedMultiWindow()
         {
@@ -82,7 +86,7 @@ namespace Tizen.NUI
 
             //to fix memory leak issue, match the handle count with native side.
             Window ret = view.GetInstanceSafely<Window>(Interop.Window.Get(View.getCPtr(view)));
-            if (NDalicPINVOKE.SWIGPendingException.Pending)throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
@@ -212,7 +216,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Enumeration for transition effect's state.
         /// </summary>
-        [Obsolete("Please do not use! This will be removed. Please use Window.EffectState instead!")]
+        [Obsolete("Do not use this, that will be removed. Use Window.EffectState instead.")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         //  This is already deprecated, so suppress warning here.
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names", Justification = "<Pending>")]
@@ -221,19 +225,19 @@ namespace Tizen.NUI
             /// <summary>
             /// None state.
             /// </summary>
-            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.None instead!")]
+            [Obsolete("Do not use this, that will be removed. Use Window.EffectState.None instead.")]
             [EditorBrowsable(EditorBrowsableState.Never)]
             None = 0,
             /// <summary>
             /// Transition effect is started.
             /// </summary>
-            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.Start instead!")]
+            [Obsolete("Do not use this, that will be removed. Use Window.EffectState.Start instead.")]
             [EditorBrowsable(EditorBrowsableState.Never)]
             Start,
             /// <summary>
             /// Transition effect is ended.
             /// </summary>
-            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.End instead!")]
+            [Obsolete("Do not use this, that will be removed. Use Window.EffectState.End instead.")]
             [EditorBrowsable(EditorBrowsableState.Never)]
             End,
         }
@@ -264,7 +268,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Enumeration for transition effect's type.
         /// </summary>
-        [Obsolete("Please do not use! This will be removed. Please use Window.EffectType instead!")]
+        [Obsolete("Do not use this, that will be removed. Use Window.EffectType instead.")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         //  This is already deprecated, so suppress warning here.
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names", Justification = "<Pending>")]
@@ -273,19 +277,19 @@ namespace Tizen.NUI
             /// <summary>
             /// None type.
             /// </summary>
-            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.None instead!")]
+            [Obsolete("Do not use this, that will be removed. Use Window.EffectType.None instead.")]
             [EditorBrowsable(EditorBrowsableState.Never)]
             None = 0,
             /// <summary>
             /// Window show effect.
             /// </summary>
-            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Show instead!")]
+            [Obsolete("Do not use this, that will be removed. Use Window.EffectType.Show instead.")]
             [EditorBrowsable(EditorBrowsableState.Never)]
             Show,
             /// <summary>
             /// Window hide effect.
             /// </summary>
-            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Hide instead!")]
+            [Obsolete("Do not use this, that will be removed. Use Window.EffectType.Hide instead.")]
             [EditorBrowsable(EditorBrowsableState.Never)]
             Hide,
         }
@@ -552,7 +556,7 @@ namespace Tizen.NUI
             {
                 Position2D position = GetPosition();
                 Size2D size = GetSize();
-                Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
+                Rectangle ret = new Rectangle(position?.X ?? 0, position?.Y ?? 0, size?.Width ?? 0, size?.Height ?? 0);
                 position.Dispose();
                 return ret;
             }
@@ -562,6 +566,24 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        /// Gets or sets whether the window will update partial area or full area.
+        /// If this value is true, window will update and render partial area.
+        /// If false, full area updated.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool PartialUpdate
+        {
+            get
+            {
+                return IsPartialUpdate();
+            }
+            set
+            {
+                SetPartialUpdate(value);
+            }
+        }
+
         internal static Vector4 DEFAULT_BACKGROUND_COLOR
         {
             get
@@ -608,7 +630,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <param name="keyEvent">The key event to feed.</param>
         /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
+        [Obsolete("Do not use this, that will be deprecated. Use FeedKey(Key keyEvent) instead.")]
         public static void FeedKeyEvent(Key keyEvent)
         {
             Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
@@ -770,7 +792,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void SetInputRegion(Rectangle inputRegion)
         {
-            Interop.Window.IncludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
+            Interop.Window.SetInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -931,6 +953,25 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Gets the overlay layer.
+        /// </summary>
+        /// <returns>The overlay layer.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Layer GetOverlayLayer()
+        {
+            // Window.IsInstalled() is actually true only when called from event thread and
+            // Core has been initialized, not when Stage is ready.
+            if (overlayLayer == null && Window.IsInstalled())
+            {
+                overlayLayer = new Layer(Interop.Window.GetOverlayLayer(SwigCPtr), true);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                LayersChildren?.Add(overlayLayer);
+                overlayLayer.SetWindow(this);
+            }
+            return overlayLayer;
+        }
+
+        /// <summary>
         /// Add a child view to window.
         /// </summary>
         /// <param name="view">the child should be added to the window.</param>
@@ -985,7 +1026,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void KeepRendering(float durationSeconds)
         {
-            Interop.Stage.KeepRendering(stageCPtr, durationSeconds);
+            Interop.Window.KeepRendering(SwigCPtr, durationSeconds);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -1079,6 +1120,62 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Sets the keyboard repeat information of horizontal way.
+        /// </summary>
+        /// <param name="rate">The key repeat rate value in seconds.</param>
+        /// <param name="delay">The key repeat delay value in seconds.</param>
+        /// <returns>True if setting the keyboard repeat succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool SetKeyboardHorizentalRepeatInfo(float rate, float delay)
+        {
+            bool ret = Interop.Window.SetKeyboardHorizentalRepeatInfo(rate, delay);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Gets the keyboard repeat information of horizontal way.
+        /// </summary>
+        /// <param name="rate">The key repeat rate value in seconds.</param>
+        /// <param name="delay">The key repeat delay value in seconds.</param>
+        /// <returns>True if setting the keyboard repeat succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool GetKeyboardHorizentalRepeatInfo(out float rate, out float delay)
+        {
+            bool ret = Interop.Window.GetKeyboardHorizentalRepeatInfo(out rate, out delay);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Sets the keyboard repeat information of vertical way.
+        /// </summary>
+        /// <param name="rate">The key repeat rate value in seconds.</param>
+        /// <param name="delay">The key repeat delay value in seconds.</param>
+        /// <returns>True if setting the keyboard repeat succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool SetKeyboardVerticalRepeatInfo(float rate, float delay)
+        {
+            bool ret = Interop.Window.SetKeyboardVerticalRepeatInfo(rate, delay);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Gets the keyboard repeat information of vertical way.
+        /// </summary>
+        /// <param name="rate">The key repeat rate value in seconds.</param>
+        /// <param name="delay">The key repeat delay value in seconds.</param>
+        /// <returns>True if setting the keyboard repeat succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool GetKeyboardVerticalRepeatInfo(out float rate, out float delay)
+        {
+            bool ret = Interop.Window.GetKeyboardVerticalRepeatInfo(out rate, out delay);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Adds a layer to the stage.
         /// </summary>
         /// <param name="layer">Layer to add.</param>
@@ -1112,6 +1209,36 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Feeds a hover event into the window. <br />
+        /// This is feed after a default time of 48 ms. You can also set this time.
+        /// </summary>
+        /// <param name="time">The time of how much later it will be feed (default is 48ms)</param>
+        /// <remarks>If you want to do FeedHover after the UI is updated, it is recommended to set the time to at least 16ms. This will be a good time waiting for the UI to update.<br />
+        /// and LazyFeedHover called within the set time are ignored. Only the last request becomes a FeedHover.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void LazyFeedHover(uint time = 48)
+        {
+            if (internalHoverTimer == null)
+            {
+                internalHoverTimer = new Timer(time);
+                internalHoverTimer.Tick += (s, e) =>
+                {
+                    FeedHover();
+                    internalHoverTimer?.Stop();
+                    internalHoverTimer?.Dispose();
+                    internalHoverTimer = null;
+                    return false;
+                };
+                internalHoverTimer.Start();
+            }
+            else
+            {
+                internalHoverTimer.Start();
+            }
+        }
+
+        /// <summary>
         /// Feeds a touch point into the window.
         /// </summary>
         /// <param name="touchPoint">The touch point to feed.</param>
@@ -1133,6 +1260,27 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Feeds a hover event into the window.
+        /// </summary>
+        /// <param name="touchPoint">The touch point to feed hover event. If null is entered, the feed hover event is generated with the last inputed touch point.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        internal void FeedHover(TouchPoint touchPoint = null)
+        {
+            if (touchPoint == null)
+            {
+                using Touch touch = GetLastTouchEvent();
+                if (touch == null || touch.GetPointCount() < 1)
+                {
+                    return;
+                }
+                using Vector2 screenPosition = touch.GetScreenPosition(0);
+                touchPoint = new TouchPoint(touch.GetDeviceId(0), TouchPoint.StateType.Motion, screenPosition.X, screenPosition.Y);
+            }
+            Interop.Window.FeedHoverEvent(SwigCPtr, TouchPoint.getCPtr(touchPoint));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
         /// Allows at least one more render, even when paused.
         /// The window should be shown, not minimised.
         /// </summary>
@@ -1363,7 +1511,7 @@ namespace Tizen.NUI
 
             if (isBorderWindow)
             {
-                Interop.Actor.Add(GetBorderWindowRootLayer().SwigCPtr, layer.SwigCPtr);
+                Interop.Actor.Add(GetRootLayer().SwigCPtr, layer.SwigCPtr);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }
             }
             else
@@ -1427,7 +1575,7 @@ namespace Tizen.NUI
         {
             if (isBorderWindow)
             {
-                if(borderLayer == null)
+                if (borderLayer == null)
                 {
                     borderLayer = GetBorderWindowRootLayer();
                     LayersChildren?.Add(borderLayer);
@@ -1525,8 +1673,8 @@ namespace Tizen.NUI
             {
                 throw new ArgumentNullException(nameof(position));
             }
-            var val = new Uint16Pair((uint)position.X, (uint)position.Y);
-            Interop.Window.SetPosition(SwigCPtr, Uint16Pair.getCPtr(val));
+            var val = new Int32Pair(position.X, position.Y);
+            Interop.Window.SetPosition(SwigCPtr, Int32Pair.getCPtr(val));
             val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             // Setting Position of the window should request a relayout of the tree.
@@ -1534,8 +1682,8 @@ namespace Tizen.NUI
 
         internal Position2D GetPosition()
         {
-            var val = new Uint16Pair(Interop.Window.GetPosition(SwigCPtr), true);
-            Position2D ret = new Position2D(val.GetX(), val.GetY());
+            var val = new Int32Pair(Interop.Window.GetPosition(SwigCPtr), true);
+            Position2D ret = new Position2D((int)val.GetX(), (int)val.GetY());
             val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
@@ -1555,6 +1703,7 @@ namespace Tizen.NUI
             positionSize.Height = val.GetY();
 
             Interop.Window.SetPositionSize(SwigCPtr, Rectangle.getCPtr(positionSize));
+            val.Dispose();
 
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
@@ -1562,6 +1711,27 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Set the window use partial update or not.
+        /// </summary>
+        /// <param name="enabled">If window enable partial update or disable.</param>
+        internal void SetPartialUpdate(bool enabled)
+        {
+            Interop.Window.SetPartialUpdateEnabled(SwigCPtr, enabled);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Returns whether the window is enabled partial update or not.
+        /// </summary>
+        /// <returns>True if the window is enabled partial update, false otherwise.</returns>
+        internal bool IsPartialUpdate()
+        {
+            bool ret = Interop.Window.IsPartialUpdateEnabled(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Enables the floating mode of window.
         /// The floating mode is to support window is moved or resized by display server.
         /// For example, if the video-player window sets the floating mode,
@@ -1578,6 +1748,18 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Returns whether the window is floating mode or not.
+        /// </summary>
+        /// <returns>True if the window is enabled floating mode, false otherwise.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsFloatingModeEnabled()
+        {
+            bool ret = Interop.Window.IsFloatingModeEnabled(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Requests to display server for the window is moved by display server.
         /// It can be work with setting window floating mode.
         /// </summary>
@@ -1635,6 +1817,70 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Sets the pointer constraints lock.
+        /// </summary>
+        /// <returns>True if PointerConstraintsLock succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool PointerConstraintsLock()
+        {
+            bool ret = Interop.Window.PointerConstraintsLock(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Sets the pointer constraints unlock.
+        /// </summary>
+        /// <returns>True if PointerConstraintsUnlock succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool PointerConstraintsUnlock()
+        {
+            bool ret = Interop.Window.PointerConstraintsUnlock(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Sets the locked pointer region.
+        /// </summary>
+        /// <param name="x">The x position.</param>
+        /// <param name="y">The y position.</param>
+        /// <param name="width">The width.</param>
+        /// <param name="height">The height.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void LockedPointerRegionSet(int x, int y, int width, int height)
+        {
+            Interop.Window.LockedPointerRegionSet(SwigCPtr, x, y, width, height);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the locked pointer cursor position hintset
+        /// </summary>
+        /// <param name="x">The x position.</param>
+        /// <param name="y">The y position.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void LockedPointerCursorPositionHintSet(int x, int y)
+        {
+            Interop.Window.LockedPointerCursorPositionHintSet(SwigCPtr, x, y);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the pointer warp. The pointer moves to the set coordinates.
+        /// </summary>
+        /// <param name="x">The x position.</param>
+        /// <param name="y">The y position.</param>
+        /// <returns>True if PointerWarp succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool PointerWarp(int x, int y)
+        {
+            bool ret = Interop.Window.PointerWarp(SwigCPtr, x, y);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Maximizes window's size.
         /// If this function is called with true, window will be resized with screen size.
         /// Otherwise window will be resized with previous size.
@@ -1662,6 +1908,30 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Sets window's maximum size.
+        ///
+        /// It is to set the maximized size when window is maximized or the window's size is increased by RequestResizeToServer().
+        /// Although the size is set by this function, window's size can be increased over the limitation by SetPositionSize() or SetSize().
+        ///
+        /// After setting, if Maximize() is called, window is resized with the setting size and move the center.
+        ///
+        /// </summary>
+        /// <param name="size">the maximum size.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetMaximumSize(Size2D size)
+        {
+            if (null == size)
+            {
+                throw new ArgumentNullException(nameof(size));
+            }
+            var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
+
+            Interop.Window.SetMaximumSize(SwigCPtr, Uint16Pair.getCPtr(val));
+            val.Dispose();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
         /// Minimizes window's size.
         /// If this function is called with true, window will be iconified.
         /// Otherwise window will be activated.
@@ -1689,6 +1959,103 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Sets window's minimum size.
+        /// It is to set the minimum size when window's size is decreased by RequestResizeToServer().
+        /// Although the size is set by this function, window's size can be decreased over the limitation by SetPositionSize() or SetSize().
+        /// </summary>
+        /// <param name="size">the minimum size.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetMimimumSize(Size2D size)
+        {
+            if (null == size)
+            {
+                throw new ArgumentNullException(nameof(size));
+            }
+            var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
+
+            Interop.Window.SetMimimumSize(SwigCPtr, Uint16Pair.getCPtr(val));
+            val.Dispose();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the layout of the window.
+        /// </summary>
+        /// <param name="numCols">The number of columns in the layout.</param>
+        /// <param name="numRows">The number of rows in the layout.</param>
+        /// <param name="column">The column number of the window within the layout.</param>
+        /// <param name="row">The row number of the window within the layout.</param>
+        /// <param name="colSpan">The number of columns the window should span within the layout.</param>
+        /// <param name="rowSpan">The number of rows the window should span within the layout.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetLayout(uint numCols, uint numRows, uint column, uint row, uint colSpan, uint rowSpan)
+        {
+            Interop.Window.SetLayout(SwigCPtr, numCols, numRows, column, row, colSpan, rowSpan);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+        }
+
+        /// <summary>
+        /// Sets the layout of the window.
+        /// </summary>
+        /// <param name="layoutType">The type of layout to set for the window.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetLayout(WindowLayoutType layoutType)
+        {
+            switch (layoutType)
+            {
+                case WindowLayoutType.LeftHalf:
+                    Interop.Window.SetLayout(SwigCPtr, 2, 1, 0, 0, 1, 1);
+                    break;
+                case WindowLayoutType.RightHalf:
+                    Interop.Window.SetLayout(SwigCPtr, 2, 1, 1, 0, 1, 1);
+                    break;
+
+                case WindowLayoutType.TopHalf:
+                    Interop.Window.SetLayout(SwigCPtr, 1, 2, 0, 0, 1, 1);
+                    break;
+                case WindowLayoutType.BottomHalf:
+                    Interop.Window.SetLayout(SwigCPtr, 1, 2, 0, 1, 1, 1);
+                    break;
+
+                case WindowLayoutType.UpperLeftQuarter:
+                    Interop.Window.SetLayout(SwigCPtr, 2, 2, 0, 0, 1, 1);
+                    break;
+                case WindowLayoutType.UpperRightQuarter:
+                    Interop.Window.SetLayout(SwigCPtr, 2, 2, 1, 0, 1, 1);
+                    break;
+                case WindowLayoutType.LowerLeftQuarter:
+                    Interop.Window.SetLayout(SwigCPtr, 2, 2, 0, 1, 1, 1);
+                    break;
+                case WindowLayoutType.LowerRightQuarter:
+                    Interop.Window.SetLayout(SwigCPtr, 2, 2, 1, 1, 1, 1);
+                    break;
+
+                case WindowLayoutType.LeftThird:
+                    Interop.Window.SetLayout(SwigCPtr, 3, 1, 0, 0, 1, 1);
+                    break;
+                case WindowLayoutType.CenterThird:
+                    Interop.Window.SetLayout(SwigCPtr, 3, 1, 1, 0, 1, 1);
+                    break;
+                case WindowLayoutType.RightThird:
+                    Interop.Window.SetLayout(SwigCPtr, 3, 1, 2, 0, 1, 1);
+                    break;
+
+                case WindowLayoutType.TopThird:
+                    Interop.Window.SetLayout(SwigCPtr, 1, 3, 0, 0, 1, 1);
+                    break;
+                case WindowLayoutType.MiddleThird:
+                    Interop.Window.SetLayout(SwigCPtr, 1, 3, 0, 1, 1, 1);
+                    break;
+                case WindowLayoutType.BottomThird:
+                    Interop.Window.SetLayout(SwigCPtr, 1, 3, 0, 2, 1, 1);
+                    break;
+            }
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+        }
+
+        /// <summary>
         /// Query whether window is rotating or not.
         /// </summary>
         /// <returns>True if window is rotating, false otherwise.</returns>
@@ -1707,9 +2074,13 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Key GetLastKeyEvent()
         {
-            Key ret = new Key(Interop.Window.GetLastKeyEvent(SwigCPtr), false);
+            if(internalLastKeyEvent == null)
+            {
+                internalLastKeyEvent = new Key();
+            }
+            Interop.Window.InternalRetrievingLastKeyEvent(SwigCPtr, internalLastKeyEvent.SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            return internalLastKeyEvent;
         }
 
         /// <summary>
@@ -1719,9 +2090,41 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Touch GetLastTouchEvent()
         {
-            Touch ret = new Touch(Interop.Window.GetLastTouchEvent(SwigCPtr), false);
+            if(internalLastTouchEvent == null)
+            {
+                internalLastTouchEvent = new Touch();
+            }
+            Interop.Window.InternalRetrievingLastTouchEvent(SwigCPtr, internalLastTouchEvent.SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return internalLastTouchEvent;
+        }
+
+        /// <summary>
+        /// Sets the necessary for window rotation Acknowledgement.
+        /// After this function called, SendRotationCompletedAcknowledgement() should be called to complete window rotation.
+        ///
+        /// This function is supprot that application has the window rotation acknowledgement's control.
+        /// It means display server waits when application's rotation work is finished.
+        /// It is useful application has the other rendering engine which works asynchronous.
+        /// For instance, GlView.
+        /// </summary>
+        /// <param name="needAcknowledgement">the flag is true if window rotation acknowledge is sent.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement)
+        {
+            Interop.Window.SetNeedsRotationCompletedAcknowledgement(SwigCPtr, needAcknowledgement);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// send the Acknowledgement to complete window rotation.
+        /// For this function, SetNeedsRotationCompletedAcknowledgement should be already called with true.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SendRotationCompletedAcknowledgement()
+        {
+            Interop.Window.SendRotationCompletedAcknowledgement(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
         /// <summary>
@@ -1753,6 +2156,8 @@ namespace Tizen.NUI
                 return;
             }
 
+            this.DisconnectNativeSignals();
+
             if (type == DisposeTypes.Explicit)
             {
                 //Called by User
@@ -1775,9 +2180,17 @@ namespace Tizen.NUI
                 childLayers.Clear();
 
                 localController?.Dispose();
+
+                internalLastKeyEvent?.Dispose();
+                internalLastKeyEvent = null;
+                internalLastTouchEvent?.Dispose();
+                internalLastTouchEvent = null;
+
+                internalHoverTimer?.Stop();
+                internalHoverTimer?.Dispose();
+                internalHoverTimer = null;
             }
 
-            this.DisconnectNativeSignals();
 
             base.Dispose(type);
         }