[NUI]Changed the APIs related to MultiWIndow to public (#1020)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
1
2
3 /*
4  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19 using System;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.BaseComponents;
22 using System.ComponentModel;
23 using System.Collections.Generic;
24
25 namespace Tizen.NUI
26 {
27     /// <summary>
28     /// The window class is used internally for drawing.<br />
29     /// The window has an orientation and indicator properties.<br />
30     /// </summary>
31     /// <since_tizen> 3 </since_tizen>
32     public class Window : BaseHandle
33     {
34         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35         private global::System.Runtime.InteropServices.HandleRef stageCPtr;
36         private Layer _rootLayer;
37         private string _windowTitle;
38         private List<Layer> _childLayers = new List<Layer>();
39         private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
40         private RootLayerTouchDataCallbackType _rootLayerTouchDataCallback;
41         private WheelEventCallbackType _wheelEventCallback;
42         private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
43         private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
44         private EventHandler _stageContextLostEventHandler;
45         private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
46         private EventHandler _stageContextRegainedEventHandler;
47         private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
48         private EventHandler _stageSceneCreatedEventHandler;
49         private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
50         private WindowResizedEventCallbackType _windowResizedEventCallback;
51         private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
52
53         private static readonly Window instance = Application.Instance?.GetWindow();
54
55         private LayoutController localController;
56
57         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Window.Window_SWIGUpcast(cPtr), cMemoryOwn)
58         {
59             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
60             if (Interop.Stage.Stage_IsInstalled())
61             {
62                 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.Stage_GetCurrent());
63
64                 localController = new LayoutController(this);
65                 NUILog.Debug("layoutController id:" + localController.GetId() );
66             }
67         }
68
69         /// <summary>
70         /// Creates a new Window.<br />
71         /// This creates an extra window in addition to the default main window<br />
72         /// </summary>
73         /// <param name="windowPosition">The position and size of the Window.</param>
74         /// <param name="isTranslucent">Whether Window is translucent.</param>
75         /// <returns>A new Window.</returns>
76         /// <since_tizen> 6 </since_tizen>
77         public Window(Rectangle windowPosition = null , bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
78         {
79             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
80         }
81
82         /// <summary>
83         /// Creates a new Window.<br />
84         /// This creates an extra window in addition to the default main window<br />
85         /// </summary>
86         /// <param name="name">The name for extra window. </param>
87         /// <param name="windowPosition">The position and size of the Window.</param>
88         /// <param name="isTranslucent">Whether Window is translucent.</param>
89         /// <returns>A new Window.</returns>
90         /// <since_tizen> 6 </since_tizen>
91         public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
92         {
93             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94         }
95
96         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
97         private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
98         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
99         private delegate bool RootLayerTouchDataCallbackType(IntPtr view, IntPtr touchData);
100         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
101         private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
102         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
103         private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
104         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
105         private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
106
107         /// <summary>
108         /// FocusChanged event.
109         /// </summary>
110         /// <since_tizen> 3 </since_tizen>
111         public event EventHandler<FocusChangedEventArgs> FocusChanged
112         {
113             add
114             {
115                 if (_windowFocusChangedEventHandler == null)
116                 {
117                     _windowFocusChangedEventCallback = OnWindowFocusedChanged;
118                     WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
119                 }
120
121                 _windowFocusChangedEventHandler += value;
122             }
123             remove
124             {
125                 _windowFocusChangedEventHandler -= value;
126
127                 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
128                 {
129                     WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
130                 }
131             }
132         }
133
134         /// <summary>
135         /// This event is emitted when the screen is touched and when the touch ends.<br />
136         /// If there are multiple touch points, then this will be emitted when the first touch occurs and
137         /// then when the last finger is lifted.<br />
138         /// An interrupted event will also be emitted (if it occurs).<br />
139         /// </summary>
140         /// <since_tizen> 3 </since_tizen>
141         public event EventHandler<TouchEventArgs> TouchEvent
142         {
143             add
144             {
145                 if (_rootLayerTouchDataEventHandler == null)
146                 {
147                     _rootLayerTouchDataCallback = OnWindowTouch;
148                     this.TouchDataSignal().Connect(_rootLayerTouchDataCallback);
149                 }
150                 _rootLayerTouchDataEventHandler += value;
151             }
152             remove
153             {
154                 _rootLayerTouchDataEventHandler -= value;
155                 if (_rootLayerTouchDataEventHandler == null && TouchSignal().Empty() == false)
156                 {
157                     this.TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
158                 }
159             }
160         }
161
162         /// <summary>
163         /// This event is emitted when the wheel event is received.
164         /// </summary>
165         /// <since_tizen> 3 </since_tizen>
166         public event EventHandler<WheelEventArgs> WheelEvent
167         {
168             add
169             {
170                 if (_stageWheelHandler == null)
171                 {
172                     _wheelEventCallback = OnStageWheel;
173                     this.StageWheelEventSignal().Connect(_wheelEventCallback);
174                 }
175                 _stageWheelHandler += value;
176             }
177             remove
178             {
179                 _stageWheelHandler -= value;
180                 if (_stageWheelHandler == null && StageWheelEventSignal().Empty() == false)
181                 {
182                     this.StageWheelEventSignal().Disconnect(_wheelEventCallback);
183                 }
184             }
185         }
186
187         /// <summary>
188         /// This event is emitted when the key event is received.
189         /// </summary>
190         /// <since_tizen> 3 </since_tizen>
191         public event EventHandler<KeyEventArgs> KeyEvent
192         {
193             add
194             {
195                 if (_stageKeyHandler == null)
196                 {
197                     _stageKeyCallbackDelegate = OnStageKey;
198                     KeyEventSignal().Connect(_stageKeyCallbackDelegate);
199                 }
200                 _stageKeyHandler += value;
201             }
202             remove
203             {
204                 _stageKeyHandler -= value;
205                 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
206                 {
207                     KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
208                 }
209             }
210         }
211
212         /// <summary>
213         /// This event is emitted when the window resized.
214         /// </summary>
215         /// <since_tizen> 3 </since_tizen>
216         public event EventHandler<ResizedEventArgs> Resized
217         {
218             add
219             {
220                 if (_windowResizedEventHandler == null)
221                 {
222                     _windowResizedEventCallback = OnResized;
223                     ResizedSignal().Connect(_windowResizedEventCallback);
224                 }
225
226                 _windowResizedEventHandler += value;
227             }
228             remove
229             {
230                 _windowResizedEventHandler -= value;
231
232                 if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
233                 {
234                     ResizedSignal().Disconnect(_windowResizedEventCallback);
235                 }
236             }
237         }
238
239         /// <summary>
240         /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
241         /// </summary>
242         /// <since_tizen> 3 </since_tizen>
243         /// Please do not use! this will be deprecated!
244         /// Instead please use FocusChanged.
245         [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " +
246             "Like: " +
247             "Window.Instance.FocusChanged = OnFocusChanged; " +
248             "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
249         [EditorBrowsable(EditorBrowsableState.Never)]
250         public event EventHandler<FocusChangedEventArgs> WindowFocusChanged
251         {
252             add
253             {
254                 if (_windowFocusChangedEventHandler2 == null)
255                 {
256                     _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
257                     WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
258                 }
259
260                 _windowFocusChangedEventHandler2 += value;
261             }
262             remove
263             {
264                 _windowFocusChangedEventHandler2 -= value;
265
266                 if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
267                 {
268                     WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
269                 }
270             }
271         }
272
273         /// <summary>
274         /// ViewAdded will be triggered when the view added on Window
275         /// </summary>
276         /// <since_tizen> 6 </since_tizen>
277         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
278         [EditorBrowsable(EditorBrowsableState.Never)]
279         public event EventHandler ViewAdded;
280
281         internal void SendViewAdded(View view)
282         {
283             ViewAdded?.Invoke(view, EventArgs.Empty);
284         }
285
286         internal event EventHandler EventProcessingFinished
287         {
288             add
289             {
290                 if (_stageEventProcessingFinishedEventHandler == null)
291                 {
292                     _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
293                     EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
294                 }
295                 _stageEventProcessingFinishedEventHandler += value;
296
297             }
298             remove
299             {
300                 _stageEventProcessingFinishedEventHandler -= value;
301                 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
302                 {
303                     EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
304                 }
305             }
306         }
307
308         internal event EventHandler ContextLost
309         {
310             add
311             {
312                 if (_stageContextLostEventHandler == null)
313                 {
314                     _stageContextLostEventCallbackDelegate = OnContextLost;
315                     ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
316                 }
317                 _stageContextLostEventHandler += value;
318             }
319             remove
320             {
321                 _stageContextLostEventHandler -= value;
322                 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
323                 {
324                     ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
325                 }
326             }
327         }
328
329         internal event EventHandler ContextRegained
330         {
331             add
332             {
333                 if (_stageContextRegainedEventHandler == null)
334                 {
335                     _stageContextRegainedEventCallbackDelegate = OnContextRegained;
336                     ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
337                 }
338                 _stageContextRegainedEventHandler += value;
339             }
340             remove
341             {
342                 _stageContextRegainedEventHandler -= value;
343                 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
344                 {
345                     this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
346                 }
347             }
348         }
349
350         internal event EventHandler SceneCreated
351         {
352             add
353             {
354                 if (_stageSceneCreatedEventHandler == null)
355                 {
356                     _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
357                     SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
358                 }
359                 _stageSceneCreatedEventHandler += value;
360             }
361             remove
362             {
363                 _stageSceneCreatedEventHandler -= value;
364                 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
365                 {
366                     SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
367                 }
368             }
369         }
370
371         private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
372         private event EventHandler<TouchEventArgs> _rootLayerTouchDataEventHandler;
373         private event EventHandler<WheelEventArgs> _stageWheelHandler;
374         private event EventHandler<KeyEventArgs> _stageKeyHandler;
375         private event EventHandler _stageEventProcessingFinishedEventHandler;
376         private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
377         private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler2;
378
379         /// <summary>
380         /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
381         /// </summary>
382         /// <since_tizen> 3 </since_tizen>
383         public enum WindowOrientation
384         {
385             /// <summary>
386             /// Portrait orientation. The height of the display area is greater than the width.
387             /// </summary>
388             /// <since_tizen> 3 </since_tizen>
389             Portrait = 0,
390             /// <summary>
391             /// Landscape orientation. A wide view area is needed.
392             /// </summary>
393             /// <since_tizen> 3 </since_tizen>
394             Landscape = 90,
395             /// <summary>
396             /// Portrait inverse orientation.
397             /// </summary>
398             /// <since_tizen> 3 </since_tizen>
399             PortraitInverse = 180,
400             /// <summary>
401             /// Landscape inverse orientation.
402             /// </summary>
403             /// <since_tizen> 3 </since_tizen>
404             LandscapeInverse = 270
405         }
406
407         /// <summary>
408         /// Enumeration for the key grab mode for platform-level APIs.
409         /// </summary>
410         /// <since_tizen> 3 </since_tizen>
411         public enum KeyGrabMode
412         {
413             /// <summary>
414             /// Grabs a key only when on the top of the grabbing-window stack mode.
415             /// </summary>
416             Topmost = 0,
417             /// <summary>
418             /// Grabs a key together with the other client window(s) mode.
419             /// </summary>
420             Shared,
421             /// <summary>
422             /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode.
423             /// </summary>
424             OverrideExclusive,
425             /// <summary>
426             /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
427             /// </summary>
428             Exclusive
429         };
430
431         /// <summary>
432         /// Enumeration for opacity of the indicator.
433         /// </summary>
434         internal enum IndicatorBackgroundOpacity
435         {
436             Opaque = 100,
437             Translucent = 50,
438             Transparent = 0
439         }
440
441         /// <summary>
442         /// Enumeration for visible mode of the indicator.
443         /// </summary>
444         internal enum IndicatorVisibleMode
445         {
446             Invisible = 0,
447             Visible = 1,
448             Auto = 2
449         }
450
451         /// <summary>
452         /// The stage instance property (read-only).<br />
453         /// Gets the current window.<br />
454         /// </summary>
455         /// <since_tizen> 3 </since_tizen>
456         public static Window Instance
457         {
458             get
459             {
460                 return instance;
461             }
462         }
463
464         /// <summary>
465         /// Gets or sets a window type.
466         /// </summary>
467         /// <since_tizen> 3 </since_tizen>
468         public WindowType Type
469         {
470             get
471             {
472                 WindowType ret = (WindowType)Interop.Window.GetType(swigCPtr);
473                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
474                 return ret;
475             }
476             set
477             {
478                 Interop.Window.SetType(swigCPtr, (int)value);
479                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480             }
481         }
482
483         /// <summary>
484         /// Gets/Sets a window title.
485         /// </summary>
486         /// <since_tizen> 4 </since_tizen>
487         public string Title
488         {
489             get
490             {
491                 return _windowTitle;
492             }
493             set
494             {
495                 _windowTitle = value;
496                 SetClass(_windowTitle, "");
497             }
498         }
499
500         /// <summary>
501         /// The rendering behavior of a Window.
502         /// </summary>
503         /// <since_tizen> 5 </since_tizen>
504         public RenderingBehaviorType RenderingBehavior
505         {
506             get
507             {
508                 return GetRenderingBehavior();
509             }
510             set
511             {
512                 SetRenderingBehavior(value);
513             }
514         }
515
516         /// <summary>
517         /// The window size property (read-only).
518         /// </summary>
519         /// <since_tizen> 3 </since_tizen>
520         public Size2D Size
521         {
522             get
523             {
524                 Size2D ret = GetSize();
525                 return ret;
526             }
527         }
528
529         /// <summary>
530         /// The background color property.
531         /// </summary>
532         /// <since_tizen> 3 </since_tizen>
533         public Color BackgroundColor
534         {
535             set
536             {
537                 SetBackgroundColor(value);
538             }
539             get
540             {
541                 Color ret = GetBackgroundColor();
542                 return ret;
543             }
544         }
545
546         /// <summary>
547         /// The DPI property (read-only).<br />
548         /// Retrieves the DPI of the display device to which the Window is connected.<br />
549         /// </summary>
550         /// <since_tizen> 3 </since_tizen>
551         public Vector2 Dpi
552         {
553             get
554             {
555                 return GetDpi();
556             }
557         }
558
559         /// <summary>
560         /// The layer count property (read-only).<br />
561         /// Queries the number of on-Window layers.<br />
562         /// </summary>
563         /// <since_tizen> 3 </since_tizen>
564         public uint LayerCount
565         {
566             get
567             {
568                 return GetLayerCount();
569             }
570         }
571
572         /// <summary>
573         /// Gets or sets a size of the window.
574         /// </summary>
575         /// <since_tizen> 4 </since_tizen>
576         public Size2D WindowSize
577         {
578             get
579             {
580                 return GetWindowSize();
581             }
582             set
583             {
584                 SetWindowSize(value);
585             }
586         }
587
588         /// <summary>
589         /// Gets or sets a position of the window.
590         /// </summary>
591         /// <since_tizen> 4 </since_tizen>
592         public Position2D WindowPosition
593         {
594             get
595             {
596                 return GetPosition();
597             }
598             set
599             {
600                 SetPosition(value);
601             }
602         }
603         internal static Vector4 DEFAULT_BACKGROUND_COLOR
604         {
605             get
606             {
607                 global::System.IntPtr cPtr = Interop.Stage.Stage_DEFAULT_BACKGROUND_COLOR_get();
608                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
609                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610                 return ret;
611             }
612         }
613
614         internal static Vector4 DEBUG_BACKGROUND_COLOR
615         {
616             get
617             {
618                 global::System.IntPtr cPtr = Interop.Stage.Stage_DEBUG_BACKGROUND_COLOR_get();
619                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
620                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621                 return ret;
622             }
623         }
624
625         internal List<Layer> LayersChildren
626         {
627             get
628             {
629                 return _childLayers;
630             }
631         }
632
633         internal LayoutController LayoutController
634         {
635             get
636             {
637                 return localController;
638             }
639         }
640
641         /// <summary>
642         /// Feed a key-event into the window.
643         /// </summary>
644         /// <param name="keyEvent">The key event to feed.</param>
645         /// <since_tizen> 4 </since_tizen>
646         [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
647         public static void FeedKeyEvent(Key keyEvent)
648         {
649             Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
650             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
651         }
652
653         /// <summary>
654         /// Sets whether the window accepts a focus or not.
655         /// </summary>
656         /// <param name="accept">If a focus is accepted or not. The default is true.</param>
657         /// <since_tizen> 3 </since_tizen>
658         public void SetAcceptFocus(bool accept)
659         {
660             Interop.Window.SetAcceptFocus(swigCPtr, accept);
661             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
662         }
663
664         /// <summary>
665         /// Returns whether the window accepts a focus or not.
666         /// </summary>
667         /// <returns>True if the window accepts a focus, false otherwise.</returns>
668         /// <since_tizen> 3 </since_tizen>
669         public bool IsFocusAcceptable()
670         {
671             bool ret = Interop.Window.IsFocusAcceptable(swigCPtr);
672             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673
674             return ret;
675         }
676
677         /// <summary>
678         /// Shows the window if it is hidden.
679         /// </summary>
680         /// <since_tizen> 3 </since_tizen>
681         public void Show()
682         {
683             Interop.Window.Show(swigCPtr);
684             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
685         }
686
687         /// <summary>
688         /// Hides the window if it is showing.
689         /// </summary>
690         /// <since_tizen> 3 </since_tizen>
691         public void Hide()
692         {
693             Interop.Window.Hide(swigCPtr);
694             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
695         }
696
697         /// <summary>
698         /// Retrieves whether the window is visible or not.
699         /// </summary>
700         /// <returns>True if the window is visible.</returns>
701         /// <since_tizen> 3 </since_tizen>
702         public bool IsVisible()
703         {
704             bool temp = Interop.Window.IsVisible(swigCPtr);
705             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
706             return temp;
707         }
708
709         /// <summary>
710         /// Gets the count of supported auxiliary hints of the window.
711         /// </summary>
712         /// <returns>The number of supported auxiliary hints.</returns>
713         /// <since_tizen> 3 </since_tizen>
714         public uint GetSupportedAuxiliaryHintCount()
715         {
716             uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(swigCPtr);
717             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718             return ret;
719         }
720
721         /// <summary>
722         /// Gets the supported auxiliary hint string of the window.
723         /// </summary>
724         /// <param name="index">The index of the supported auxiliary hint lists.</param>
725         /// <returns>The auxiliary hint string of the index.</returns>
726         /// <since_tizen> 3 </since_tizen>
727         public string GetSupportedAuxiliaryHint(uint index)
728         {
729             string ret = Interop.Window.GetSupportedAuxiliaryHint(swigCPtr, index);
730             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
731             return ret;
732         }
733
734         /// <summary>
735         /// Creates an auxiliary hint of the window.
736         /// </summary>
737         /// <param name="hint">The auxiliary hint string.</param>
738         /// <param name="value">The value string.</param>
739         /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
740         /// <since_tizen> 3 </since_tizen>
741         public uint AddAuxiliaryHint(string hint, string value)
742         {
743             uint ret = Interop.Window.AddAuxiliaryHint(swigCPtr, hint, value);
744             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745             return ret;
746         }
747
748         /// <summary>
749         /// Removes an auxiliary hint of the window.
750         /// </summary>
751         /// <param name="id">The ID of the auxiliary hint.</param>
752         /// <returns>True if no error occurred, false otherwise.</returns>
753         /// <since_tizen> 3 </since_tizen>
754         public bool RemoveAuxiliaryHint(uint id)
755         {
756             bool ret = Interop.Window.RemoveAuxiliaryHint(swigCPtr, id);
757             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
758             return ret;
759         }
760
761         /// <summary>
762         /// Changes a value of the auxiliary hint.
763         /// </summary>
764         /// <param name="id">The auxiliary hint ID.</param>
765         /// <param name="value">The value string to be set.</param>
766         /// <returns>True if no error occurred, false otherwise.</returns>
767         /// <since_tizen> 3 </since_tizen>
768         public bool SetAuxiliaryHintValue(uint id, string value)
769         {
770             bool ret = Interop.Window.SetAuxiliaryHintValue(swigCPtr, id, value);
771             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
772             return ret;
773         }
774
775         /// <summary>
776         /// Gets a value of the auxiliary hint.
777         /// </summary>
778         /// <param name="id">The auxiliary hint ID.</param>
779         /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
780         /// <since_tizen> 3 </since_tizen>
781         public string GetAuxiliaryHintValue(uint id)
782         {
783             string ret = Interop.Window.GetAuxiliaryHintValue(swigCPtr, id);
784             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
785             return ret;
786         }
787
788         /// <summary>
789         /// Gets an ID of the auxiliary hint string.
790         /// </summary>
791         /// <param name="hint">The auxiliary hint string.</param>
792         /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
793         /// <since_tizen> 3 </since_tizen>
794         public uint GetAuxiliaryHintId(string hint)
795         {
796             uint ret = Interop.Window.GetAuxiliaryHintId(swigCPtr, hint);
797             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
798             return ret;
799         }
800
801         /// <summary>
802         /// Sets a region to accept input events.
803         /// </summary>
804         /// <param name="inputRegion">The region to accept input events.</param>
805         /// <since_tizen> 3 </since_tizen>
806         public void SetInputRegion(Rectangle inputRegion)
807         {
808             Interop.Window.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
809             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
810         }
811
812         /// <summary>
813         /// Sets a priority level for the specified notification window.
814         /// </summary>
815         /// <param name="level">The notification window level.</param>
816         /// <returns>True if no error occurred, false otherwise.</returns>
817         /// <since_tizen> 3 </since_tizen>
818         public bool SetNotificationLevel(NotificationLevel level)
819         {
820             bool ret = Interop.Window.SetNotificationLevel(swigCPtr, (int)level);
821             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
822             return ret;
823         }
824
825         /// <summary>
826         /// Gets a priority level for the specified notification window.
827         /// </summary>
828         /// <returns>The notification window level.</returns>
829         /// <since_tizen> 3 </since_tizen>
830         public NotificationLevel GetNotificationLevel()
831         {
832             NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(swigCPtr);
833             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
834             return ret;
835         }
836
837         /// <summary>
838         /// Sets a transparent window's visual state to opaque. <br />
839         /// If a visual state of a transparent window is opaque, <br />
840         /// then the window manager could handle it as an opaque window when calculating visibility.
841         /// </summary>
842         /// <param name="opaque">Whether the window's visual state is opaque.</param>
843         /// <remarks>This will have no effect on an opaque window. <br />
844         /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
845         /// </remarks>
846         /// <since_tizen> 3 </since_tizen>
847         public void SetOpaqueState(bool opaque)
848         {
849             Interop.Window.SetOpaqueState(swigCPtr, opaque);
850             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
851         }
852
853         /// <summary>
854         /// Returns whether a transparent window's visual state is opaque or not.
855         /// </summary>
856         /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
857         /// <remarks> The return value has no meaning on an opaque window. </remarks>
858         /// <since_tizen> 3 </since_tizen>
859         public bool IsOpaqueState()
860         {
861             bool ret = Interop.Window.IsOpaqueState(swigCPtr);
862             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
863             return ret;
864         }
865
866         /// <summary>
867         /// Sets a window's screen off mode.
868         /// </summary>
869         /// <param name="screenOffMode">The screen mode.</param>
870         /// <returns>True if no error occurred, false otherwise.</returns>
871         /// <since_tizen> 4 </since_tizen>
872         public bool SetScreenOffMode(ScreenOffMode screenOffMode)
873         {
874             bool ret = Interop.Window.SetScreenOffMode(swigCPtr, (int)screenOffMode);
875             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
876             return ret;
877         }
878
879         /// <summary>
880         /// Gets the screen mode of the window.
881         /// </summary>
882         /// <returns>The screen off mode.</returns>
883         /// <since_tizen> 4 </since_tizen>
884         public ScreenOffMode GetScreenOffMode()
885         {
886             ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(swigCPtr);
887             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
888             return ret;
889         }
890
891         /// <summary>
892         /// Sets preferred brightness of the window.
893         /// </summary>
894         /// <param name="brightness">The preferred brightness (0 to 100).</param>
895         /// <returns>True if no error occurred, false otherwise.</returns>
896         /// <since_tizen> 3 </since_tizen>
897         public bool SetBrightness(int brightness)
898         {
899             bool ret = Interop.Window.SetBrightness(swigCPtr, brightness);
900             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
901             return ret;
902         }
903
904         /// <summary>
905         /// Gets the preferred brightness of the window.
906         /// </summary>
907         /// <returns>The preferred brightness.</returns>
908         /// <since_tizen> 3 </since_tizen>
909         public int GetBrightness()
910         {
911             int ret = Interop.Window.GetBrightness(swigCPtr);
912             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
913             return ret;
914         }
915
916         /// <summary>
917         /// Sets the window name and the class string.
918         /// </summary>
919         /// <param name="name">The name of the window.</param>
920         /// <param name="klass">The class of the window.</param>
921         /// <since_tizen> 4 </since_tizen>
922         public void SetClass(string name, string klass)
923         {
924             Interop.Window.Window_SetClass(swigCPtr, name, klass);
925             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
926         }
927
928         /// <summary>
929         /// Raises the window to the top of the window stack.
930         /// </summary>
931         /// <since_tizen> 3 </since_tizen>
932         public void Raise()
933         {
934             Interop.Window.Window_Raise(swigCPtr);
935             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
936         }
937
938         /// <summary>
939         /// Lowers the window to the bottom of the window stack.
940         /// </summary>
941         /// <since_tizen> 3 </since_tizen>
942         public void Lower()
943         {
944             Interop.Window.Window_Lower(swigCPtr);
945             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
946         }
947
948         /// <summary>
949         /// Activates the window to the top of the window stack even it is iconified.
950         /// </summary>
951         /// <since_tizen> 3 </since_tizen>
952         public void Activate()
953         {
954             Interop.Window.Window_Activate(swigCPtr);
955             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
956         }
957
958         /// <summary>
959         /// Gets the default ( root ) layer.
960         /// </summary>
961         /// <returns>The root layer.</returns>
962         /// <since_tizen> 3 </since_tizen>
963         public Layer GetDefaultLayer()
964         {
965             return this.GetRootLayer();
966         }
967
968         /// <summary>
969         /// Add a child view to window.
970         /// </summary>
971         /// <param name="view">the child should be added to the window.</param>
972         /// <since_tizen> 3 </since_tizen>
973         public void Add(View view)
974         {
975             Interop.Actor.Actor_Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
976             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
977             this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
978             view.InternalParent = this.GetRootLayer();
979         }
980
981         /// <summary>
982         /// Remove a child view from window.
983         /// </summary>
984         /// <param name="view">the child to be removed.</param>
985         /// <since_tizen> 3 </since_tizen>
986         public void Remove(View view)
987         {
988             Interop.Actor.Actor_Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
989             this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
990             view.InternalParent = null;
991         }
992
993         /// <summary>
994         /// Retrieves the layer at a specified depth.
995         /// </summary>
996         /// <param name="depth">The layer's depth index.</param>
997         /// <returns>The layer found at the given depth.</returns>
998         /// <since_tizen> 3 </since_tizen>
999         public Layer GetLayer(uint depth)
1000         {
1001             if (depth < LayersChildren?.Count)
1002             {
1003                 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
1004                 return ret;
1005             }
1006             else
1007             {
1008                 return null;
1009             }
1010         }
1011
1012         /// <summary>
1013         /// Destroy the window immediately.
1014         /// </summary>
1015         [EditorBrowsable(EditorBrowsableState.Never)]
1016         public void Destroy()
1017         {
1018             this.Dispose();
1019         }
1020
1021         /// <summary>
1022         /// Keep rendering for at least the given amount of time.
1023         /// </summary>
1024         /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
1025         /// <since_tizen> 3 </since_tizen>
1026         public void KeepRendering(float durationSeconds)
1027         {
1028             Interop.Stage.Stage_KeepRendering(stageCPtr, durationSeconds);
1029             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1030         }
1031
1032         /// <summary>
1033         /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
1034         /// This function can be used for following example scenarios: <br />
1035         /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
1036         /// </summary>
1037         /// <param name="DaliKey">The key code to grab.</param>
1038         /// <returns>True if the grab succeeds.</returns>
1039         /// <since_tizen> 3 </since_tizen>
1040         public bool GrabKeyTopmost(int DaliKey)
1041         {
1042             bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1043             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1044             return ret;
1045         }
1046
1047         /// <summary>
1048         /// Ungrabs the key specified by a key for the window.<br />
1049         /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.<br />
1050         /// </summary>
1051         /// <param name="DaliKey">The key code to ungrab.</param>
1052         /// <returns>True if the ungrab succeeds.</returns>
1053         /// <since_tizen> 3 </since_tizen>
1054         public bool UngrabKeyTopmost(int DaliKey)
1055         {
1056             bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1057             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1058             return ret;
1059         }
1060
1061         /// <summary>
1062         ///  Grabs the key specified by a key for a window in a GrabMode. <br />
1063         ///  Details: This function can be used for following example scenarios: <br />
1064         ///  - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
1065         ///  - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
1066         ///  - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
1067         /// </summary>
1068         /// <param name="DaliKey">The key code to grab.</param>
1069         /// <param name="GrabMode">The grab mode for the key.</param>
1070         /// <returns>True if the grab succeeds.</returns>
1071         /// <since_tizen> 3 </since_tizen>
1072         public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
1073         {
1074             bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
1075             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1076             return ret;
1077         }
1078
1079         /// <summary>
1080         /// Ungrabs the key specified by a key for a window.<br />
1081         /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event. <br />
1082         /// </summary>
1083         /// <param name="DaliKey">The key code to ungrab.</param>
1084         /// <returns>True if the ungrab succeeds.</returns>
1085         /// <since_tizen> 3 </since_tizen>
1086         public bool UngrabKey(int DaliKey)
1087         {
1088             bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1089             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1090             return ret;
1091         }
1092
1093         /// <summary>
1094         /// Sets the keyboard repeat information.
1095         /// </summary>
1096         /// <param name="rate">The key repeat rate value in seconds.</param>
1097         /// <param name="delay">The key repeat delay value in seconds.</param>
1098         /// <returns>True if setting the keyboard repeat succeeds.</returns>
1099         /// <since_tizen> 5 </since_tizen>
1100         public bool SetKeyboardRepeatInfo(float rate, float delay)
1101         {
1102             bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
1103             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1104             return ret;
1105         }
1106
1107         /// <summary>
1108         /// Gets the keyboard repeat information.
1109         /// </summary>
1110         /// <param name="rate">The key repeat rate value in seconds.</param>
1111         /// <param name="delay">The key repeat delay value in seconds.</param>
1112         /// <returns>True if setting the keyboard repeat succeeds.</returns>
1113         /// <since_tizen> 5 </since_tizen>
1114         public bool GetKeyboardRepeatInfo(out float rate, out float delay)
1115         {
1116             bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
1117             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118             return ret;
1119         }
1120
1121         /// <summary>
1122         /// Adds a layer to the stage.
1123         /// </summary>
1124         /// <param name="layer">Layer to add.</param>
1125         /// <since_tizen> 3 </since_tizen>
1126         public void AddLayer(Layer layer)
1127         {
1128             Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
1129             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1130
1131             LayersChildren?.Add(layer);
1132             layer.SetWindow(this);
1133         }
1134
1135         /// <summary>
1136         /// Removes a layer from the stage.
1137         /// </summary>
1138         /// <param name="layer">Layer to remove.</param>
1139         /// <since_tizen> 3 </since_tizen>
1140         public void RemoveLayer(Layer layer)
1141         {
1142             Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
1143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1144
1145             LayersChildren?.Remove(layer);
1146             layer.SetWindow(null);
1147         }
1148
1149         /// <summary>
1150         /// Feeds a key event into the window.
1151         /// </summary>
1152         /// <param name="keyEvent">The key event to feed.</param>
1153         /// <since_tizen> 5 </since_tizen>
1154         public void FeedKey(Key keyEvent)
1155         {
1156             Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
1157             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1158         }
1159
1160         /// <summary>
1161         /// Allows at least one more render, even when paused.
1162         /// The window should be shown, not minimised.
1163         /// </summary>
1164         /// <since_tizen> 4 </since_tizen>
1165         public void RenderOnce()
1166         {
1167             Interop.Window.Window_RenderOnce(swigCPtr);
1168             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1169         }
1170
1171         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
1172         {
1173             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1174         }
1175
1176         internal static Window GetCurrent()
1177         {
1178             Window ret = new Window(Interop.Stage.Stage_GetCurrent(), true);
1179             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1180             return ret;
1181         }
1182
1183         internal static bool IsInstalled()
1184         {
1185             bool ret = Interop.Stage.Stage_IsInstalled();
1186             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1187             return ret;
1188         }
1189
1190         internal WindowFocusSignalType WindowFocusChangedSignal()
1191         {
1192             WindowFocusSignalType ret = new WindowFocusSignalType(Interop.Window.FocusChangedSignal(swigCPtr), false);
1193             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1194             return ret;
1195         }
1196
1197         internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
1198         {
1199             Interop.WindowInternal.Window_ShowIndicator(swigCPtr, (int)visibleMode);
1200             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1201         }
1202
1203         internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
1204         {
1205             Interop.WindowInternal.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
1206             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1207         }
1208
1209         internal void RotateIndicator(Window.WindowOrientation orientation)
1210         {
1211             Interop.WindowInternal.Window_RotateIndicator(swigCPtr, (int)orientation);
1212             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1213         }
1214
1215         /// <summary>
1216         /// Adds an orientation to the list of available orientations.
1217         /// </summary>
1218         /// <param name="orientation">The available orientation to add</param>
1219         /// <since_tizen> 6 </since_tizen>
1220         public void AddAvailableOrientation(Window.WindowOrientation orientation)
1221         {
1222             Interop.Window.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
1223             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1224         }
1225
1226         /// <summary>
1227         /// Removes an orientation from the list of available orientations.
1228         /// </summary>
1229         /// <param name="orientation">The available orientation to remove.</param>
1230         /// <since_tizen> 6 </since_tizen>
1231         public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1232         {
1233             Interop.Window.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
1234             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1235         }
1236
1237         /// <summary>
1238         /// Sets a preferred orientation.
1239         /// </summary>
1240         /// <param name="orientation">The preferred orientation.</param>
1241         /// <since_tizen> 6 </since_tizen>
1242         public void SetPreferredOrientation(Window.WindowOrientation orientation)
1243         {
1244             Interop.Window.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
1245             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1246         }
1247
1248         /// <summary>
1249         /// Gets the preferred orientation.
1250         /// </summary>
1251         /// <since_tizen> 6 </since_tizen>
1252         /// <returns>The preferred orientation if previously set, or none.</returns>
1253         public Window.WindowOrientation GetPreferredOrientation()
1254         {
1255             Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.Window_GetPreferredOrientation(swigCPtr);
1256             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1257             return ret;
1258         }
1259
1260         internal Any GetNativeHandle()
1261         {
1262             Any ret = new Any(Interop.WindowInternal.Window_GetNativeHandle(swigCPtr), true);
1263             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1264             return ret;
1265         }
1266
1267         internal WindowFocusSignalType FocusChangedSignal()
1268         {
1269             WindowFocusSignalType ret = new WindowFocusSignalType(Interop.Window.FocusChangedSignal(swigCPtr), false);
1270             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1271             return ret;
1272         }
1273
1274         internal void Add(Layer layer)
1275         {
1276             Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
1277             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1278
1279             LayersChildren?.Add(layer);
1280             layer.SetWindow(this);
1281         }
1282
1283         internal void Remove(Layer layer)
1284         {
1285             Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
1286             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1287
1288             LayersChildren?.Remove(layer);
1289             layer.SetWindow(null);
1290         }
1291
1292         internal Vector2 GetSize()
1293         {
1294             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1295             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1296             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1297             return ret;
1298         }
1299
1300         internal RenderTaskList GetRenderTaskList()
1301         {
1302             RenderTaskList ret = new RenderTaskList(Interop.Stage.Stage_GetRenderTaskList(stageCPtr), true);
1303             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1304             return ret;
1305         }
1306
1307         /// <summary>
1308         /// Queries the number of on-window layers.
1309         /// </summary>
1310         /// <returns>The number of layers.</returns>
1311         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1312         internal uint GetLayerCount()
1313         {
1314             if (LayersChildren == null || LayersChildren.Count < 0)
1315                 return 0;
1316
1317             return (uint) LayersChildren.Count;
1318         }
1319
1320         internal Layer GetRootLayer()
1321         {
1322             // Window.IsInstalled() is actually true only when called from event thread and
1323             // Core has been initialized, not when Stage is ready.
1324             if (_rootLayer == null && Window.IsInstalled())
1325             {
1326                 _rootLayer = new Layer(Interop.Window.GetRootLayer(swigCPtr), true);
1327                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1328                 LayersChildren?.Add(_rootLayer);
1329                 _rootLayer.SetWindow(this);
1330             }
1331             return _rootLayer;
1332         }
1333
1334         internal void SetBackgroundColor(Vector4 color)
1335         {
1336             Interop.Window.SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1337             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1338         }
1339
1340         internal Vector4 GetBackgroundColor()
1341         {
1342             Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(swigCPtr), true);
1343             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1344             return ret;
1345         }
1346
1347         internal Vector2 GetDpi()
1348         {
1349             Vector2 ret = new Vector2(Interop.Stage.Stage_GetDpi(stageCPtr), true);
1350             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1351             return ret;
1352         }
1353
1354         internal ObjectRegistry GetObjectRegistry()
1355         {
1356             ObjectRegistry ret = new ObjectRegistry(Interop.Stage.Stage_GetObjectRegistry(stageCPtr), true);
1357             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1358             return ret;
1359         }
1360
1361         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1362         {
1363             Interop.Stage.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1364             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1365         }
1366
1367         internal RenderingBehaviorType GetRenderingBehavior()
1368         {
1369             RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.Stage_GetRenderingBehavior(stageCPtr);
1370             if (NDalicPINVOKE.SWIGPendingException.Pending)
1371                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1372             return ret;
1373         }
1374
1375         internal KeyEventSignal KeyEventSignal()
1376         {
1377             KeyEventSignal ret = new KeyEventSignal(Interop.Window.KeyEventSignal(swigCPtr), false);
1378             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1379             return ret;
1380         }
1381
1382         internal VoidSignal EventProcessingFinishedSignal()
1383         {
1384             VoidSignal ret = new VoidSignal(Interop.StageSignal.Stage_EventProcessingFinishedSignal(stageCPtr), false);
1385             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1386             return ret;
1387         }
1388
1389         internal TouchSignal TouchSignal()
1390         {
1391             TouchSignal ret = new TouchSignal(Interop.Window.TouchSignal(swigCPtr), false);
1392             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1393             return ret;
1394         }
1395
1396         internal TouchDataSignal TouchDataSignal()
1397         {
1398             TouchDataSignal ret = new TouchDataSignal(Interop.ActorSignal.Actor_TouchSignal(Layer.getCPtr(GetRootLayer())), false);
1399             if (NDalicPINVOKE.SWIGPendingException.Pending)
1400                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1401             return ret;
1402         }
1403
1404         internal VoidSignal ContextLostSignal()
1405         {
1406             VoidSignal ret = new VoidSignal(Interop.StageSignal.Stage_ContextLostSignal(stageCPtr), false);
1407             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1408             return ret;
1409         }
1410
1411         internal VoidSignal ContextRegainedSignal()
1412         {
1413             VoidSignal ret = new VoidSignal(Interop.StageSignal.Stage_ContextRegainedSignal(stageCPtr), false);
1414             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1415             return ret;
1416         }
1417
1418         internal VoidSignal SceneCreatedSignal()
1419         {
1420             VoidSignal ret = new VoidSignal(Interop.StageSignal.Stage_SceneCreatedSignal(stageCPtr), false);
1421             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1422             return ret;
1423         }
1424
1425         internal ResizedSignal ResizedSignal()
1426         {
1427             ResizedSignal ret = new ResizedSignal(Interop.Window.Window_ResizedSignal(swigCPtr), false);
1428             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1429             return ret;
1430         }
1431
1432         internal void SetWindowSize(Size2D size)
1433         {
1434             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1435             Interop.Window.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1436
1437             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1438
1439             // Resetting Window size should request a relayout of the tree.
1440         }
1441
1442         internal Size2D GetWindowSize()
1443         {
1444             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1445             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1446
1447             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1448             return ret;
1449         }
1450
1451         internal void SetPosition(Position2D position)
1452         {
1453             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1454             Interop.Window.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1455
1456             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1457
1458             // Setting Position of the window should request a relayout of the tree.
1459
1460         }
1461
1462         internal Position2D GetPosition()
1463         {
1464             var val = new Uint16Pair(Interop.Window.GetPosition(swigCPtr), true);
1465             Position2D ret = new Position2D(val.GetX(), val.GetY());
1466
1467             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1468             return ret;
1469         }
1470
1471         internal void SetPositionSize(Rectangle positionSize)
1472         {
1473             Interop.Window.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
1474
1475             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1476
1477             // Setting Position of the window should request a relayout of the tree.
1478
1479         }
1480
1481         /// <summary>
1482         /// Sets whether the window is transparent or not.
1483         /// </summary>
1484         /// <param name="transparent">Whether the window is transparent or not.</param>
1485         /// <since_tizen> 5 </since_tizen>
1486         public void SetTransparency(bool transparent) {
1487             Interop.Window.SetTransparency(swigCPtr, transparent);
1488             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1489
1490             // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
1491
1492         }
1493
1494         /// <summary>
1495         /// Sets parent window of the window.
1496         /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1497         /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
1498         /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
1499         /// </summary>
1500         /// <param name="parent">The parent window.</param>
1501         /// <since_tizen> 6 </since_tizen>
1502         public void SetParent(Window parent) {
1503             Interop.Window.SetParent(swigCPtr, Window.getCPtr(parent));
1504             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1505         }
1506
1507         /// <summary>
1508         /// Unsets parent window of the window.
1509         /// After unsetting, the window is disconnected his parent window.
1510         /// </summary>
1511         /// <since_tizen> 6 </since_tizen>
1512         public void Unparent() {
1513             Interop.Window.Unparent(swigCPtr);
1514             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1515         }
1516
1517         /// <summary>
1518         /// Gets parent window of the window.
1519         /// </summary>
1520         /// <returns>The parent window of the window.</returns>
1521         /// <since_tizen> 6 </since_tizen>
1522         public Window GetParent() {
1523             Window ret = new Window(Interop.Window.GetParent(swigCPtr), true);
1524             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1525             return ret;
1526         }
1527
1528         /// <summary>
1529         /// Dispose for Window
1530         /// </summary>
1531         [EditorBrowsable(EditorBrowsableState.Never)]
1532         protected override void Dispose(DisposeTypes type)
1533         {
1534             if (disposed)
1535             {
1536                 return;
1537             }
1538
1539             if (type == DisposeTypes.Explicit)
1540             {
1541                 //Called by User
1542                 //Release your own managed resources here.
1543                 //You should release all of your own disposable objects here.
1544
1545                 _rootLayer.Dispose();
1546                 localController.Dispose();
1547
1548                 foreach(var layer in _childLayers)
1549                 {
1550                     layer.Dispose();
1551                 }
1552                 _childLayers.Clear();
1553             }
1554
1555             this.DisconnectNativeSignals();
1556
1557             //Release your own unmanaged resources here.
1558             //You should not access any managed member here except static instance.
1559             //because the execution order of Finalizes is non-deterministic.
1560
1561             if (swigCPtr.Handle != global::System.IntPtr.Zero)
1562             {
1563                 if (swigCMemOwn)
1564                 {
1565                     swigCMemOwn = false;
1566                     Interop.Window.delete_Window(swigCPtr);
1567                 }
1568                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1569             }
1570
1571             base.Dispose(type);
1572         }
1573
1574         internal System.IntPtr GetNativeWindowHandler()
1575         {
1576             System.IntPtr ret = Interop.Window.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
1577             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1578             return ret;
1579         }
1580
1581         private void OnWindowFocusedChanged(bool focusGained)
1582         {
1583             FocusChangedEventArgs e = new FocusChangedEventArgs();
1584
1585             e.FocusGained = focusGained;
1586
1587             if (_windowFocusChangedEventHandler != null)
1588             {
1589                 _windowFocusChangedEventHandler(this, e);
1590             }
1591         }
1592
1593         private StageWheelSignal WheelEventSignal()
1594         {
1595             StageWheelSignal ret = new StageWheelSignal(Interop.StageSignal.Stage_WheelEventSignal(stageCPtr), false);
1596             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1597             return ret;
1598         }
1599
1600         private WheelSignal StageWheelEventSignal()
1601         {
1602             WheelSignal ret = new WheelSignal(Interop.ActorSignal.Actor_WheelEventSignal(Layer.getCPtr(this.GetRootLayer())), false);
1603             if (NDalicPINVOKE.SWIGPendingException.Pending)
1604                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1605             return ret;
1606         }
1607
1608         private bool OnWindowTouch(IntPtr view, IntPtr touchData)
1609         {
1610             if (touchData == global::System.IntPtr.Zero)
1611             {
1612                 NUILog.Error("touchData should not be null!");
1613                 return false;
1614             }
1615
1616             TouchEventArgs e = new TouchEventArgs();
1617
1618             e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
1619
1620             if (_rootLayerTouchDataEventHandler != null)
1621             {
1622                 _rootLayerTouchDataEventHandler(this, e);
1623             }
1624             return false;
1625         }
1626
1627         private bool OnStageWheel(IntPtr rootLayer, IntPtr wheelEvent)
1628         {
1629             if (wheelEvent == global::System.IntPtr.Zero)
1630             {
1631                 NUILog.Error("wheelEvent should not be null!");
1632                 return true;
1633             }
1634
1635             WheelEventArgs e = new WheelEventArgs();
1636
1637             e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
1638
1639             if (_stageWheelHandler != null)
1640             {
1641                 _stageWheelHandler(this, e);
1642             }
1643             return true;
1644         }
1645
1646         // Callback for Stage KeyEventsignal
1647         private void OnStageKey(IntPtr data)
1648         {
1649             KeyEventArgs e = new KeyEventArgs();
1650             e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1651
1652
1653             if (_stageKeyHandler != null)
1654             {
1655                 //here we send all data to user event handlers
1656                 _stageKeyHandler(this, e);
1657             }
1658         }
1659
1660         // Callback for Stage EventProcessingFinishedSignal
1661         private void OnEventProcessingFinished()
1662         {
1663             if (_stageEventProcessingFinishedEventHandler != null)
1664             {
1665                 _stageEventProcessingFinishedEventHandler(this, null);
1666             }
1667         }
1668
1669         // Callback for Stage ContextLostSignal
1670         private void OnContextLost()
1671         {
1672             if (_stageContextLostEventHandler != null)
1673             {
1674                 _stageContextLostEventHandler(this, null);
1675             }
1676         }
1677
1678         // Callback for Stage ContextRegainedSignal
1679         private void OnContextRegained()
1680         {
1681             if (_stageContextRegainedEventHandler != null)
1682             {
1683                 _stageContextRegainedEventHandler(this, null);
1684             }
1685         }
1686
1687         // Callback for Stage SceneCreatedSignal
1688         private void OnSceneCreated()
1689         {
1690             if (_stageSceneCreatedEventHandler != null)
1691             {
1692                 _stageSceneCreatedEventHandler(this, null);
1693             }
1694         }
1695
1696         private void OnResized(IntPtr windowSize)
1697         {
1698             ResizedEventArgs e = new ResizedEventArgs();
1699             var val = new Uint16Pair(windowSize, false);
1700             e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
1701             val.Dispose();
1702
1703             if (_windowResizedEventHandler != null)
1704             {
1705                 _windowResizedEventHandler(this, e);
1706             }
1707         }
1708
1709         private void OnWindowFocusedChanged2(bool focusGained)
1710         {
1711             FocusChangedEventArgs e = new FocusChangedEventArgs();
1712
1713             e.FocusGained = focusGained;
1714
1715             if (_windowFocusChangedEventHandler2 != null)
1716             {
1717                 _windowFocusChangedEventHandler2(this, e);
1718             }
1719         }
1720
1721         /// <summary>
1722         /// The focus changed event argument.
1723         /// </summary>
1724         /// <since_tizen> 3 </since_tizen>
1725         public class FocusChangedEventArgs : EventArgs
1726         {
1727             /// <summary>
1728             /// FocusGained flag.
1729             /// </summary>
1730             /// <since_tizen> 3 </since_tizen>
1731             public bool FocusGained
1732             {
1733                 get;
1734                 set;
1735             }
1736         }
1737
1738         /// <summary>
1739         /// The touch event argument.
1740         /// </summary>
1741         /// <since_tizen> 3 </since_tizen>
1742         public class TouchEventArgs : EventArgs
1743         {
1744             private Touch _touch;
1745
1746             /// <summary>
1747             /// Touch.
1748             /// </summary>
1749             /// <since_tizen> 3 </since_tizen>
1750             public Touch Touch
1751             {
1752                 get
1753                 {
1754                     return _touch;
1755                 }
1756                 set
1757                 {
1758                     _touch = value;
1759                 }
1760             }
1761         }
1762
1763         /// <summary>
1764         /// Wheel event arguments.
1765         /// </summary>
1766         /// <since_tizen> 3 </since_tizen>
1767         public class WheelEventArgs : EventArgs
1768         {
1769             private Wheel _wheel;
1770
1771             /// <summary>
1772             /// Wheel.
1773             /// </summary>
1774             /// <since_tizen> 3 </since_tizen>
1775             public Wheel Wheel
1776             {
1777                 get
1778                 {
1779                     return _wheel;
1780                 }
1781                 set
1782                 {
1783                     _wheel = value;
1784                 }
1785             }
1786         }
1787
1788         /// <summary>
1789         /// Key event arguments.
1790         /// </summary>
1791         /// <since_tizen> 3 </since_tizen>
1792         public class KeyEventArgs : EventArgs
1793         {
1794             private Key _key;
1795
1796             /// <summary>
1797             /// Key.
1798             /// </summary>
1799             /// <since_tizen> 3 </since_tizen>
1800             public Key Key
1801             {
1802                 get
1803                 {
1804                     return _key;
1805                 }
1806                 set
1807                 {
1808                     _key = value;
1809                 }
1810             }
1811         }
1812
1813         /// <summary>
1814         /// Sets position and size of the window. This API guarantees that
1815         /// both moving and resizing of window will appear on the screen at once.
1816         /// </summary>
1817         [EditorBrowsable(EditorBrowsableState.Never)]
1818         public Rectangle WindowPositionSize
1819         {
1820             get
1821             {
1822                 Position2D position = GetPosition();
1823                 Size2D size = GetSize();
1824                 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
1825                 return ret;
1826             }
1827             set
1828             {
1829                 SetPositionSize(value);
1830             }
1831         }
1832
1833         /// <summary>
1834         /// Feeds a key event into the window.
1835         /// This resized event arguments.
1836         /// </summary>
1837         /// <since_tizen> 3 </since_tizen>
1838         public class ResizedEventArgs : EventArgs
1839         {
1840             Size2D _windowSize;
1841
1842             /// <summary>
1843             /// This window size.
1844             /// </summary>
1845             /// <since_tizen> 4 </since_tizen>
1846             public Size2D WindowSize
1847             {
1848                 get
1849                 {
1850                     return _windowSize;
1851                 }
1852                 set
1853                 {
1854                     _windowSize = value;
1855                 }
1856             }
1857         }
1858
1859         /// <summary>
1860         /// Please do not use! this will be deprecated
1861         /// </summary>
1862         /// <since_tizen> 3 </since_tizen>
1863         [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " +
1864             "Like: " +
1865             "Window.Instance.FocusChanged = OnFocusChanged; " +
1866             "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
1867         [EditorBrowsable(EditorBrowsableState.Never)]
1868         public class WindowFocusChangedEventArgs : EventArgs
1869         {
1870             /// <summary>
1871             /// Please do not use! this will be deprecated
1872             /// </summary>
1873             /// <since_tizen> 3 </since_tizen>
1874             public bool FocusGained
1875             {
1876                 get;
1877                 set;
1878             }
1879         }
1880
1881         /// <summary>
1882         /// Contains and encapsulates Native Window handle.
1883         /// </summary>
1884         /// <since_tizen> 4 </since_tizen>
1885         public class SafeNativeWindowHandle : SafeHandle
1886         {
1887             /// <summary>
1888             /// Contructor, Native window handle is set to handle.
1889             /// </summary>
1890             /// <since_tizen> 4 </since_tizen>
1891             public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
1892             {
1893                 SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
1894             }
1895             /// <summary>
1896             /// Null check if the handle is valid or not.
1897             /// </summary>
1898             /// <since_tizen> 4 </since_tizen>
1899             public override bool IsInvalid
1900             {
1901                 get
1902                 {
1903                     return this.handle == IntPtr.Zero;
1904                 }
1905             }
1906             /// <summary>
1907             /// Release handle itself.
1908             /// </summary>
1909             /// <returns>true when released successfully.</returns>
1910             /// <since_tizen> 4 </since_tizen>
1911             protected override bool ReleaseHandle()
1912             {
1913                 return true;
1914             }
1915         }
1916
1917         /// <summary>
1918         /// Disconnect all native signals
1919         /// </summary>
1920         /// <since_tizen> 5 </since_tizen>
1921         internal void DisconnectNativeSignals()
1922         {
1923             if( _windowFocusChangedEventCallback != null )
1924             {
1925                 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
1926             }
1927
1928             if( _rootLayerTouchDataCallback != null )
1929             {
1930                 TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
1931             }
1932
1933             if( _wheelEventCallback != null )
1934             {
1935                 StageWheelEventSignal().Disconnect(_wheelEventCallback);
1936             }
1937
1938             if( _stageKeyCallbackDelegate != null )
1939             {
1940                 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1941             }
1942
1943             if( _stageEventProcessingFinishedEventCallbackDelegate != null )
1944             {
1945                 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1946             }
1947
1948             if( _stageContextLostEventCallbackDelegate != null )
1949             {
1950                 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1951             }
1952
1953             if( _stageContextRegainedEventCallbackDelegate != null )
1954             {
1955                 ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1956             }
1957
1958             if( _stageSceneCreatedEventCallbackDelegate != null )
1959             {
1960                 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1961             }
1962
1963             if( _windowResizedEventCallback != null )
1964             {
1965                 ResizedSignal().Disconnect(_windowResizedEventCallback);
1966             }
1967
1968             if( _windowFocusChangedEventCallback2 != null )
1969             {
1970                 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
1971             }
1972
1973         }
1974
1975     }
1976 }