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