[NUI] Add window Min/Max Feature
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window / Window.cs
1 /*
2  * Copyright(c) 2021 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
18 extern alias TizenSystemInformation;
19 using TizenSystemInformation.Tizen.System;
20
21 using System;
22 using System.ComponentModel;
23 using System.Collections.Generic;
24 using System.Runtime.InteropServices;
25
26 using Tizen.NUI.BaseComponents;
27
28 namespace Tizen.NUI
29 {
30     /// <summary>
31     /// The window class is used internally for drawing.<br />
32     /// The window has an orientation and indicator properties.<br />
33     /// </summary>
34     /// <since_tizen> 3 </since_tizen>
35     public partial class Window : BaseHandle
36     {
37         private HandleRef stageCPtr;
38         private Layer rootLayer;
39         private string windowTitle;
40         private List<Layer> childLayers = new List<Layer>();
41         private LayoutController localController;
42
43         static internal bool IsSupportedMultiWindow()
44         {
45             bool isSupported = false;
46             try
47             {
48                 Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSupported);
49             }
50             catch (DllNotFoundException e)
51             {
52                 Tizen.Log.Fatal("NUI", $"{e}\n");
53             }
54             return isSupported;
55         }
56
57         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
58         {
59             if (Interop.Stage.IsInstalled())
60             {
61                 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.GetCurrent());
62
63                 localController = new LayoutController(this);
64                 NUILog.Debug("layoutController id:" + localController.GetId());
65             }
66         }
67
68         /// <summary>
69         /// A helper method to get the current window where the view is added
70         /// </summary>
71         /// <param name="view">The View added to the window</param>
72         /// <returns>A Window.</returns>
73         [EditorBrowsable(EditorBrowsableState.Never)]
74         static public Window Get(View view)
75         {
76             if (view == null)
77             {
78                 NUILog.Error("if there is no view, it can not get a window");
79                 return null;
80             }
81
82             Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.Get(View.getCPtr(view))) as Window;
83             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84             return ret;
85         }
86
87         /// <summary>
88         /// Creates a new Window.<br />
89         /// This creates an extra window in addition to the default main window<br />
90         /// </summary>
91         /// <param name="windowPosition">The position and size of the Window.</param>
92         /// <param name="isTranslucent">Whether Window is translucent.</param>
93         /// <returns>A new Window.</returns>
94         /// <since_tizen> 6 </since_tizen>
95         /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
96         /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
97         public Window(Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
98         {
99             if (IsSupportedMultiWindow() == false)
100             {
101                 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
102             }
103             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104         }
105
106         /// <summary>
107         /// Creates a new Window with a specific name.<br />
108         /// This creates an extra window in addition to the default main window<br />
109         /// </summary>
110         /// <param name="name">The name for extra window. </param>
111         /// <param name="windowPosition">The position and size of the Window.</param>
112         /// <param name="isTranslucent">Whether Window is translucent.</param>
113         /// <returns>A new Window.</returns>
114         /// <since_tizen> 6 </since_tizen>
115         /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
116         /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
117         public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
118         {
119             if (IsSupportedMultiWindow() == false)
120             {
121                 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
122             }
123             this.windowTitle = name;
124             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125         }
126
127         /// <summary>
128         /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
129         /// </summary>
130         /// <since_tizen> 3 </since_tizen>
131         public enum WindowOrientation
132         {
133             /// <summary>
134             /// Portrait orientation. The height of the display area is greater than the width.
135             /// </summary>
136             /// <since_tizen> 3 </since_tizen>
137             Portrait = 0,
138             /// <summary>
139             /// Landscape orientation. A wide view area is needed.
140             /// </summary>
141             /// <since_tizen> 3 </since_tizen>
142             Landscape = 90,
143             /// <summary>
144             /// Portrait inverse orientation.
145             /// </summary>
146             /// <since_tizen> 3 </since_tizen>
147             PortraitInverse = 180,
148             /// <summary>
149             /// Landscape inverse orientation.
150             /// </summary>
151             /// <since_tizen> 3 </since_tizen>
152             LandscapeInverse = 270,
153             /// <summary>
154             /// No orientation. It is for the preferred orientation
155             /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
156             /// It is used to unset the preferred orientation with SetPreferredOrientation.
157             /// </summary>
158             [EditorBrowsable(EditorBrowsableState.Never)]
159             NoOrientationPreference = -1
160         }
161
162         /// <summary>
163         /// Enumeration for the key grab mode for platform-level APIs.
164         /// </summary>
165         /// <since_tizen> 3 </since_tizen>
166         public enum KeyGrabMode
167         {
168             /// <summary>
169             /// Grabs a key only when on the top of the grabbing-window stack mode.
170             /// </summary>
171             Topmost = 0,
172             /// <summary>
173             /// Grabs a key together with the other client window(s) mode.
174             /// </summary>
175             Shared,
176             /// <summary>
177             /// 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.
178             /// </summary>
179             OverrideExclusive,
180             /// <summary>
181             /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
182             /// </summary>
183             Exclusive
184         };
185
186         /// <summary>
187         /// Enumeration for transition effect's state.
188         /// </summary>
189         [Obsolete("Please do not use! This will be removed. Please use Window.EffectState instead!")]
190         [EditorBrowsable(EditorBrowsableState.Never)]
191         //  This is already deprecated, so suppress warning here.
192         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names", Justification = "<Pending>")]
193         public enum EffectStates
194         {
195             /// <summary>
196             /// None state.
197             /// </summary>
198             [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.None instead!")]
199             [EditorBrowsable(EditorBrowsableState.Never)]
200             None = 0,
201             /// <summary>
202             /// Transition effect is started.
203             /// </summary>
204             [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.Start instead!")]
205             [EditorBrowsable(EditorBrowsableState.Never)]
206             Start,
207             /// <summary>
208             /// Transition effect is ended.
209             /// </summary>
210             [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.End instead!")]
211             [EditorBrowsable(EditorBrowsableState.Never)]
212             End,
213         }
214
215         /// <summary>
216         /// Enumeration for transition effect's state.
217         /// </summary>
218         [EditorBrowsable(EditorBrowsableState.Never)]
219         public enum EffectState
220         {
221             /// <summary>
222             /// None state.
223             /// </summary>
224             [EditorBrowsable(EditorBrowsableState.Never)]
225             None = 0,
226             /// <summary>
227             /// Transition effect is started.
228             /// </summary>
229             [EditorBrowsable(EditorBrowsableState.Never)]
230             Start,
231             /// <summary>
232             /// Transition effect is ended.
233             /// </summary>
234             [EditorBrowsable(EditorBrowsableState.Never)]
235             End,
236         }
237
238         /// <summary>
239         /// Enumeration for transition effect's type.
240         /// </summary>
241         [Obsolete("Please do not use! This will be removed. Please use Window.EffectType instead!")]
242         [EditorBrowsable(EditorBrowsableState.Never)]
243         //  This is already deprecated, so suppress warning here.
244         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names", Justification = "<Pending>")]
245         public enum EffectTypes
246         {
247             /// <summary>
248             /// None type.
249             /// </summary>
250             [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.None instead!")]
251             [EditorBrowsable(EditorBrowsableState.Never)]
252             None = 0,
253             /// <summary>
254             /// Window show effect.
255             /// </summary>
256             [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Show instead!")]
257             [EditorBrowsable(EditorBrowsableState.Never)]
258             Show,
259             /// <summary>
260             /// Window hide effect.
261             /// </summary>
262             [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Hide instead!")]
263             [EditorBrowsable(EditorBrowsableState.Never)]
264             Hide,
265         }
266
267         /// <summary>
268         /// Enumeration for transition effect's type.
269         /// </summary>
270         [EditorBrowsable(EditorBrowsableState.Never)]
271         public enum EffectType
272         {
273             /// <summary>
274             /// None type.
275             /// </summary>
276             [EditorBrowsable(EditorBrowsableState.Never)]
277             None = 0,
278             /// <summary>
279             /// Window show effect.
280             /// </summary>
281             [EditorBrowsable(EditorBrowsableState.Never)]
282             Show,
283             /// <summary>
284             /// Window hide effect.
285             /// </summary>
286             [EditorBrowsable(EditorBrowsableState.Never)]
287             Hide,
288         }
289
290         /// <summary>
291         /// Enumeration for result of window operation.
292         /// </summary>
293         internal enum OperationResult
294         {
295             /// <summary>
296             /// Failed for unknown reason
297             /// </summary>
298             UnknownError = 0,
299             /// <summary>
300             /// Succeed
301             /// </summary>
302             Succeed,
303             /// <summary>
304             /// Permission denied
305             /// </summary>
306             PermissionDenied,
307             /// <summary>
308             /// The operation is not supported.
309             /// </summary>
310             NotSupported,
311         }
312
313         /// <summary>
314         /// Enumeration for window resized mode by display server.
315         /// </summary>
316         [EditorBrowsable(EditorBrowsableState.Never)]
317         public enum ResizeDirection
318         {
319             /// <summary>
320             /// Start resizing window to the top-left edge.
321             /// </summary>
322             [EditorBrowsable(EditorBrowsableState.Never)]
323             TopLeft = 1,
324             /// <summary>
325             /// Start resizing window to the top side.
326             /// </summary>
327             [EditorBrowsable(EditorBrowsableState.Never)]
328             Top = 2,
329             /// <summary>
330             /// Start resizing window to the top-right edge.
331             /// </summary>
332             [EditorBrowsable(EditorBrowsableState.Never)]
333             TopRight = 3,
334             /// <summary>
335             /// Start resizing window to the left side.
336             /// </summary>
337             [EditorBrowsable(EditorBrowsableState.Never)]
338             Left = 4,
339             /// <summary>
340             /// Start resizing window to the right side.
341             /// </summary>
342             [EditorBrowsable(EditorBrowsableState.Never)]
343             Right = 5,
344             /// <summary>
345             /// Start resizing window to the bottom-left edge.
346             /// </summary>
347             [EditorBrowsable(EditorBrowsableState.Never)]
348             BottomLeft = 6,
349             /// <summary>
350             /// Start resizing window to the bottom side.
351             /// </summary>
352             [EditorBrowsable(EditorBrowsableState.Never)]
353             Bottom = 7,
354             /// <summary>
355             /// Start resizing window to the bottom-right edge.
356             /// </summary>
357             [EditorBrowsable(EditorBrowsableState.Never)]
358             BottomRight = 8,
359         }
360
361
362         /// <summary>
363         /// The stage instance property (read-only).<br />
364         /// Gets the current window.<br />
365         /// </summary>
366         /// <since_tizen> 3 </since_tizen>
367         public static Window Instance { get; internal set; }
368
369         /// <summary>
370         /// Gets or sets a window type.
371         /// Most of window type can be set to use WindowType, except for IME type.
372         /// IME type can be set to use one of NUIApplication's constrcutors.
373         /// </summary>
374         /// <since_tizen> 3 </since_tizen>
375         public WindowType Type
376         {
377             get
378             {
379                 WindowType ret = (WindowType)Interop.Window.GetType(SwigCPtr);
380                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
381                 return ret;
382             }
383             set
384             {
385                 Interop.Window.SetType(SwigCPtr, (int)value);
386                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
387             }
388         }
389
390         /// <summary>
391         /// Gets/Sets a window title.
392         /// </summary>
393         /// <since_tizen> 4 </since_tizen>
394         public string Title
395         {
396             get
397             {
398                 return windowTitle;
399             }
400             set
401             {
402                 windowTitle = value;
403                 SetClass(windowTitle, "");
404             }
405         }
406
407         /// <summary>
408         /// The rendering behavior of a Window.
409         /// </summary>
410         /// <since_tizen> 5 </since_tizen>
411         public RenderingBehaviorType RenderingBehavior
412         {
413             get
414             {
415                 return GetRenderingBehavior();
416             }
417             set
418             {
419                 SetRenderingBehavior(value);
420             }
421         }
422
423         /// <summary>
424         /// The window size property (read-only).
425         /// </summary>
426         /// <since_tizen> 3 </since_tizen>
427         public Size2D Size
428         {
429             get
430             {
431                 Size2D ret = GetSize();
432                 return ret;
433             }
434         }
435
436         /// <summary>
437         /// The background color property.
438         /// </summary>
439         /// <since_tizen> 3 </since_tizen>
440         public Color BackgroundColor
441         {
442             set
443             {
444                 SetBackgroundColor(value);
445             }
446             get
447             {
448                 Color ret = GetBackgroundColor();
449                 return ret;
450             }
451         }
452
453         /// <summary>
454         /// The DPI property (read-only).<br />
455         /// Retrieves the DPI of the display device to which the Window is connected.<br />
456         /// </summary>
457         /// <since_tizen> 3 </since_tizen>
458         public Vector2 Dpi
459         {
460             get
461             {
462                 return GetDpi();
463             }
464         }
465
466         /// <summary>
467         /// The layer count property (read-only).<br />
468         /// Queries the number of on-Window layers.<br />
469         /// </summary>
470         /// <since_tizen> 3 </since_tizen>
471         public uint LayerCount
472         {
473             get
474             {
475                 return GetLayerCount();
476             }
477         }
478
479         /// <summary>
480         /// Gets or sets a size of the window.
481         /// </summary>
482         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
483         /// <since_tizen> 4 </since_tizen>
484         public Size2D WindowSize
485         {
486             get
487             {
488                 return GetWindowSize();
489             }
490             set
491             {
492                 SetWindowSize(value);
493             }
494         }
495
496         /// <summary>
497         /// Gets or sets a position of the window.
498         /// </summary>
499         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
500         /// <since_tizen> 4 </since_tizen>
501         public Position2D WindowPosition
502         {
503             get
504             {
505                 return GetPosition();
506             }
507             set
508             {
509                 SetPosition(value);
510             }
511         }
512
513         /// <summary>
514         /// Sets position and size of the window. This API guarantees that
515         /// both moving and resizing of window will appear on the screen at once.
516         /// </summary>
517         [EditorBrowsable(EditorBrowsableState.Never)]
518         public Rectangle WindowPositionSize
519         {
520             get
521             {
522                 Position2D position = GetPosition();
523                 Size2D size = GetSize();
524                 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
525                 position.Dispose();
526                 return ret;
527             }
528             set
529             {
530                 SetPositionSize(value);
531             }
532         }
533
534         internal static Vector4 DEFAULT_BACKGROUND_COLOR
535         {
536             get
537             {
538                 global::System.IntPtr cPtr = Interop.Stage.DefaultBackgroundColorGet();
539                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
540                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
541                 return ret;
542             }
543         }
544
545         internal static Vector4 DEBUG_BACKGROUND_COLOR
546         {
547             get
548             {
549                 global::System.IntPtr cPtr = Interop.Stage.DebugBackgroundColorGet();
550                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
551                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552                 return ret;
553             }
554         }
555
556         internal List<Layer> LayersChildren
557         {
558             get
559             {
560                 return childLayers;
561             }
562         }
563
564         /// <summary>
565         ///  Get the LayoutController for this Window.
566         /// </summary>
567         internal LayoutController LayoutController
568         {
569             get
570             {
571                 return localController;
572             }
573         }
574
575         /// <summary>
576         /// Feed a key-event into the window.
577         /// </summary>
578         /// <param name="keyEvent">The key event to feed.</param>
579         /// <since_tizen> 4 </since_tizen>
580         [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
581         public static void FeedKeyEvent(Key keyEvent)
582         {
583             Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
584             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
585         }
586
587         /// <summary>
588         /// Sets whether the window accepts a focus or not.
589         /// </summary>
590         /// <param name="accept">If a focus is accepted or not. The default is true.</param>
591         /// <since_tizen> 3 </since_tizen>
592         public void SetAcceptFocus(bool accept)
593         {
594             Interop.Window.SetAcceptFocus(SwigCPtr, accept);
595             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596         }
597
598         /// <summary>
599         /// Returns whether the window accepts a focus or not.
600         /// </summary>
601         /// <returns>True if the window accepts a focus, false otherwise.</returns>
602         /// <since_tizen> 3 </since_tizen>
603         public bool IsFocusAcceptable()
604         {
605             bool ret = Interop.Window.IsFocusAcceptable(SwigCPtr);
606             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
607
608             return ret;
609         }
610
611         /// <summary>
612         /// Shows the window if it is hidden.
613         /// </summary>
614         /// <since_tizen> 3 </since_tizen>
615         public void Show()
616         {
617             Interop.Window.Show(SwigCPtr);
618             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619         }
620
621         /// <summary>
622         /// Hides the window if it is showing.
623         /// </summary>
624         /// <since_tizen> 3 </since_tizen>
625         public void Hide()
626         {
627             Interop.Window.Hide(SwigCPtr);
628             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
629         }
630
631         /// <summary>
632         /// Retrieves whether the window is visible or not.
633         /// </summary>
634         /// <returns>True if the window is visible.</returns>
635         /// <since_tizen> 3 </since_tizen>
636         public bool IsVisible()
637         {
638             bool temp = Interop.Window.IsVisible(SwigCPtr);
639             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640             return temp;
641         }
642
643         /// <summary>
644         /// Gets the count of supported auxiliary hints of the window.
645         /// </summary>
646         /// <returns>The number of supported auxiliary hints.</returns>
647         /// <since_tizen> 3 </since_tizen>
648         public uint GetSupportedAuxiliaryHintCount()
649         {
650             uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(SwigCPtr);
651             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652             return ret;
653         }
654
655         /// <summary>
656         /// Gets the supported auxiliary hint string of the window.
657         /// </summary>
658         /// <param name="index">The index of the supported auxiliary hint lists.</param>
659         /// <returns>The auxiliary hint string of the index.</returns>
660         /// <since_tizen> 3 </since_tizen>
661         public string GetSupportedAuxiliaryHint(uint index)
662         {
663             string ret = Interop.Window.GetSupportedAuxiliaryHint(SwigCPtr, index);
664             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
665             return ret;
666         }
667
668         /// <summary>
669         /// Creates an auxiliary hint of the window.
670         /// </summary>
671         /// <param name="hint">The auxiliary hint string.</param>
672         /// <param name="value">The value string.</param>
673         /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
674         /// <since_tizen> 3 </since_tizen>
675         public uint AddAuxiliaryHint(string hint, string value)
676         {
677             uint ret = Interop.Window.AddAuxiliaryHint(SwigCPtr, hint, value);
678             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679             return ret;
680         }
681
682         /// <summary>
683         /// Removes an auxiliary hint of the window.
684         /// </summary>
685         /// <param name="id">The ID of the auxiliary hint.</param>
686         /// <returns>True if no error occurred, false otherwise.</returns>
687         /// <since_tizen> 3 </since_tizen>
688         public bool RemoveAuxiliaryHint(uint id)
689         {
690             bool ret = Interop.Window.RemoveAuxiliaryHint(SwigCPtr, id);
691             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692             return ret;
693         }
694
695         /// <summary>
696         /// Changes a value of the auxiliary hint.
697         /// </summary>
698         /// <param name="id">The auxiliary hint ID.</param>
699         /// <param name="value">The value string to be set.</param>
700         /// <returns>True if no error occurred, false otherwise.</returns>
701         /// <since_tizen> 3 </since_tizen>
702         public bool SetAuxiliaryHintValue(uint id, string value)
703         {
704             bool ret = Interop.Window.SetAuxiliaryHintValue(SwigCPtr, id, value);
705             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
706             return ret;
707         }
708
709         /// <summary>
710         /// Gets a value of the auxiliary hint.
711         /// </summary>
712         /// <param name="id">The auxiliary hint ID.</param>
713         /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
714         /// <since_tizen> 3 </since_tizen>
715         public string GetAuxiliaryHintValue(uint id)
716         {
717             string ret = Interop.Window.GetAuxiliaryHintValue(SwigCPtr, id);
718             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
719             return ret;
720         }
721
722         /// <summary>
723         /// Gets an ID of the auxiliary hint string.
724         /// </summary>
725         /// <param name="hint">The auxiliary hint string.</param>
726         /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
727         /// <since_tizen> 3 </since_tizen>
728         public uint GetAuxiliaryHintId(string hint)
729         {
730             uint ret = Interop.Window.GetAuxiliaryHintId(SwigCPtr, hint);
731             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
732             return ret;
733         }
734
735         /// <summary>
736         /// Sets a region to accept input events.
737         /// </summary>
738         /// <param name="inputRegion">The region to accept input events.</param>
739         /// <since_tizen> 3 </since_tizen>
740         public void SetInputRegion(Rectangle inputRegion)
741         {
742             Interop.Window.IncludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
743             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
744         }
745
746         /// <summary>
747         /// Sets a priority level for the specified notification window.
748         /// </summary>
749         /// <param name="level">The notification window level.</param>
750         /// <returns>True if no error occurred, false otherwise.</returns>
751         /// <since_tizen> 3 </since_tizen>
752         public bool SetNotificationLevel(NotificationLevel level)
753         {
754             var ret = (OperationResult)Interop.Window.SetNotificationLevel(SwigCPtr, (int)level);
755             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756             return ret == OperationResult.Succeed;
757         }
758
759         /// <summary>
760         /// Gets a priority level for the specified notification window.
761         /// </summary>
762         /// <returns>The notification window level.</returns>
763         /// <since_tizen> 3 </since_tizen>
764         public NotificationLevel GetNotificationLevel()
765         {
766             NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(SwigCPtr);
767             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
768             return ret;
769         }
770
771         /// <summary>
772         /// Sets a transparent window's visual state to opaque. <br />
773         /// If a visual state of a transparent window is opaque, <br />
774         /// then the window manager could handle it as an opaque window when calculating visibility.
775         /// </summary>
776         /// <param name="opaque">Whether the window's visual state is opaque.</param>
777         /// <remarks>This will have no effect on an opaque window. <br />
778         /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
779         /// </remarks>
780         /// <since_tizen> 3 </since_tizen>
781         public void SetOpaqueState(bool opaque)
782         {
783             Interop.Window.SetOpaqueState(SwigCPtr, opaque);
784             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
785         }
786
787         /// <summary>
788         /// Returns whether a transparent window's visual state is opaque or not.
789         /// </summary>
790         /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
791         /// <remarks> The return value has no meaning on an opaque window. </remarks>
792         /// <since_tizen> 3 </since_tizen>
793         public bool IsOpaqueState()
794         {
795             bool ret = Interop.Window.IsOpaqueState(SwigCPtr);
796             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
797             return ret;
798         }
799
800         /// <summary>
801         /// Sets a window's screen off mode.
802         /// </summary>
803         /// <param name="screenOffMode">The screen mode.</param>
804         /// <returns>True if no error occurred, false otherwise.</returns>
805         /// <since_tizen> 4 </since_tizen>
806         public bool SetScreenOffMode(ScreenOffMode screenOffMode)
807         {
808             var ret = (OperationResult)Interop.Window.SetScreenOffMode(SwigCPtr, (int)screenOffMode);
809             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
810             return ret == OperationResult.Succeed;
811         }
812
813         /// <summary>
814         /// Gets the screen mode of the window.
815         /// </summary>
816         /// <returns>The screen off mode.</returns>
817         /// <since_tizen> 4 </since_tizen>
818         public ScreenOffMode GetScreenOffMode()
819         {
820             ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(SwigCPtr);
821             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
822             return ret;
823         }
824
825         /// <summary>
826         /// Sets preferred brightness of the window.
827         /// </summary>
828         /// <param name="brightness">The preferred brightness (0 to 100).</param>
829         /// <returns>True if no error occurred, false otherwise.</returns>
830         /// <since_tizen> 3 </since_tizen>
831         public bool SetBrightness(int brightness)
832         {
833             var ret = (OperationResult)Interop.Window.SetBrightness(SwigCPtr, brightness);
834             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
835             return ret == OperationResult.Succeed;
836         }
837
838         /// <summary>
839         /// Gets the preferred brightness of the window.
840         /// </summary>
841         /// <returns>The preferred brightness.</returns>
842         /// <since_tizen> 3 </since_tizen>
843         public int GetBrightness()
844         {
845             int ret = Interop.Window.GetBrightness(SwigCPtr);
846             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
847             return ret;
848         }
849
850         /// <summary>
851         /// Sets the window name and the class string.
852         /// </summary>
853         /// <param name="name">The name of the window.</param>
854         /// <param name="klass">The class of the window.</param>
855         /// <since_tizen> 4 </since_tizen>
856         public void SetClass(string name, string klass)
857         {
858             Interop.Window.SetClass(SwigCPtr, name, klass);
859             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
860         }
861
862         /// <summary>
863         /// Raises the window to the top of the window stack.
864         /// </summary>
865         /// <since_tizen> 3 </since_tizen>
866         public void Raise()
867         {
868             Interop.Window.Raise(SwigCPtr);
869             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
870         }
871
872         /// <summary>
873         /// Lowers the window to the bottom of the window stack.
874         /// </summary>
875         /// <since_tizen> 3 </since_tizen>
876         public void Lower()
877         {
878             Interop.Window.Lower(SwigCPtr);
879             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
880         }
881
882         /// <summary>
883         /// Activates the window to the top of the window stack even it is iconified.
884         /// </summary>
885         /// <since_tizen> 3 </since_tizen>
886         public void Activate()
887         {
888             Interop.Window.Activate(SwigCPtr);
889             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
890         }
891
892         /// <summary>
893         /// Gets the default ( root ) layer.
894         /// </summary>
895         /// <returns>The root layer.</returns>
896         /// <since_tizen> 3 </since_tizen>
897         public Layer GetDefaultLayer()
898         {
899             return this.GetRootLayer();
900         }
901
902         /// <summary>
903         /// Add a child view to window.
904         /// </summary>
905         /// <param name="view">the child should be added to the window.</param>
906         /// <since_tizen> 3 </since_tizen>
907         public void Add(View view)
908         {
909             Interop.Actor.Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
910             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
911             this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
912             if (null != view)
913             {
914                 view.InternalParent = this.GetRootLayer();
915
916                 this.GetRootLayer().LayoutCount += view.LayoutCount;
917             }
918         }
919
920         /// <summary>
921         /// Remove a child view from window.
922         /// </summary>
923         /// <param name="view">the child to be removed.</param>
924         /// <since_tizen> 3 </since_tizen>
925         public void Remove(View view)
926         {
927             Interop.Actor.Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
928             this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
929             if (null != view)
930             {
931                 view.InternalParent = null;
932
933                 this.GetRootLayer().LayoutCount -= view.LayoutCount;
934             }
935         }
936
937         /// <summary>
938         /// Retrieves the layer at a specified depth.
939         /// </summary>
940         /// <param name="depth">The layer's depth index.</param>
941         /// <returns>The layer found at the given depth.</returns>
942         /// <since_tizen> 3 </since_tizen>
943         public Layer GetLayer(uint depth)
944         {
945             if (depth < LayersChildren?.Count)
946             {
947                 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
948                 return ret;
949             }
950             else
951             {
952                 return null;
953             }
954         }
955
956         /// <summary>
957         /// Destroy the window immediately.
958         /// </summary>
959         [EditorBrowsable(EditorBrowsableState.Never)]
960         public void Destroy()
961         {
962             this.Dispose();
963         }
964
965         /// <summary>
966         /// Keep rendering for at least the given amount of time.
967         /// </summary>
968         /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
969         /// <since_tizen> 3 </since_tizen>
970         public void KeepRendering(float durationSeconds)
971         {
972             Interop.Stage.KeepRendering(stageCPtr, durationSeconds);
973             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
974         }
975
976         /// <summary>
977         /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
978         /// This function can be used for following example scenarios: <br />
979         /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
980         /// </summary>
981         /// <param name="DaliKey">The key code to grab.</param>
982         /// <returns>True if the grab succeeds.</returns>
983         /// <since_tizen> 3 </since_tizen>
984         public bool GrabKeyTopmost(int DaliKey)
985         {
986             bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
987             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
988             return ret;
989         }
990
991         /// <summary>
992         /// Ungrabs the key specified by a key for the window.<br />
993         /// 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 />
994         /// </summary>
995         /// <param name="DaliKey">The key code to ungrab.</param>
996         /// <returns>True if the ungrab succeeds.</returns>
997         /// <since_tizen> 3 </since_tizen>
998         public bool UngrabKeyTopmost(int DaliKey)
999         {
1000             bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
1001             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1002             return ret;
1003         }
1004
1005         /// <summary>
1006         ///  Grabs the key specified by a key for a window in a GrabMode. <br />
1007         ///  Details: This function can be used for following example scenarios: <br />
1008         ///  - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
1009         ///  - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
1010         ///  - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
1011         /// </summary>
1012         /// <param name="DaliKey">The key code to grab.</param>
1013         /// <param name="GrabMode">The grab mode for the key.</param>
1014         /// <returns>True if the grab succeeds.</returns>
1015         /// <since_tizen> 3 </since_tizen>
1016         public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
1017         {
1018             bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey, (int)GrabMode);
1019             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1020             return ret;
1021         }
1022
1023         /// <summary>
1024         /// Ungrabs the key specified by a key for a window.<br />
1025         /// 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 />
1026         /// </summary>
1027         /// <param name="DaliKey">The key code to ungrab.</param>
1028         /// <returns>True if the ungrab succeeds.</returns>
1029         /// <since_tizen> 3 </since_tizen>
1030         public bool UngrabKey(int DaliKey)
1031         {
1032             bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
1033             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1034             return ret;
1035         }
1036
1037         /// <summary>
1038         /// Sets the keyboard repeat information.
1039         /// </summary>
1040         /// <param name="rate">The key repeat rate value in seconds.</param>
1041         /// <param name="delay">The key repeat delay value in seconds.</param>
1042         /// <returns>True if setting the keyboard repeat succeeds.</returns>
1043         /// <since_tizen> 5 </since_tizen>
1044         public bool SetKeyboardRepeatInfo(float rate, float delay)
1045         {
1046             bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
1047             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1048             return ret;
1049         }
1050
1051         /// <summary>
1052         /// Gets the keyboard repeat information.
1053         /// </summary>
1054         /// <param name="rate">The key repeat rate value in seconds.</param>
1055         /// <param name="delay">The key repeat delay value in seconds.</param>
1056         /// <returns>True if setting the keyboard repeat succeeds.</returns>
1057         /// <since_tizen> 5 </since_tizen>
1058         public bool GetKeyboardRepeatInfo(out float rate, out float delay)
1059         {
1060             bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
1061             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1062             return ret;
1063         }
1064
1065         /// <summary>
1066         /// Adds a layer to the stage.
1067         /// </summary>
1068         /// <param name="layer">Layer to add.</param>
1069         /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
1070         /// <since_tizen> 3 </since_tizen>
1071         public void AddLayer(Layer layer)
1072         {
1073             Add(layer);
1074         }
1075
1076         /// <summary>
1077         /// Removes a layer from the stage.
1078         /// </summary>
1079         /// <param name="layer">Layer to remove.</param>
1080         /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
1081         /// <since_tizen> 3 </since_tizen>
1082         public void RemoveLayer(Layer layer)
1083         {
1084             Remove(layer);
1085         }
1086
1087         /// <summary>
1088         /// Feeds a key event into the window.
1089         /// </summary>
1090         /// <param name="keyEvent">The key event to feed.</param>
1091         /// <since_tizen> 5 </since_tizen>
1092         public void FeedKey(Key keyEvent)
1093         {
1094             Interop.Window.FeedKeyEvent(SwigCPtr, Key.getCPtr(keyEvent));
1095             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1096         }
1097
1098         /// <summary>
1099         /// Feeds a touch point into the window.
1100         /// </summary>
1101         /// <param name="touchPoint">The touch point to feed.</param>
1102         /// <param name="timeStamp">The timeStamp.</param>
1103         internal void FeedTouch(TouchPoint touchPoint, int timeStamp)
1104         {
1105             Interop.Window.FeedTouchPoint(SwigCPtr, TouchPoint.getCPtr(touchPoint), timeStamp);
1106             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1107         }
1108
1109         /// <summary>
1110         /// Feeds a wheel event into the window.
1111         /// </summary>
1112         /// <param name="wheelEvent">The wheel event to feed.</param>
1113         internal void FeedWheel(Wheel wheelEvent)
1114         {
1115             Interop.Window.FeedWheelEvent(SwigCPtr, Wheel.getCPtr(wheelEvent));
1116             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1117         }
1118
1119         /// <summary>
1120         /// Allows at least one more render, even when paused.
1121         /// The window should be shown, not minimised.
1122         /// </summary>
1123         /// <since_tizen> 4 </since_tizen>
1124         public void RenderOnce()
1125         {
1126             Interop.Window.RenderOnce(SwigCPtr);
1127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1128         }
1129
1130         /// <summary>
1131         /// Sets whether the window is transparent or not.
1132         /// </summary>
1133         /// <param name="transparent">Whether the window is transparent or not.</param>
1134         /// <since_tizen> 5 </since_tizen>
1135         public void SetTransparency(bool transparent)
1136         {
1137             Interop.Window.SetTransparency(SwigCPtr, transparent);
1138             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1139
1140             // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
1141         }
1142
1143         /// <summary>
1144         /// Sets parent window of the window.
1145         /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1146         /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
1147         /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
1148         /// </summary>
1149         /// <param name="parent">The parent window.</param>
1150         /// <since_tizen> 6 </since_tizen>
1151         /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1152         /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1153         public void SetParent(Window parent)
1154         {
1155             if (IsSupportedMultiWindow() == false)
1156             {
1157                 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1158             }
1159             Interop.Window.SetParent(SwigCPtr, Window.getCPtr(parent));
1160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1161         }
1162
1163         /// <summary>
1164         /// Sets parent window of the window.
1165         /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1166         /// This function has the additional flag whether the child is located above or below of the parent.
1167         /// </summary>
1168         /// <param name="parent">The parent window.</param>
1169         /// <param name="belowParent">The flag is whether the child is located above or below of the parent.</param>
1170         /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1171         /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1172         [EditorBrowsable(EditorBrowsableState.Never)]
1173         public void SetParent(Window parent, bool belowParent)
1174         {
1175             if (IsSupportedMultiWindow() == false)
1176             {
1177                 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1178             }
1179             Interop.Window.SetParentWithStack(SwigCPtr, Window.getCPtr(parent), belowParent);
1180             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1181         }
1182
1183         /// <summary>
1184         /// Unsets parent window of the window.
1185         /// After unsetting, the window is disconnected his parent window.
1186         /// </summary>
1187         /// <since_tizen> 6 </since_tizen>
1188         /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1189         /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1190         public void Unparent()
1191         {
1192             if (IsSupportedMultiWindow() == false)
1193             {
1194                 NUILog.Error("Fail to create window. because this device does not support opengles.surfaceless_context.");
1195             }
1196             Interop.Window.Unparent(SwigCPtr);
1197             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1198         }
1199
1200         /// <summary>
1201         /// Gets parent window of the window.
1202         /// </summary>
1203         /// <returns>The parent window of the window.</returns>
1204         /// <since_tizen> 6 </since_tizen>
1205         /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1206         /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1207         [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1721: Property names should not match get methods")]
1208         public Window GetParent()
1209         {
1210             if (IsSupportedMultiWindow() == false)
1211             {
1212                 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1213             }
1214             Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.GetParent(SwigCPtr)) as Window;
1215             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1216             return ret;
1217         }
1218
1219         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
1220         [EditorBrowsable(EditorBrowsableState.Never)]
1221         public void ObjectDump()
1222         {
1223             Layer rootLayer = GetRootLayer();
1224             foreach (View view in rootLayer.Children)
1225             {
1226                 view.ObjectDump();
1227             }
1228         }
1229
1230         internal static bool IsInstalled()
1231         {
1232             bool ret = Interop.Stage.IsInstalled();
1233             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1234             return ret;
1235         }
1236
1237         /// <summary>
1238         /// Adds an orientation to the list of available orientations.
1239         /// </summary>
1240         /// <param name="orientation">The available orientation to add</param>
1241         /// <since_tizen> 6 </since_tizen>
1242         public void AddAvailableOrientation(Window.WindowOrientation orientation)
1243         {
1244             Interop.Window.AddAvailableOrientation(SwigCPtr, (int)orientation);
1245             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1246         }
1247
1248         /// <summary>
1249         /// Removes an orientation from the list of available orientations.
1250         /// </summary>
1251         /// <param name="orientation">The available orientation to remove.</param>
1252         /// <since_tizen> 6 </since_tizen>
1253         public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1254         {
1255             Interop.Window.RemoveAvailableOrientation(SwigCPtr, (int)orientation);
1256             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1257         }
1258
1259         /// <summary>
1260         /// Sets a preferred orientation.
1261         /// </summary>
1262         /// <param name="orientation">The preferred orientation.</param>
1263         /// <since_tizen> 6 </since_tizen>
1264         public void SetPreferredOrientation(Window.WindowOrientation orientation)
1265         {
1266             Interop.Window.SetPreferredOrientation(SwigCPtr, (int)orientation);
1267             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1268         }
1269
1270         /// <summary>
1271         /// Gets the preferred orientation.
1272         /// </summary>
1273         /// <since_tizen> 6 </since_tizen>
1274         /// <returns>The preferred orientation if previously set, or none.</returns>
1275         public Window.WindowOrientation GetPreferredOrientation()
1276         {
1277             Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetPreferredOrientation(SwigCPtr);
1278             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1279             return ret;
1280         }
1281
1282         /// <summary>
1283         /// Gets current orientation of the window.
1284         /// </summary>
1285         /// <since_tizen> 6 </since_tizen>
1286         /// <returns>The current window orientation if previously set, or none.</returns>
1287         [EditorBrowsable(EditorBrowsableState.Never)]
1288         public Window.WindowOrientation GetCurrentOrientation()
1289         {
1290             Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetCurrentOrientation(SwigCPtr);
1291             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1292             return ret;
1293         }
1294
1295         /// <summary>
1296         /// Sets available orientations of the window.
1297         /// This API is for setting several orientations one time.
1298         /// </summary>
1299         /// <param name="orientations">The list of orientations.</param>
1300         /// <since_tizen> 6 </since_tizen>
1301         [EditorBrowsable(EditorBrowsableState.Never)]
1302         public void SetAvailableOrientations(List<Window.WindowOrientation> orientations)
1303         {
1304             if (null == orientations)
1305             {
1306                 throw new ArgumentNullException(nameof(orientations));
1307             }
1308
1309             PropertyArray orientationArray = new PropertyArray();
1310             for (int i = 0; i < orientations.Count; i++)
1311             {
1312                 PropertyValue value = new PropertyValue((int)orientations[i]);
1313                 orientationArray.PushBack(value);
1314                 value.Dispose();
1315             }
1316
1317             Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray), orientations.Count);
1318             orientationArray.Dispose();
1319             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1320         }
1321
1322         /// <summary>
1323         /// Get native window ID
1324         /// </summary>
1325         /// <returns>native window ID</returns>
1326         [EditorBrowsable(EditorBrowsableState.Never)]
1327         public int GetNativeId()
1328         {
1329             int ret = Interop.Window.GetNativeId(SwigCPtr);
1330             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1331             return ret;
1332         }
1333
1334         internal Any GetNativeHandle()
1335         {
1336             Any ret = new Any(Interop.WindowInternal.WindowGetNativeHandle(SwigCPtr), true);
1337             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1338             return ret;
1339         }
1340
1341         internal void Add(Layer layer)
1342         {
1343             if (null == layer)
1344             {
1345                 throw new ArgumentNullException(nameof(layer));
1346             }
1347             Interop.Window.Add(SwigCPtr, Layer.getCPtr(layer));
1348             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1349
1350             LayersChildren?.Add(layer);
1351             layer.SetWindow(this);
1352         }
1353
1354         internal void Remove(Layer layer)
1355         {
1356             if (null == layer)
1357             {
1358                 throw new ArgumentNullException(nameof(layer));
1359             }
1360             Interop.Window.Remove(SwigCPtr, Layer.getCPtr(layer));
1361             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1362
1363             LayersChildren?.Remove(layer);
1364             layer.SetWindow(null);
1365         }
1366
1367         internal Vector2 GetSize()
1368         {
1369             var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1370             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1371             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1372             val.Dispose();
1373             return ret;
1374         }
1375
1376         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
1377         [EditorBrowsable(EditorBrowsableState.Never)]
1378         public RenderTaskList GetRenderTaskList()
1379         {
1380             RenderTaskList ret = new RenderTaskList(Interop.Stage.GetRenderTaskList(stageCPtr), true);
1381             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1382             return ret;
1383         }
1384
1385         /// <summary>
1386         /// Queries the number of on-window layers.
1387         /// </summary>
1388         /// <returns>The number of layers.</returns>
1389         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1390         internal uint GetLayerCount()
1391         {
1392             if (LayersChildren == null || LayersChildren.Count < 0)
1393                 return 0;
1394
1395             return (uint)LayersChildren.Count;
1396         }
1397
1398         internal Layer GetRootLayer()
1399         {
1400             // Window.IsInstalled() is actually true only when called from event thread and
1401             // Core has been initialized, not when Stage is ready.
1402             if (rootLayer == null && Window.IsInstalled())
1403             {
1404                 rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
1405                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1406                 LayersChildren?.Add(rootLayer);
1407                 rootLayer.SetWindow(this);
1408             }
1409             return rootLayer;
1410         }
1411
1412         internal void SetBackgroundColor(Vector4 color)
1413         {
1414             Interop.Window.SetBackgroundColor(SwigCPtr, Vector4.getCPtr(color));
1415             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1416         }
1417
1418         internal Vector4 GetBackgroundColor()
1419         {
1420             Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(SwigCPtr), true);
1421             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1422             return ret;
1423         }
1424
1425         internal Vector2 GetDpi()
1426         {
1427             Vector2 ret = new Vector2(Interop.Stage.GetDpi(stageCPtr), true);
1428             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1429             return ret;
1430         }
1431
1432         internal ObjectRegistry GetObjectRegistry()
1433         {
1434             ObjectRegistry ret = new ObjectRegistry(Interop.Stage.GetObjectRegistry(stageCPtr), true);
1435             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1436             return ret;
1437         }
1438
1439         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1440         {
1441             Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1442             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1443         }
1444
1445         internal RenderingBehaviorType GetRenderingBehavior()
1446         {
1447             RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.GetRenderingBehavior(stageCPtr);
1448             if (NDalicPINVOKE.SWIGPendingException.Pending)
1449                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1450             return ret;
1451         }
1452
1453         internal void SetWindowSize(Size2D size)
1454         {
1455             if (null == size)
1456             {
1457                 throw new ArgumentNullException(nameof(size));
1458             }
1459             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1460             Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
1461             val.Dispose();
1462             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1463             // Resetting Window size should request a relayout of the tree.
1464         }
1465
1466         internal Size2D GetWindowSize()
1467         {
1468             var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1469             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1470             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1471             val.Dispose();
1472             return ret;
1473         }
1474
1475         internal void SetPosition(Position2D position)
1476         {
1477             if (null == position)
1478             {
1479                 throw new ArgumentNullException(nameof(position));
1480             }
1481             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1482             Interop.Window.SetPosition(SwigCPtr, Uint16Pair.getCPtr(val));
1483             val.Dispose();
1484             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1485             // Setting Position of the window should request a relayout of the tree.
1486         }
1487
1488         internal Position2D GetPosition()
1489         {
1490             var val = new Uint16Pair(Interop.Window.GetPosition(SwigCPtr), true);
1491             Position2D ret = new Position2D(val.GetX(), val.GetY());
1492             val.Dispose();
1493             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1494             return ret;
1495         }
1496
1497         internal void SetPositionSize(Rectangle positionSize)
1498         {
1499             Interop.Window.SetPositionSize(SwigCPtr, Rectangle.getCPtr(positionSize));
1500
1501             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1502
1503             // Setting Position of the window should request a relayout of the tree.
1504         }
1505
1506         /// <summary>
1507         /// Enables the floating mode of window.
1508         /// The floating mode is to support window is moved or resized by display server.
1509         /// For example, if the video-player window sets the floating mode,
1510         /// then display server changes its geometry and handles it like a popup.
1511         /// The way of handling floating mode window is decided by display server.
1512         /// A special display server(as a Tizen display server) supports this mode.
1513         /// </summary>
1514         /// <param name="enable">Enable floating mode or not.</param>
1515         [EditorBrowsable(EditorBrowsableState.Never)]
1516         public void EnableFloatingMode(bool enable)
1517         {
1518             Interop.Window.EnableFloatingMode(SwigCPtr, enable);
1519             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1520         }
1521
1522         /// <summary>
1523         /// Requests to display server for the window is moved by display server.
1524         /// It can be work with setting window floating mode.
1525         /// </summary>
1526         [EditorBrowsable(EditorBrowsableState.Never)]
1527         public void RequestMoveToServer()
1528         {
1529             Interop.Window.RequestMoveToServer(SwigCPtr);
1530             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1531         }
1532
1533         /// <summary>
1534         ///  Requests to display server for the window is resized by display server.
1535         /// It can be work with setting window floating mode.
1536         /// </summary>
1537         /// <param name="direction">It is indicated the window's side or edge for starting point.</param>
1538         [EditorBrowsable(EditorBrowsableState.Never)]
1539         public void RequestResizeToServer(ResizeDirection direction)
1540         {
1541             Interop.Window.RequestResizeToServer(SwigCPtr, (int)direction);
1542             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1543         }
1544
1545         /// <summary>
1546         /// Includes input region.
1547         /// This function inlcudes input regions.
1548         /// It can be used multiple times and supports multiple regions.
1549         /// It means input region will be extended.
1550         /// This input is related to mouse and touch event.
1551         /// If device has touch screen, this function is useful.
1552         /// Otherwise device does not have that, we can use it after connecting mouse to the device.
1553         /// </summary>
1554         /// <param name="inputRegion">The included region to accept input events.</param>
1555         [EditorBrowsable(EditorBrowsableState.Never)]
1556         public void IncludeInputRegion(Rectangle inputRegion)
1557         {
1558             Interop.Window.IncludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
1559             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1560         }
1561
1562         /// <summary>
1563         /// This function excludes input regions.
1564         /// It can be used multiple times and supports multiple regions.
1565         /// It means input region will be reduced.
1566         /// Nofice, should be set input area by IncludeInputRegion() before this function is used.
1567         /// This input is related to mouse and touch event.
1568         /// If device has touch screen, this function is useful.
1569         /// Otherwise device does not have that, we can use it after connecting mouse to the device.
1570         /// </summary>
1571         /// <param name="inputRegion">The excluded region to except input events.</param>
1572         [EditorBrowsable(EditorBrowsableState.Never)]
1573         public void ExcludeInputRegion(Rectangle inputRegion)
1574         {
1575             Interop.Window.ExcludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
1576             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1577         }
1578
1579         /// <summary>
1580         /// Maximizes window's size.
1581         /// If this function is called with true, window will be resized with screen size.
1582         /// Otherwise window will be resized with previous size.
1583         /// It is for the window's MAX button in window's border.
1584         /// If window border is supported by display server, it is not necessary.
1585         /// </summary>
1586         /// <param name="max">If window is maximized or unmaximized.</param>
1587         [EditorBrowsable(EditorBrowsableState.Never)]
1588         public void Maximize(bool max)
1589         {
1590             Interop.Window.Maximize(SwigCPtr, max);
1591             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1592         }
1593
1594         /// <summary>
1595         /// Returns whether the window is maximized or not.
1596         /// </summary>
1597         /// <returns>True if the window is maximized, false otherwise.</returns>
1598         [EditorBrowsable(EditorBrowsableState.Never)]
1599         public bool IsMaximized()
1600         {
1601             bool ret = Interop.Window.IsMaximized(SwigCPtr);
1602             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1603             return ret;
1604         }
1605
1606         /// <summary>
1607         /// Minimizes window's size.
1608         /// If this function is called with true, window will be iconified.
1609         /// Otherwise window will be activated.
1610         /// It is for the window's MIN button in window border.
1611         /// If window border is supported by display server, it is not necessary.
1612         /// </summary>
1613         /// <param name="min">If window is minimized or unminimized.</param>
1614         [EditorBrowsable(EditorBrowsableState.Never)]
1615         public void Minimize(bool min)
1616         {
1617             Interop.Window.Minimize(SwigCPtr, min);
1618             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1619         }
1620
1621         /// <summary>
1622         /// Returns whether the window is minimized or not.
1623         /// </summary>
1624         /// <returns>True if the window is minimized, false otherwise.</returns>
1625         [EditorBrowsable(EditorBrowsableState.Never)]
1626         public bool IsMinimized()
1627         {
1628             bool ret = Interop.Window.IsMinimized(SwigCPtr);
1629             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1630             return ret;
1631         }
1632
1633         /// <summary>
1634         /// Add FrameUpdateCallback
1635         /// </summary>
1636         [EditorBrowsable(EditorBrowsableState.Never)]
1637         public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1638         {
1639             frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, Layer.getCPtr(GetRootLayer()));
1640         }
1641
1642         /// <summary>
1643         /// Remove FrameUpdateCallback
1644         /// </summary>
1645         [EditorBrowsable(EditorBrowsableState.Never)]
1646         public void RemoveFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1647         {
1648             frameUpdateCallback?.RemoveFrameUpdateCallback(stageCPtr);
1649         }
1650
1651         /// <summary>
1652         /// Dispose for Window
1653         /// </summary>
1654         [EditorBrowsable(EditorBrowsableState.Never)]
1655         protected override void Dispose(DisposeTypes type)
1656         {
1657             if (disposed)
1658             {
1659                 return;
1660             }
1661
1662             if (type == DisposeTypes.Explicit)
1663             {
1664                 //Called by User
1665                 //Release your own managed resources here.
1666                 //You should release all of your own disposable objects here.
1667
1668                 if (rootLayer != null)
1669                 {
1670                     rootLayer.Dispose();
1671                 }
1672
1673                 localController?.Dispose();
1674
1675                 foreach (var layer in childLayers)
1676                 {
1677                     if (layer != null)
1678                     {
1679                         layer.Dispose();
1680                     }
1681                 }
1682
1683                 childLayers.Clear();
1684             }
1685
1686             this.DisconnectNativeSignals();
1687
1688             base.Dispose(type);
1689         }
1690
1691         /// This will not be public opened.
1692         [EditorBrowsable(EditorBrowsableState.Never)]
1693         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1694         {
1695             Interop.Window.DeleteWindow(swigCPtr);
1696         }
1697
1698         private static Dictionary<int, internalHookCallbackType> frameCallbackList = new Dictionary<int, internalHookCallbackType>();
1699
1700         private static readonly object locker = new object();
1701
1702         private static int key = 0;
1703
1704         private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback;
1705
1706         private struct internalHookCallbackType
1707         {
1708             public FrameCallbackType userCallback;
1709             public int frameId;
1710         }
1711
1712         private static void OnInternalHookFrameCallback(int id)
1713         {
1714             lock (locker)
1715             {
1716                 if (frameCallbackList.ContainsKey(id))
1717                 {
1718                     if (frameCallbackList[id].userCallback != null)
1719                     {
1720                         frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId);
1721                         frameCallbackList.Remove(id);
1722                     }
1723                     else
1724                     {
1725                         NUILog.Error($"found userCallback is NULL");
1726                         frameCallbackList.Remove(id);
1727                     }
1728                 }
1729             }
1730         }
1731
1732         private int AddInterHookCallback(FrameCallbackType callback, int frameId)
1733         {
1734             if (null == callback)
1735             {
1736                 throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
1737             }
1738             var assignedKey = 0;
1739             lock (locker)
1740             {
1741                 key++;
1742                 assignedKey = key;
1743                 frameCallbackList.Add(assignedKey, new internalHookCallbackType()
1744                 {
1745                     userCallback = callback,
1746                     frameId = frameId,
1747                 });
1748             }
1749             return assignedKey;
1750         }
1751
1752         /// <summary>
1753         /// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display.
1754         /// </summary>
1755         /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1756         [EditorBrowsable(EditorBrowsableState.Never)]
1757         public delegate void FrameCallbackType(int frameId);
1758
1759         /// <summary>
1760         /// Adds a callback that is called when the frame rendering is done by the graphics driver.
1761         /// A callback of the following type may be used:
1762         /// <code>
1763         /// void MyFunction( int frameId )
1764         /// </code>
1765         /// This callback will be deleted once it is called.
1766         /// <remarks>
1767         /// Ownership of the callback is passed onto this class
1768         /// </remarks>
1769         /// </summary>
1770         /// <param name="callback">The function to call</param>
1771         /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1772         /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
1773         [EditorBrowsable(EditorBrowsableState.Never)]
1774         public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId)
1775         {
1776             var assignedKey = AddInterHookCallback(callback, frameId);
1777             Interop.WindowInternal.AddFrameRenderedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
1778
1779             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1780         }
1781
1782         /// <summary>
1783         /// Adds a callback that is called when the frame is displayed on the display.
1784         /// A callback of the following type may be used:
1785         /// <code>
1786         /// void MyFunction( int frameId )
1787         /// </code>
1788         /// This callback will be deleted once it is called.
1789         /// <remarks>
1790         /// Ownership of the callback is passed onto this class
1791         /// </remarks>
1792         /// </summary>
1793         /// <param name="callback">The function to call</param>
1794         /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1795         /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
1796         [EditorBrowsable(EditorBrowsableState.Never)]
1797         public void AddFramePresentedCallback(FrameCallbackType callback, int frameId)
1798         {
1799             var assignedKey = AddInterHookCallback(callback, frameId);
1800             Interop.WindowInternal.AddFramePresentedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
1801
1802             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1803         }
1804
1805         /// <summary>
1806         /// Search through this Window for a Layer with the given unique ID.
1807         /// </summary>
1808         /// <param name="id">The ID of the Layer to find.</param>
1809         /// <remarks>Hidden-API</remarks>
1810         /// <returns>A handle to the Layer if found, or an empty handle if not.</returns>
1811         [EditorBrowsable(EditorBrowsableState.Never)]
1812         public Layer FindLayerByID(uint id)
1813         {
1814             Layer defaultLayer = this.GetDefaultLayer();
1815             IntPtr cPtr = Interop.Actor.FindChildById(defaultLayer.SwigCPtr, id);
1816             Layer ret = this.GetInstanceSafely<Layer>(cPtr);
1817
1818             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1819             return ret;
1820         }
1821
1822         /// <summary>
1823         /// Get Native Window handle.
1824         /// <example>
1825         /// How to get Native Window handle
1826         /// <code>
1827         /// Window window = NUIApplication.GetDefaultWindow();
1828         /// var handle = window.NativeHandle;
1829         /// if(handle.IsInvalid == false)
1830         /// {
1831         ///     IntPtr nativeHandle = handle.DangerousGetHandle();
1832         ///     // do something with nativeHandle
1833         /// }
1834         /// </code>
1835         /// </example>
1836         /// </summary>
1837         /// <since_tizen> 9 </since_tizen>
1838         public SafeHandle NativeHandle
1839         {
1840             get
1841             {
1842                 return new NUI.SafeNativeWindowHandle(this);
1843             }
1844         }
1845     }
1846 }