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