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