[NUI] Add NoOrientationPreference (#1219)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.ComponentModel;
19 using System.Collections.Generic;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.BaseComponents;
22
23 namespace Tizen.NUI
24 {
25     /// <summary>
26     /// The window class is used internally for drawing.<br />
27     /// The window has an orientation and indicator properties.<br />
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public partial class Window : BaseHandle
31     {
32         private static readonly Window instance = Application.Instance?.GetWindow();
33         private global::System.Runtime.InteropServices.HandleRef stageCPtr;
34         private Layer _rootLayer;
35         private string _windowTitle;
36         private List<Layer> _childLayers = new List<Layer>();
37         private LayoutController localController;
38
39         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Window.Window_SWIGUpcast(cPtr), cMemoryOwn)
40         {
41             if (Interop.Stage.Stage_IsInstalled())
42             {
43                 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.Stage_GetCurrent());
44
45                 localController = new LayoutController(this);
46                 NUILog.Debug("layoutController id:" + localController.GetId() );
47             }
48         }
49                 
50         /// <summary>
51         /// Creates a new Window.<br />
52         /// This creates an extra window in addition to the default main window<br />
53         /// </summary>
54         /// <param name="windowPosition">The position and size of the Window.</param>
55         /// <param name="isTranslucent">Whether Window is translucent.</param>
56         /// <returns>A new Window.</returns>
57         /// <since_tizen> 6 </since_tizen>
58         public Window(Rectangle windowPosition = null , bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
59         {
60             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61         }
62
63         /// <summary>
64         /// Creates a new Window with a specific name.<br />
65         /// This creates an extra window in addition to the default main window<br />
66         /// </summary>
67         /// <param name="name">The name for extra window. </param>
68         /// <param name="windowPosition">The position and size of the Window.</param>
69         /// <param name="isTranslucent">Whether Window is translucent.</param>
70         /// <returns>A new Window.</returns>
71         /// <since_tizen> 6 </since_tizen>
72         public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
73         {
74             this._windowTitle = name;
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76         }
77
78         /// <summary>
79         /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
80         /// </summary>
81         /// <since_tizen> 3 </since_tizen>
82         public enum WindowOrientation
83         {
84             /// <summary>
85             /// Portrait orientation. The height of the display area is greater than the width.
86             /// </summary>
87             /// <since_tizen> 3 </since_tizen>
88             Portrait = 0,
89             /// <summary>
90             /// Landscape orientation. A wide view area is needed.
91             /// </summary>
92             /// <since_tizen> 3 </since_tizen>
93             Landscape = 90,
94             /// <summary>
95             /// Portrait inverse orientation.
96             /// </summary>
97             /// <since_tizen> 3 </since_tizen>
98             PortraitInverse = 180,
99             /// <summary>
100             /// Landscape inverse orientation.
101             /// </summary>
102             /// <since_tizen> 3 </since_tizen>
103             LandscapeInverse = 270,
104             /// <summary>
105             /// No orientation. It is for the preferred orientation
106             /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
107             /// It is used to unset the preferred orientation with SetPreferredOrientation.
108             /// </summary>
109             [EditorBrowsable(EditorBrowsableState.Never)]
110             NoOrientationPreference = -1
111         }
112
113         /// <summary>
114         /// Enumeration for the key grab mode for platform-level APIs.
115         /// </summary>
116         /// <since_tizen> 3 </since_tizen>
117         public enum KeyGrabMode
118         {
119             /// <summary>
120             /// Grabs a key only when on the top of the grabbing-window stack mode.
121             /// </summary>
122             Topmost = 0,
123             /// <summary>
124             /// Grabs a key together with the other client window(s) mode.
125             /// </summary>
126             Shared,
127             /// <summary>
128             /// 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.
129             /// </summary>
130             OverrideExclusive,
131             /// <summary>
132             /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
133             /// </summary>
134             Exclusive
135         };
136
137         /// <summary>
138         /// Enumeration for transition effect's state.
139         /// </summary>
140         [EditorBrowsable(EditorBrowsableState.Never)]
141         public enum EffectStates
142         {
143             /// <summary>
144             /// None state.
145             /// </summary>
146             [EditorBrowsable(EditorBrowsableState.Never)]
147             None = 0,
148             /// <summary>
149             /// Transition effect is started.
150             /// </summary>
151             [EditorBrowsable(EditorBrowsableState.Never)]
152             Start,
153             /// <summary>
154             /// Transition effect is ended.
155             /// </summary>
156             [EditorBrowsable(EditorBrowsableState.Never)]
157             End,
158         }
159
160         /// <summary>
161         /// Enumeration for transition effect's type.
162         /// </summary>
163         [EditorBrowsable(EditorBrowsableState.Never)]
164         public enum EffectTypes
165         {
166             /// <summary>
167             /// None type.
168             /// </summary>
169             [EditorBrowsable(EditorBrowsableState.Never)]
170             None = 0,
171             /// <summary>
172             /// Window show effect.
173             /// </summary>
174             [EditorBrowsable(EditorBrowsableState.Never)]
175             Show,
176             /// <summary>
177             /// Window hide effect.
178             /// </summary>
179             [EditorBrowsable(EditorBrowsableState.Never)]
180             Hide,
181         }
182
183         /// <summary>
184         /// Enumeration for opacity of the indicator.
185         /// </summary>
186         internal enum IndicatorBackgroundOpacity
187         {
188             Opaque = 100,
189             Translucent = 50,
190             Transparent = 0
191         }
192
193         /// <summary>
194         /// Enumeration for visible mode of the indicator.
195         /// </summary>
196         internal enum IndicatorVisibleMode
197         {
198             Invisible = 0,
199             Visible = 1,
200             Auto = 2
201         }
202
203         /// <summary>
204         /// The stage instance property (read-only).<br />
205         /// Gets the current window.<br />
206         /// </summary>
207         /// <since_tizen> 3 </since_tizen>
208         public static Window Instance
209         {
210             get
211             {
212                 return instance;
213             }
214         }
215
216         /// <summary>
217         /// Get Resource ID of window
218         /// </summary>
219         internal int ResourceID
220         {
221             get
222             {
223                 int ret = Interop.Window.GetResouceID(swigCPtr);
224                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225                 return ret;
226             }
227         }
228
229         /// <summary>
230         /// Gets or sets a window type.
231         /// </summary>
232         /// <since_tizen> 3 </since_tizen>
233         public WindowType Type
234         {
235             get
236             {
237                 WindowType ret = (WindowType)Interop.Window.GetType(swigCPtr);
238                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239                 return ret;
240             }
241             set
242             {
243                 Interop.Window.SetType(swigCPtr, (int)value);
244                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245             }
246         }
247
248         /// <summary>
249         /// Gets/Sets a window title.
250         /// </summary>
251         /// <since_tizen> 4 </since_tizen>
252         public string Title
253         {
254             get
255             {
256                 return _windowTitle;
257             }
258             set
259             {
260                 _windowTitle = value;
261                 SetClass(_windowTitle, "");
262             }
263         }
264
265         /// <summary>
266         /// The rendering behavior of a Window.
267         /// </summary>
268         /// <since_tizen> 5 </since_tizen>
269         public RenderingBehaviorType RenderingBehavior
270         {
271             get
272             {
273                 return GetRenderingBehavior();
274             }
275             set
276             {
277                 SetRenderingBehavior(value);
278             }
279         }
280
281         /// <summary>
282         /// The window size property (read-only).
283         /// </summary>
284         /// <since_tizen> 3 </since_tizen>
285         public Size2D Size
286         {
287             get
288             {
289                 Size2D ret = GetSize();
290                 return ret;
291             }
292         }
293
294         /// <summary>
295         /// The background color property.
296         /// </summary>
297         /// <since_tizen> 3 </since_tizen>
298         public Color BackgroundColor
299         {
300             set
301             {
302                 SetBackgroundColor(value);
303             }
304             get
305             {
306                 Color ret = GetBackgroundColor();
307                 return ret;
308             }
309         }
310
311         /// <summary>
312         /// The DPI property (read-only).<br />
313         /// Retrieves the DPI of the display device to which the Window is connected.<br />
314         /// </summary>
315         /// <since_tizen> 3 </since_tizen>
316         public Vector2 Dpi
317         {
318             get
319             {
320                 return GetDpi();
321             }
322         }
323
324         /// <summary>
325         /// The layer count property (read-only).<br />
326         /// Queries the number of on-Window layers.<br />
327         /// </summary>
328         /// <since_tizen> 3 </since_tizen>
329         public uint LayerCount
330         {
331             get
332             {
333                 return GetLayerCount();
334             }
335         }
336
337         /// <summary>
338         /// Gets or sets a size of the window.
339         /// </summary>
340         /// <since_tizen> 4 </since_tizen>
341         public Size2D WindowSize
342         {
343             get
344             {
345                 return GetWindowSize();
346             }
347             set
348             {
349                 SetWindowSize(value);
350             }
351         }
352
353         /// <summary>
354         /// Gets or sets a position of the window.
355         /// </summary>
356         /// <since_tizen> 4 </since_tizen>
357         public Position2D WindowPosition
358         {
359             get
360             {
361                 return GetPosition();
362             }
363             set
364             {
365                 SetPosition(value);
366             }
367         }
368
369         /// <summary>
370         /// Sets position and size of the window. This API guarantees that
371         /// both moving and resizing of window will appear on the screen at once.
372         /// </summary>
373         [EditorBrowsable(EditorBrowsableState.Never)]
374         public Rectangle WindowPositionSize
375         {
376             get
377             {
378                 Position2D position = GetPosition();
379                 Size2D size = GetSize();
380                 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
381                 return ret;
382             }
383             set
384             {
385                 SetPositionSize(value);
386             }
387         }
388
389         internal static Vector4 DEFAULT_BACKGROUND_COLOR
390         {
391             get
392             {
393                 global::System.IntPtr cPtr = Interop.Stage.Stage_DEFAULT_BACKGROUND_COLOR_get();
394                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
395                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
396                 return ret;
397             }
398         }
399
400         internal static Vector4 DEBUG_BACKGROUND_COLOR
401         {
402             get
403             {
404                 global::System.IntPtr cPtr = Interop.Stage.Stage_DEBUG_BACKGROUND_COLOR_get();
405                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
406                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
407                 return ret;
408             }
409         }
410
411         internal List<Layer> LayersChildren
412         {
413             get
414             {
415                 return _childLayers;
416             }
417         }
418
419         /// <summary>
420         ///  Get the LayoutController for this Window.
421         /// </summary>
422         internal LayoutController LayoutController
423         {
424             get
425             {
426                 return localController;
427             }
428         }
429
430         /// <summary>
431         /// Feed a key-event into the window.
432         /// </summary>
433         /// <param name="keyEvent">The key event to feed.</param>
434         /// <since_tizen> 4 </since_tizen>
435         [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
436         public static void FeedKeyEvent(Key keyEvent)
437         {
438             Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
439             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440         }
441
442         /// <summary>
443         /// Sets whether the window accepts a focus or not.
444         /// </summary>
445         /// <param name="accept">If a focus is accepted or not. The default is true.</param>
446         /// <since_tizen> 3 </since_tizen>
447         public void SetAcceptFocus(bool accept)
448         {
449             Interop.Window.SetAcceptFocus(swigCPtr, accept);
450             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
451         }
452
453         /// <summary>
454         /// Returns whether the window accepts a focus or not.
455         /// </summary>
456         /// <returns>True if the window accepts a focus, false otherwise.</returns>
457         /// <since_tizen> 3 </since_tizen>
458         public bool IsFocusAcceptable()
459         {
460             bool ret = Interop.Window.IsFocusAcceptable(swigCPtr);
461             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462
463             return ret;
464         }
465
466         /// <summary>
467         /// Shows the window if it is hidden.
468         /// </summary>
469         /// <since_tizen> 3 </since_tizen>
470         public void Show()
471         {
472             Interop.Window.Show(swigCPtr);
473             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
474         }
475
476         /// <summary>
477         /// Hides the window if it is showing.
478         /// </summary>
479         /// <since_tizen> 3 </since_tizen>
480         public void Hide()
481         {
482             Interop.Window.Hide(swigCPtr);
483             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
484         }
485
486         /// <summary>
487         /// Retrieves whether the window is visible or not.
488         /// </summary>
489         /// <returns>True if the window is visible.</returns>
490         /// <since_tizen> 3 </since_tizen>
491         public bool IsVisible()
492         {
493             bool temp = Interop.Window.IsVisible(swigCPtr);
494             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
495             return temp;
496         }
497
498         /// <summary>
499         /// Gets the count of supported auxiliary hints of the window.
500         /// </summary>
501         /// <returns>The number of supported auxiliary hints.</returns>
502         /// <since_tizen> 3 </since_tizen>
503         public uint GetSupportedAuxiliaryHintCount()
504         {
505             uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(swigCPtr);
506             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507             return ret;
508         }
509
510         /// <summary>
511         /// Gets the supported auxiliary hint string of the window.
512         /// </summary>
513         /// <param name="index">The index of the supported auxiliary hint lists.</param>
514         /// <returns>The auxiliary hint string of the index.</returns>
515         /// <since_tizen> 3 </since_tizen>
516         public string GetSupportedAuxiliaryHint(uint index)
517         {
518             string ret = Interop.Window.GetSupportedAuxiliaryHint(swigCPtr, index);
519             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
520             return ret;
521         }
522
523         /// <summary>
524         /// Creates an auxiliary hint of the window.
525         /// </summary>
526         /// <param name="hint">The auxiliary hint string.</param>
527         /// <param name="value">The value string.</param>
528         /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
529         /// <since_tizen> 3 </since_tizen>
530         public uint AddAuxiliaryHint(string hint, string value)
531         {
532             uint ret = Interop.Window.AddAuxiliaryHint(swigCPtr, hint, value);
533             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534             return ret;
535         }
536
537         /// <summary>
538         /// Removes an auxiliary hint of the window.
539         /// </summary>
540         /// <param name="id">The ID of the auxiliary hint.</param>
541         /// <returns>True if no error occurred, false otherwise.</returns>
542         /// <since_tizen> 3 </since_tizen>
543         public bool RemoveAuxiliaryHint(uint id)
544         {
545             bool ret = Interop.Window.RemoveAuxiliaryHint(swigCPtr, id);
546             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547             return ret;
548         }
549
550         /// <summary>
551         /// Changes a value of the auxiliary hint.
552         /// </summary>
553         /// <param name="id">The auxiliary hint ID.</param>
554         /// <param name="value">The value string to be set.</param>
555         /// <returns>True if no error occurred, false otherwise.</returns>
556         /// <since_tizen> 3 </since_tizen>
557         public bool SetAuxiliaryHintValue(uint id, string value)
558         {
559             bool ret = Interop.Window.SetAuxiliaryHintValue(swigCPtr, id, value);
560             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561             return ret;
562         }
563
564         /// <summary>
565         /// Gets a value of the auxiliary hint.
566         /// </summary>
567         /// <param name="id">The auxiliary hint ID.</param>
568         /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
569         /// <since_tizen> 3 </since_tizen>
570         public string GetAuxiliaryHintValue(uint id)
571         {
572             string ret = Interop.Window.GetAuxiliaryHintValue(swigCPtr, id);
573             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574             return ret;
575         }
576
577         /// <summary>
578         /// Gets an ID of the auxiliary hint string.
579         /// </summary>
580         /// <param name="hint">The auxiliary hint string.</param>
581         /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
582         /// <since_tizen> 3 </since_tizen>
583         public uint GetAuxiliaryHintId(string hint)
584         {
585             uint ret = Interop.Window.GetAuxiliaryHintId(swigCPtr, hint);
586             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
587             return ret;
588         }
589
590         /// <summary>
591         /// Sets a region to accept input events.
592         /// </summary>
593         /// <param name="inputRegion">The region to accept input events.</param>
594         /// <since_tizen> 3 </since_tizen>
595         public void SetInputRegion(Rectangle inputRegion)
596         {
597             Interop.Window.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
598             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
599         }
600
601         /// <summary>
602         /// Sets a priority level for the specified notification window.
603         /// </summary>
604         /// <param name="level">The notification window level.</param>
605         /// <returns>True if no error occurred, false otherwise.</returns>
606         /// <since_tizen> 3 </since_tizen>
607         public bool SetNotificationLevel(NotificationLevel level)
608         {
609             bool ret = Interop.Window.SetNotificationLevel(swigCPtr, (int)level);
610             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
611             return ret;
612         }
613
614         /// <summary>
615         /// Gets a priority level for the specified notification window.
616         /// </summary>
617         /// <returns>The notification window level.</returns>
618         /// <since_tizen> 3 </since_tizen>
619         public NotificationLevel GetNotificationLevel()
620         {
621             NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(swigCPtr);
622             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623             return ret;
624         }
625
626         /// <summary>
627         /// Sets a transparent window's visual state to opaque. <br />
628         /// If a visual state of a transparent window is opaque, <br />
629         /// then the window manager could handle it as an opaque window when calculating visibility.
630         /// </summary>
631         /// <param name="opaque">Whether the window's visual state is opaque.</param>
632         /// <remarks>This will have no effect on an opaque window. <br />
633         /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
634         /// </remarks>
635         /// <since_tizen> 3 </since_tizen>
636         public void SetOpaqueState(bool opaque)
637         {
638             Interop.Window.SetOpaqueState(swigCPtr, opaque);
639             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640         }
641
642         /// <summary>
643         /// Returns whether a transparent window's visual state is opaque or not.
644         /// </summary>
645         /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
646         /// <remarks> The return value has no meaning on an opaque window. </remarks>
647         /// <since_tizen> 3 </since_tizen>
648         public bool IsOpaqueState()
649         {
650             bool ret = Interop.Window.IsOpaqueState(swigCPtr);
651             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652             return ret;
653         }
654
655         /// <summary>
656         /// Sets a window's screen off mode.
657         /// </summary>
658         /// <param name="screenOffMode">The screen mode.</param>
659         /// <returns>True if no error occurred, false otherwise.</returns>
660         /// <since_tizen> 4 </since_tizen>
661         public bool SetScreenOffMode(ScreenOffMode screenOffMode)
662         {
663             bool ret = Interop.Window.SetScreenOffMode(swigCPtr, (int)screenOffMode);
664             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
665             return ret;
666         }
667
668         /// <summary>
669         /// Gets the screen mode of the window.
670         /// </summary>
671         /// <returns>The screen off mode.</returns>
672         /// <since_tizen> 4 </since_tizen>
673         public ScreenOffMode GetScreenOffMode()
674         {
675             ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(swigCPtr);
676             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
677             return ret;
678         }
679
680         /// <summary>
681         /// Sets preferred brightness of the window.
682         /// </summary>
683         /// <param name="brightness">The preferred brightness (0 to 100).</param>
684         /// <returns>True if no error occurred, false otherwise.</returns>
685         /// <since_tizen> 3 </since_tizen>
686         public bool SetBrightness(int brightness)
687         {
688             bool ret = Interop.Window.SetBrightness(swigCPtr, brightness);
689             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690             return ret;
691         }
692
693         /// <summary>
694         /// Gets the preferred brightness of the window.
695         /// </summary>
696         /// <returns>The preferred brightness.</returns>
697         /// <since_tizen> 3 </since_tizen>
698         public int GetBrightness()
699         {
700             int ret = Interop.Window.GetBrightness(swigCPtr);
701             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702             return ret;
703         }
704
705         /// <summary>
706         /// Sets the window name and the class string.
707         /// </summary>
708         /// <param name="name">The name of the window.</param>
709         /// <param name="klass">The class of the window.</param>
710         /// <since_tizen> 4 </since_tizen>
711         public void SetClass(string name, string klass)
712         {
713             Interop.Window.Window_SetClass(swigCPtr, name, klass);
714             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
715         }
716
717         /// <summary>
718         /// Raises the window to the top of the window stack.
719         /// </summary>
720         /// <since_tizen> 3 </since_tizen>
721         public void Raise()
722         {
723             Interop.Window.Window_Raise(swigCPtr);
724             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
725         }
726
727         /// <summary>
728         /// Lowers the window to the bottom of the window stack.
729         /// </summary>
730         /// <since_tizen> 3 </since_tizen>
731         public void Lower()
732         {
733             Interop.Window.Window_Lower(swigCPtr);
734             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735         }
736
737         /// <summary>
738         /// Activates the window to the top of the window stack even it is iconified.
739         /// </summary>
740         /// <since_tizen> 3 </since_tizen>
741         public void Activate()
742         {
743             Interop.Window.Window_Activate(swigCPtr);
744             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745         }
746
747         /// <summary>
748         /// Gets the default ( root ) layer.
749         /// </summary>
750         /// <returns>The root layer.</returns>
751         /// <since_tizen> 3 </since_tizen>
752         public Layer GetDefaultLayer()
753         {
754             return this.GetRootLayer();
755         }
756
757         /// <summary>
758         /// Add a child view to window.
759         /// </summary>
760         /// <param name="view">the child should be added to the window.</param>
761         /// <since_tizen> 3 </since_tizen>
762         public void Add(View view)
763         {
764             Interop.Actor.Actor_Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
765             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
766             this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
767             view.InternalParent = this.GetRootLayer();
768         }
769
770         /// <summary>
771         /// Remove a child view from window.
772         /// </summary>
773         /// <param name="view">the child to be removed.</param>
774         /// <since_tizen> 3 </since_tizen>
775         public void Remove(View view)
776         {
777             Interop.Actor.Actor_Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
778             this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
779             view.InternalParent = null;
780         }
781
782         /// <summary>
783         /// Retrieves the layer at a specified depth.
784         /// </summary>
785         /// <param name="depth">The layer's depth index.</param>
786         /// <returns>The layer found at the given depth.</returns>
787         /// <since_tizen> 3 </since_tizen>
788         public Layer GetLayer(uint depth)
789         {
790             if (depth < LayersChildren?.Count)
791             {
792                 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
793                 return ret;
794             }
795             else
796             {
797                 return null;
798             }
799         }
800
801         /// <summary>
802         /// Destroy the window immediately.
803         /// </summary>
804         [EditorBrowsable(EditorBrowsableState.Never)]
805         public void Destroy()
806         {
807             this.Dispose();
808         }
809
810         /// <summary>
811         /// Keep rendering for at least the given amount of time.
812         /// </summary>
813         /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
814         /// <since_tizen> 3 </since_tizen>
815         public void KeepRendering(float durationSeconds)
816         {
817             Interop.Stage.Stage_KeepRendering(stageCPtr, durationSeconds);
818             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
819         }
820
821         /// <summary>
822         /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
823         /// This function can be used for following example scenarios: <br />
824         /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
825         /// </summary>
826         /// <param name="DaliKey">The key code to grab.</param>
827         /// <returns>True if the grab succeeds.</returns>
828         /// <since_tizen> 3 </since_tizen>
829         public bool GrabKeyTopmost(int DaliKey)
830         {
831             bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
832             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833             return ret;
834         }
835
836         /// <summary>
837         /// Ungrabs the key specified by a key for the window.<br />
838         /// 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 />
839         /// </summary>
840         /// <param name="DaliKey">The key code to ungrab.</param>
841         /// <returns>True if the ungrab succeeds.</returns>
842         /// <since_tizen> 3 </since_tizen>
843         public bool UngrabKeyTopmost(int DaliKey)
844         {
845             bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
846             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
847             return ret;
848         }
849
850         /// <summary>
851         ///  Grabs the key specified by a key for a window in a GrabMode. <br />
852         ///  Details: This function can be used for following example scenarios: <br />
853         ///  - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
854         ///  - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
855         ///  - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
856         /// </summary>
857         /// <param name="DaliKey">The key code to grab.</param>
858         /// <param name="GrabMode">The grab mode for the key.</param>
859         /// <returns>True if the grab succeeds.</returns>
860         /// <since_tizen> 3 </since_tizen>
861         public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
862         {
863             bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
864             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
865             return ret;
866         }
867
868         /// <summary>
869         /// Ungrabs the key specified by a key for a window.<br />
870         /// 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 />
871         /// </summary>
872         /// <param name="DaliKey">The key code to ungrab.</param>
873         /// <returns>True if the ungrab succeeds.</returns>
874         /// <since_tizen> 3 </since_tizen>
875         public bool UngrabKey(int DaliKey)
876         {
877             bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
878             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
879             return ret;
880         }
881
882         /// <summary>
883         /// Sets the keyboard repeat information.
884         /// </summary>
885         /// <param name="rate">The key repeat rate value in seconds.</param>
886         /// <param name="delay">The key repeat delay value in seconds.</param>
887         /// <returns>True if setting the keyboard repeat succeeds.</returns>
888         /// <since_tizen> 5 </since_tizen>
889         public bool SetKeyboardRepeatInfo(float rate, float delay)
890         {
891             bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
892             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
893             return ret;
894         }
895
896         /// <summary>
897         /// Gets the keyboard repeat information.
898         /// </summary>
899         /// <param name="rate">The key repeat rate value in seconds.</param>
900         /// <param name="delay">The key repeat delay value in seconds.</param>
901         /// <returns>True if setting the keyboard repeat succeeds.</returns>
902         /// <since_tizen> 5 </since_tizen>
903         public bool GetKeyboardRepeatInfo(out float rate, out float delay)
904         {
905             bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
906             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907             return ret;
908         }
909
910         /// <summary>
911         /// Adds a layer to the stage.
912         /// </summary>
913         /// <param name="layer">Layer to add.</param>
914         /// <since_tizen> 3 </since_tizen>
915         public void AddLayer(Layer layer)
916         {
917             Add(layer);
918         }
919
920         /// <summary>
921         /// Removes a layer from the stage.
922         /// </summary>
923         /// <param name="layer">Layer to remove.</param>
924         /// <since_tizen> 3 </since_tizen>
925         public void RemoveLayer(Layer layer)
926         {
927             Remove(layer);
928         }
929
930         /// <summary>
931         /// Feeds a key event into the window.
932         /// </summary>
933         /// <param name="keyEvent">The key event to feed.</param>
934         /// <since_tizen> 5 </since_tizen>
935         public void FeedKey(Key keyEvent)
936         {
937             Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
938             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
939         }
940
941         /// <summary>
942         /// Allows at least one more render, even when paused.
943         /// The window should be shown, not minimised.
944         /// </summary>
945         /// <since_tizen> 4 </since_tizen>
946         public void RenderOnce()
947         {
948             Interop.Window.Window_RenderOnce(swigCPtr);
949             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
950         }
951
952         /// <summary>
953         /// Sets whether the window is transparent or not.
954         /// </summary>
955         /// <param name="transparent">Whether the window is transparent or not.</param>
956         /// <since_tizen> 5 </since_tizen>
957         public void SetTransparency(bool transparent)
958         {
959             Interop.Window.SetTransparency(swigCPtr, transparent);
960             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
961
962             // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
963         }
964
965         /// <summary>
966         /// Sets parent window of the window.
967         /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
968         /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
969         /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
970         /// </summary>
971         /// <param name="parent">The parent window.</param>
972         /// <since_tizen> 6 </since_tizen>
973         public void SetParent(Window parent)
974         {
975             Interop.Window.SetParent(swigCPtr, Window.getCPtr(parent));
976             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
977         }
978
979         /// <summary>
980         /// Unsets parent window of the window.
981         /// After unsetting, the window is disconnected his parent window.
982         /// </summary>
983         /// <since_tizen> 6 </since_tizen>
984         public void Unparent()
985         {
986             Interop.Window.Unparent(swigCPtr);
987             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
988         }
989
990         /// <summary>
991         /// Gets parent window of the window.
992         /// </summary>
993         /// <returns>The parent window of the window.</returns>
994         /// <since_tizen> 6 </since_tizen>
995         public Window GetParent()
996         {
997             Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.GetParent(swigCPtr)) as Window;
998             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
999             return ret;
1000         }
1001
1002         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
1003         {
1004             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1005         }
1006
1007         internal static Window GetCurrent()
1008         {
1009             Window ret = new Window(Interop.Stage.Stage_GetCurrent(), true);
1010             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1011             return ret;
1012         }
1013
1014         internal static bool IsInstalled()
1015         {
1016             bool ret = Interop.Stage.Stage_IsInstalled();
1017             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1018             return ret;
1019         }
1020
1021         internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
1022         {
1023             Interop.WindowInternal.Window_ShowIndicator(swigCPtr, (int)visibleMode);
1024             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1025         }
1026
1027         internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
1028         {
1029             Interop.WindowInternal.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
1030             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1031         }
1032
1033         internal void RotateIndicator(Window.WindowOrientation orientation)
1034         {
1035             Interop.WindowInternal.Window_RotateIndicator(swigCPtr, (int)orientation);
1036             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1037         }
1038
1039         /// <summary>
1040         /// Adds an orientation to the list of available orientations.
1041         /// </summary>
1042         /// <param name="orientation">The available orientation to add</param>
1043         /// <since_tizen> 6 </since_tizen>
1044         public void AddAvailableOrientation(Window.WindowOrientation orientation)
1045         {
1046             Interop.Window.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
1047             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1048         }
1049
1050         /// <summary>
1051         /// Removes an orientation from the list of available orientations.
1052         /// </summary>
1053         /// <param name="orientation">The available orientation to remove.</param>
1054         /// <since_tizen> 6 </since_tizen>
1055         public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1056         {
1057             Interop.Window.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
1058             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1059         }
1060
1061         /// <summary>
1062         /// Sets a preferred orientation.
1063         /// </summary>
1064         /// <param name="orientation">The preferred orientation.</param>
1065         /// <since_tizen> 6 </since_tizen>
1066         public void SetPreferredOrientation(Window.WindowOrientation orientation)
1067         {
1068             Interop.Window.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
1069             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1070         }
1071
1072         /// <summary>
1073         /// Gets the preferred orientation.
1074         /// </summary>
1075         /// <since_tizen> 6 </since_tizen>
1076         /// <returns>The preferred orientation if previously set, or none.</returns>
1077         public Window.WindowOrientation GetPreferredOrientation()
1078         {
1079             Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.Window_GetPreferredOrientation(swigCPtr);
1080             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1081             return ret;
1082         }
1083
1084         internal Any GetNativeHandle()
1085         {
1086             Any ret = new Any(Interop.WindowInternal.Window_GetNativeHandle(swigCPtr), true);
1087             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1088             return ret;
1089         }
1090
1091         internal void Add(Layer layer)
1092         {
1093             Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
1094             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1095
1096             LayersChildren?.Add(layer);
1097             layer.SetWindow(this);
1098         }
1099
1100         internal void Remove(Layer layer)
1101         {
1102             Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
1103             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1104
1105             LayersChildren?.Remove(layer);
1106             layer.SetWindow(null);
1107         }
1108
1109         internal Vector2 GetSize()
1110         {
1111             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1112             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1114             return ret;
1115         }
1116
1117         internal RenderTaskList GetRenderTaskList()
1118         {
1119             RenderTaskList ret = new RenderTaskList(Interop.Stage.Stage_GetRenderTaskList(stageCPtr), true);
1120             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1121             return ret;
1122         }
1123
1124         /// <summary>
1125         /// Queries the number of on-window layers.
1126         /// </summary>
1127         /// <returns>The number of layers.</returns>
1128         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1129         internal uint GetLayerCount()
1130         {
1131             if (LayersChildren == null || LayersChildren.Count < 0)
1132                 return 0;
1133
1134             return (uint) LayersChildren.Count;
1135         }
1136
1137         internal Layer GetRootLayer()
1138         {
1139             // Window.IsInstalled() is actually true only when called from event thread and
1140             // Core has been initialized, not when Stage is ready.
1141             if (_rootLayer == null && Window.IsInstalled())
1142             {
1143                 _rootLayer = new Layer(Interop.Window.GetRootLayer(swigCPtr), true);
1144                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1145                 LayersChildren?.Add(_rootLayer);
1146                 _rootLayer.SetWindow(this);
1147             }
1148             return _rootLayer;
1149         }
1150
1151         internal void SetBackgroundColor(Vector4 color)
1152         {
1153             Interop.Window.SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1154             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1155         }
1156
1157         internal Vector4 GetBackgroundColor()
1158         {
1159             Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(swigCPtr), true);
1160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1161             return ret;
1162         }
1163
1164         internal Vector2 GetDpi()
1165         {
1166             Vector2 ret = new Vector2(Interop.Stage.Stage_GetDpi(stageCPtr), true);
1167             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1168             return ret;
1169         }
1170
1171         internal ObjectRegistry GetObjectRegistry()
1172         {
1173             ObjectRegistry ret = new ObjectRegistry(Interop.Stage.Stage_GetObjectRegistry(stageCPtr), true);
1174             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1175             return ret;
1176         }
1177
1178         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1179         {
1180             Interop.Stage.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1181             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1182         }
1183
1184         internal RenderingBehaviorType GetRenderingBehavior()
1185         {
1186             RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.Stage_GetRenderingBehavior(stageCPtr);
1187             if (NDalicPINVOKE.SWIGPendingException.Pending)
1188                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1189             return ret;
1190         }
1191
1192         internal void SetWindowSize(Size2D size)
1193         {
1194             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1195             Interop.Window.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1196
1197             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1198
1199             // Resetting Window size should request a relayout of the tree.
1200         }
1201
1202         internal Size2D GetWindowSize()
1203         {
1204             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1205             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1206
1207             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1208             return ret;
1209         }
1210
1211         internal void SetPosition(Position2D position)
1212         {
1213             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1214             Interop.Window.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1215
1216             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1217             // Setting Position of the window should request a relayout of the tree.
1218         }
1219
1220         internal Position2D GetPosition()
1221         {
1222             var val = new Uint16Pair(Interop.Window.GetPosition(swigCPtr), true);
1223             Position2D ret = new Position2D(val.GetX(), val.GetY());
1224
1225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1226             return ret;
1227         }
1228
1229         internal void SetPositionSize(Rectangle positionSize)
1230         {
1231             Interop.Window.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
1232
1233             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1234
1235             // Setting Position of the window should request a relayout of the tree.
1236         }
1237
1238         /// <summary>
1239         /// Dispose for Window
1240         /// </summary>
1241         [EditorBrowsable(EditorBrowsableState.Never)]
1242         protected override void Dispose(DisposeTypes type)
1243         {
1244             if (disposed)
1245             {
1246                 return;
1247             }
1248
1249             if (type == DisposeTypes.Explicit)
1250             {
1251                 //Called by User
1252                 //Release your own managed resources here.
1253                 //You should release all of your own disposable objects here.
1254
1255                 _rootLayer.Dispose();
1256                 localController.Dispose();
1257
1258                 foreach(var layer in _childLayers)
1259                 {
1260                     layer.Dispose();
1261                 }
1262                 _childLayers.Clear();
1263             }
1264
1265             this.DisconnectNativeSignals();
1266
1267             base.Dispose(type);
1268         }
1269
1270         /// This will not be public opened.
1271         [EditorBrowsable(EditorBrowsableState.Never)]
1272         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1273         {
1274             Interop.Window.delete_Window(swigCPtr);
1275         }
1276     }
1277 }