Revert "[Tizen] Temporary Fix to return the Layer as a View when Parent is a Layer."
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
index dcf69ad..7a610fd 100755 (executable)
 * limitations under the License.
 *
 */
-// This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
-//------------------------------------------------------------------------------
-// <auto-generated />
-//
-// This file was automatically generated by SWIG (http://www.swig.org).
-// Version 3.0.9
-//
-// Do not make changes to this file unless you know what you are doing--modify
-// the SWIG interface file instead.
-//------------------------------------------------------------------------------
 
 namespace Tizen.NUI
 {
@@ -103,18 +93,14 @@ namespace Tizen.NUI
             return ret;
        }
 
-        /*********************************************************************************/\r
-        /*** will be removed/deprecated                                                  ***/\r
-        /*********************************************************************************/\r
+        [Obsolete("Please do not use! this will be internal method")]
         public void SetAcceptFocus(bool accept)
         {
             NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /*********************************************************************************/\r
-        /*** will be removed/deprecated                                                  ***/\r
-        /*********************************************************************************/\r
+        [Obsolete("Please do not use! this will be internal method")]
         public bool IsFocusAcceptable()
         {
             return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
@@ -519,21 +505,13 @@ namespace Tizen.NUI
             return this.GetRootLayer();
         }
 
-        /// <summary>
-        /// Add layer to the Stage.
-        /// </summary>
-        /// <param name="layer">Layer to add</param>
-        public void Add(Layer layer)
+        internal void Add(Layer layer)
         {
             NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /// <summary>
-        /// Remove layer from the Stage.
-        /// </summary>
-        /// <param name="layer">Layer to remove</param>
-        public void Remove(Layer layer)
+        internal void Remove(Layer layer)
         {
             NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
@@ -841,7 +819,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Touch event argument.
         /// </summary>
-        public class TouchedEventArgs : EventArgs
+        public class TouchEventArgs : EventArgs
         {
             private Touch _touch;
 
@@ -861,7 +839,7 @@ namespace Tizen.NUI
             }
         }
 
-        private event EventHandler<TouchedEventArgs> _stageTouchHandler;
+        private event EventHandler<TouchEventArgs> _stageTouchHandler;
         private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
 
         /// <summary>
@@ -870,7 +848,7 @@ namespace Tizen.NUI
         /// then when the last finger is lifted.<br>
         /// An interrupted event will also be emitted (if it occurs).<br>
         /// </summary>
-        public event EventHandler<TouchedEventArgs> Touched
+        public event EventHandler<TouchEventArgs> TouchEvent
         {
             add
             {
@@ -896,7 +874,7 @@ namespace Tizen.NUI
 
         private void OnStageTouch(IntPtr data)
         {
-            TouchedEventArgs e = new TouchedEventArgs();
+            TouchEventArgs e = new TouchEventArgs();
 
             if (data != null)
             {
@@ -912,7 +890,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Wheel event arguments.
         /// </summary>
-        public class WheelRolledEventArgs : EventArgs
+        public class WheelEventArgs : EventArgs
         {
             private Wheel _wheel;
 
@@ -932,13 +910,13 @@ namespace Tizen.NUI
             }
         }
 
-        private event EventHandler<WheelRolledEventArgs> _stageWheelHandler;
+        private event EventHandler<WheelEventArgs> _stageWheelHandler;
         private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
 
         /// <summary>
         /// Event emitted when wheel event is received.
         /// </summary>
-        public event EventHandler<WheelRolledEventArgs> WheelRolled
+        public event EventHandler<WheelEventArgs> WheelEvent
         {
             add
             {
@@ -961,7 +939,7 @@ namespace Tizen.NUI
 
         private void OnStageWheel(IntPtr data)
         {
-            WheelRolledEventArgs e = new WheelRolledEventArgs();
+            WheelEventArgs e = new WheelEventArgs();
 
             if (data != null)
             {
@@ -1003,7 +981,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Event emitted when key event is received.
         /// </summary>
-        public event EventHandler<KeyEventArgs> KeyPressed
+        public event EventHandler<KeyEventArgs> KeyEvent
         {
             add
             {
@@ -1180,37 +1158,24 @@ namespace Tizen.NUI
 
         public class ResizedEventArgs : EventArgs
         {
-            int _width;
-            int _height;
-
-            public int Width
-            {
-                get
-                {
-                    return _width;
-                }
-                set
-                {
-                    _width = value;
-                }
-            }
+            Uint16Pair _windowSize;
 
-            public int Height
+            public Uint16Pair WindowSize
             {
                 get
                 {
-                    return _height;
+                    return _windowSize;
                 }
                 set
                 {
-                    _height = value;
+                    _windowSize = value;
                 }
             }
         }
 
         private WindowResizedEventCallbackType _windowResizedEventCallback;
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void WindowResizedEventCallbackType(int width, int height);
+        private delegate void WindowResizedEventCallbackType(Uint16Pair windowSize);
         private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
 
         public event EventHandler<ResizedEventArgs> Resized
@@ -1236,11 +1201,10 @@ namespace Tizen.NUI
             }
         }
 
-        private void OnResized(int width, int height)
+        private void OnResized(Uint16Pair windowSize)
         {
             ResizedEventArgs e = new ResizedEventArgs();
-            e.Width = width;
-            e.Height = height;
+            e.WindowSize = windowSize;
 
             if (_windowResizedEventHandler != null)
             {
@@ -1248,6 +1212,32 @@ namespace Tizen.NUI
             }
         }
 
+        internal void SetWindowSize(Uint16Pair size)
+        {
+            NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(size));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal Uint16Pair GetWindowSize()
+        {
+            Uint16Pair ret = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal void SetPosition(Uint16Pair position)
+        {
+            NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(position));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal Uint16Pair GetPosition()
+        {
+            Uint16Pair ret = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         /// <summary>
         /// Window size property (read-only).
         /// </summary>
@@ -1299,5 +1289,109 @@ namespace Tizen.NUI
                 return GetLayerCount();
             }
         }
+
+
+        /// <summary>
+        /// Add layer to the Stage.
+        /// </summary>
+        /// <param name="layer">Layer to add</param>
+        public void AddLayer(Layer layer)
+        {
+            NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Remove layer from the Stage.
+        /// </summary>
+        /// <param name="layer">Layer to remove</param>
+        public void RemoveLayer(Layer layer)
+        {
+            NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        [Obsolete("Please do not use! this will be deprecated")]
+        public class WindowFocusChangedEventArgs : EventArgs
+        {
+            public bool FocusGained
+            {
+                get;
+                set;
+            }
+        }
+
+        private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
+        private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler2;
+
+        [Obsolete("Please do not use! this will be deprecated")]
+        public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
+        {
+            add
+            {
+                if (_windowFocusChangedEventHandler2 == null)
+                {
+                    _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
+                    WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
+                }
+
+                _windowFocusChangedEventHandler2 += value;
+            }
+            remove
+            {
+                _windowFocusChangedEventHandler2 -= value;
+
+                if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
+                {
+                    WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
+                }
+            }
+        }
+
+        private void OnWindowFocusedChanged2(bool focusGained)
+        {
+            WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
+
+            e.FocusGained = focusGained;
+
+            if (_windowFocusChangedEventHandler2 != null)
+            {
+                _windowFocusChangedEventHandler2(this, e);
+            }
+        }
+
+        /// <summary>
+        /// Gets/Sets a size of the window.
+        /// </summary>
+        public Uint16Pair WindowSize
+        {
+            get
+            {
+                return GetWindowSize();
+            }
+            set
+            {
+                SetWindowSize(value);
+            }
+        }
+
+        /// <summary>
+        /// Gets/Sets a position of the window.
+        /// </summary>
+        public Uint16Pair WindowPosition
+        {
+            get
+            {
+                return GetPosition();
+            }
+            set
+            {
+                SetPosition(value);
+            }
+        }
+
+
     }
 }