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