[NUI] change some comments of Timer and Window APIs
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
old mode 100644 (file)
new mode 100755 (executable)
index bf53c0a..e21644c
@@ -18,6 +18,7 @@ using System;
 using System.Runtime.InteropServices;
 using Tizen.NUI.BaseComponents;
 using System.ComponentModel;
+using System.Collections.Generic;
 
 namespace Tizen.NUI
 {
@@ -33,6 +34,15 @@ namespace Tizen.NUI
         private Layer _rootLayer;
         private string _windowTitle;
 
+        private List<Layer> _childLayers = new List<Layer>();
+        internal List<Layer> LayersChildren
+        {
+            get
+            {
+                return _childLayers;
+            }
+        }
+
         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
         {
             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
@@ -54,6 +64,7 @@ namespace Tizen.NUI
         /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
         /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
         /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Please do not use! This will be deprecated!")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
@@ -355,9 +366,14 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Sets a transparent window's visual state to opaque.
+        /// Sets a transparent window's visual state to opaque. <br />
+        /// If a visual state of a transparent window is opaque, <br />
+        /// then the window manager could handle it as an opaque window when calculating visibility.
         /// </summary>
         /// <param name="opaque">Whether the window's visual state is opaque.</param>
+        /// <remarks>This will have no effect on an opaque window. <br />
+        /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public void SetOpaqueState(bool opaque)
         {
@@ -369,6 +385,7 @@ namespace Tizen.NUI
         /// Returns whether a transparent window's visual state is opaque or not.
         /// </summary>
         /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
+        /// <remarks> The return value has no meaning on an opaque window. </remarks>
         /// <since_tizen> 3 </since_tizen>
         public bool IsOpaqueState()
         {
@@ -652,12 +669,16 @@ namespace Tizen.NUI
         {
             NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+            LayersChildren.Add(layer);
         }
 
         internal void Remove(Layer layer)
         {
             NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+            LayersChildren.Remove(layer);
         }
 
         /// <summary>
@@ -701,9 +722,10 @@ namespace Tizen.NUI
         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
         internal uint GetLayerCount()
         {
-            uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            if (LayersChildren == null || LayersChildren.Count < 0)
+                return 0;
+
+            return (uint) LayersChildren.Count;
         }
 
         /// <summary>
@@ -714,11 +736,15 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public Layer GetLayer(uint depth)
         {
-            IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
-            Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            if (depth < LayersChildren.Count)
+            {
+                Layer ret = LayersChildren[Convert.ToInt32(depth)];
+                return ret;
+            }
+            else
+            {
+                return null;
+            }
         }
 
         internal Layer GetRootLayer()
@@ -729,6 +755,7 @@ namespace Tizen.NUI
             {
                 _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                LayersChildren.Add(_rootLayer);
             }
             return _rootLayer;
         }
@@ -1464,7 +1491,8 @@ namespace Tizen.NUI
         /// <since_tizen> 5 </since_tizen>
         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public void SetTransparency(bool transparent) {
+        public void SetTransparency(bool transparent)
+        {
             NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
@@ -1535,6 +1563,8 @@ namespace Tizen.NUI
         {
             NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+            LayersChildren.Add(layer);
         }
 
         /// <summary>
@@ -1546,12 +1576,18 @@ namespace Tizen.NUI
         {
             NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+            LayersChildren.Remove(layer);
         }
 
         /// <summary>
         /// Please do not use! this will be deprecated
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " +
+            "Like: " +
+            "Window.Instance.FocusChanged = OnFocusChanged; " +
+            "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public class WindowFocusChangedEventArgs : EventArgs
         {
@@ -1577,7 +1613,10 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         /// Please do not use! this will be deprecated!
         /// Instead please use FocusChanged.
-        [Obsolete("Please do not use! this will be deprecated, instead please use FocusChanged")]
+        [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " +
+            "Like: " +
+            "Window.Instance.FocusChanged = OnFocusChanged; " +
+            "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
         {
@@ -1649,7 +1688,21 @@ namespace Tizen.NUI
         /// <summary>
         /// Feed a key-event into the window.
         /// </summary>
+        /// <param name="keyEvent">The key event to feed.</param>
+        /// <since_tizen> 5 </since_tizen>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void FeedKey(Key keyEvent)
+        {
+            NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Feed a key-event into the window.
+        /// </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!")]
         public static void FeedKeyEvent(Key keyEvent)
         {
             NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));