e27c7aaf0d760d6b38086ed5b835bc293a5da2c1
[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 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         /// <summary>
1078         /// Gets current orientation of the window.
1079         /// </summary>
1080         /// <since_tizen> 6 </since_tizen>
1081         /// <returns>The current window orientation if previously set, or none.</returns>
1082         [EditorBrowsable(EditorBrowsableState.Never)]
1083         public Window.WindowOrientation GetCurrentOrientation()
1084         {
1085             Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.Window_GetCurrentOrientation(swigCPtr);
1086             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1087             return ret;
1088         }
1089
1090         internal Any GetNativeHandle()
1091         {
1092             Any ret = new Any(Interop.WindowInternal.Window_GetNativeHandle(swigCPtr), true);
1093             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1094             return ret;
1095         }
1096
1097         internal void Add(Layer layer)
1098         {
1099             Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
1100             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1101
1102             LayersChildren?.Add(layer);
1103             layer.SetWindow(this);
1104         }
1105
1106         internal void Remove(Layer layer)
1107         {
1108             Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
1109             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1110
1111             LayersChildren?.Remove(layer);
1112             layer.SetWindow(null);
1113         }
1114
1115         internal Vector2 GetSize()
1116         {
1117             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1118             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1119             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1120             return ret;
1121         }
1122
1123         internal RenderTaskList GetRenderTaskList()
1124         {
1125             RenderTaskList ret = new RenderTaskList(Interop.Stage.Stage_GetRenderTaskList(stageCPtr), true);
1126             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1127             return ret;
1128         }
1129
1130         /// <summary>
1131         /// Queries the number of on-window layers.
1132         /// </summary>
1133         /// <returns>The number of layers.</returns>
1134         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1135         internal uint GetLayerCount()
1136         {
1137             if (LayersChildren == null || LayersChildren.Count < 0)
1138                 return 0;
1139
1140             return (uint) LayersChildren.Count;
1141         }
1142
1143         internal Layer GetRootLayer()
1144         {
1145             // Window.IsInstalled() is actually true only when called from event thread and
1146             // Core has been initialized, not when Stage is ready.
1147             if (_rootLayer == null && Window.IsInstalled())
1148             {
1149                 _rootLayer = new Layer(Interop.Window.GetRootLayer(swigCPtr), true);
1150                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1151                 LayersChildren?.Add(_rootLayer);
1152                 _rootLayer.SetWindow(this);
1153             }
1154             return _rootLayer;
1155         }
1156
1157         internal void SetBackgroundColor(Vector4 color)
1158         {
1159             Interop.Window.SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1161         }
1162
1163         internal Vector4 GetBackgroundColor()
1164         {
1165             Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(swigCPtr), true);
1166             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1167             return ret;
1168         }
1169
1170         internal Vector2 GetDpi()
1171         {
1172             Vector2 ret = new Vector2(Interop.Stage.Stage_GetDpi(stageCPtr), true);
1173             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1174             return ret;
1175         }
1176
1177         internal ObjectRegistry GetObjectRegistry()
1178         {
1179             ObjectRegistry ret = new ObjectRegistry(Interop.Stage.Stage_GetObjectRegistry(stageCPtr), true);
1180             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1181             return ret;
1182         }
1183
1184         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1185         {
1186             Interop.Stage.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1187             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1188         }
1189
1190         internal RenderingBehaviorType GetRenderingBehavior()
1191         {
1192             RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.Stage_GetRenderingBehavior(stageCPtr);
1193             if (NDalicPINVOKE.SWIGPendingException.Pending)
1194                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1195             return ret;
1196         }
1197
1198         internal void SetWindowSize(Size2D size)
1199         {
1200             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1201             Interop.Window.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1202
1203             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1204
1205             // Resetting Window size should request a relayout of the tree.
1206         }
1207
1208         internal Size2D GetWindowSize()
1209         {
1210             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1211             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1212
1213             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1214             return ret;
1215         }
1216
1217         internal void SetPosition(Position2D position)
1218         {
1219             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1220             Interop.Window.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1221
1222             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1223             // Setting Position of the window should request a relayout of the tree.
1224         }
1225
1226         internal Position2D GetPosition()
1227         {
1228             var val = new Uint16Pair(Interop.Window.GetPosition(swigCPtr), true);
1229             Position2D ret = new Position2D(val.GetX(), val.GetY());
1230
1231             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1232             return ret;
1233         }
1234
1235         internal void SetPositionSize(Rectangle positionSize)
1236         {
1237             Interop.Window.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
1238
1239             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1240
1241             // Setting Position of the window should request a relayout of the tree.
1242         }
1243
1244         /// <summary>
1245         /// Dispose for Window
1246         /// </summary>
1247         [EditorBrowsable(EditorBrowsableState.Never)]
1248         protected override void Dispose(DisposeTypes type)
1249         {
1250             if (disposed)
1251             {
1252                 return;
1253             }
1254
1255             if (type == DisposeTypes.Explicit)
1256             {
1257                 //Called by User
1258                 //Release your own managed resources here.
1259                 //You should release all of your own disposable objects here.
1260
1261                 _rootLayer.Dispose();
1262                 localController.Dispose();
1263
1264                 foreach(var layer in _childLayers)
1265                 {
1266                     layer.Dispose();
1267                 }
1268                 _childLayers.Clear();
1269             }
1270
1271             this.DisconnectNativeSignals();
1272
1273             base.Dispose(type);
1274         }
1275
1276         /// This will not be public opened.
1277         [EditorBrowsable(EditorBrowsableState.Never)]
1278         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1279         {
1280             Interop.Window.delete_Window(swigCPtr);
1281         }
1282     }
1283 }