Follow formatting NUI
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Application.cs
1 /*
2  * Copyright(c) 2018 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.Collections.Generic;
19 using System.Collections.ObjectModel;
20 using System.ComponentModel;
21 using System.Diagnostics;
22 using System.Runtime.InteropServices;
23 using System.Threading;
24 using System.Threading.Tasks;
25 using Tizen.NUI.Binding;
26 using Tizen.NUI.Binding.Internals;
27
28 namespace Tizen.NUI
29 {
30     /**
31       * @brief Event arguments that passed via NUIApplicationInit signal
32       *
33       */
34     internal class NUIApplicationInitEventArgs : EventArgs
35     {
36         private Application _application;
37
38         /**
39           * @brief Application - is the application that is being initialized
40           *
41           */
42         public Application Application
43         {
44             get
45             {
46                 return _application;
47             }
48             set
49             {
50                 _application = value;
51             }
52         }
53     }
54
55     /**
56       * @brief Event arguments that passed via NUIApplicationTerminate signal
57       *
58       */
59     internal class NUIApplicationTerminatingEventArgs : EventArgs
60     {
61         private Application _application;
62         /**
63           * @brief Application - is the application that is being Terminated
64           *
65           */
66         public Application Application
67         {
68             get
69             {
70                 return _application;
71             }
72             set
73             {
74                 _application = value;
75             }
76         }
77     }
78
79     /**
80       * @brief Event arguments that passed via NUIApplicationPause signal
81       *
82       */
83     internal class NUIApplicationPausedEventArgs : EventArgs
84     {
85         private Application _application;
86         /**
87           * @brief Application - is the application that is being Paused
88           *
89           */
90         public Application Application
91         {
92             get
93             {
94                 return _application;
95             }
96             set
97             {
98                 _application = value;
99             }
100         }
101     }
102
103     /**
104       * @brief Event arguments that passed via NUIApplicationResume signal
105       *
106       */
107     internal class NUIApplicationResumedEventArgs : EventArgs
108     {
109         private Application _application;
110         /**
111           * @brief Application - is the application that is being Resumed
112           *
113           */
114         public Application Application
115         {
116             get
117             {
118                 return _application;
119             }
120             set
121             {
122                 _application = value;
123             }
124         }
125     }
126
127     /**
128       * @brief Event arguments that passed via NUIApplicationReset signal
129       *
130       */
131     internal class NUIApplicationResetEventArgs : EventArgs
132     {
133         private Application _application;
134         /**
135           * @brief Application - is the application that is being Reset
136           *
137           */
138         public Application Application
139         {
140             get
141             {
142                 return _application;
143             }
144             set
145             {
146                 _application = value;
147             }
148         }
149     }
150
151     /**
152       * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
153       *
154       */
155     internal class NUIApplicationLanguageChangedEventArgs : EventArgs
156     {
157         private Application _application;
158         /**
159           * @brief Application - is the application that is being affected with Device's language change
160           *
161           */
162         public Application Application
163         {
164             get
165             {
166                 return _application;
167             }
168             set
169             {
170                 _application = value;
171             }
172         }
173     }
174
175     /**
176       * @brief Event arguments that passed via NUIApplicationRegionChanged signal
177       *
178       */
179     internal class NUIApplicationRegionChangedEventArgs : EventArgs
180     {
181         private Application _application;
182         /**
183           * @brief Application - is the application that is being affected with Device's region change
184           *
185           */
186         public Application Application
187         {
188             get
189             {
190                 return _application;
191             }
192             set
193             {
194                 _application = value;
195             }
196         }
197     }
198
199     /**
200       * @brief Event arguments that passed via NUIApplicationBatteryLow signal
201       *
202       */
203     internal class NUIApplicationBatteryLowEventArgs : EventArgs
204     {
205         private Application.BatteryStatus _status;
206         /**
207           * @brief Application - is the application that is being affected when the battery level of the device is low
208           *
209           */
210         public Application.BatteryStatus BatteryStatus
211         {
212             get
213             {
214                 return _status;
215             }
216             set
217             {
218                 _status = value;
219             }
220         }
221     }
222
223     /**
224       * @brief Event arguments that passed via NUIApplicationMemoryLow signal
225       *
226       */
227     internal class NUIApplicationMemoryLowEventArgs : EventArgs
228     {
229         private Application.MemoryStatus _status;
230         /**
231           * @brief Application - is the application that is being affected when the memory level of the device is low
232           *
233           */
234         public Application.MemoryStatus MemoryStatus
235         {
236             get
237             {
238                 return _status;
239             }
240             set
241             {
242                 _status = value;
243             }
244         }
245     }
246
247     /**
248       * @brief Event arguments that passed via NUIApplicationAppControl  signal
249       *
250       */
251     internal class NUIApplicationAppControlEventArgs : EventArgs
252     {
253         private Application _application;
254         private IntPtr _voidp;
255         /**
256           * @brief Application - is the application that is receiving the launch request from another application
257           *
258           */
259         public Application Application
260         {
261             get
262             {
263                 return _application;
264             }
265             set
266             {
267                 _application = value;
268             }
269         }
270         /**
271           * @brief VoidP - contains the information about why the application is launched
272           *
273           */
274         public IntPtr VoidP
275         {
276             get
277             {
278                 return _voidp;
279             }
280             set
281             {
282                 _voidp = value;
283             }
284         }
285     }
286
287     /// <summary>
288     /// A class to get resources in current application.
289     /// </summary>
290     public class GetResourcesProvider
291     {
292         /// <summary>
293         /// Get resources in current application.
294         /// </summary>
295         static public IResourcesProvider Get()
296         {
297             return Tizen.NUI.Application.Current;
298         }
299     }
300
301     internal class Application : BaseHandle, IResourcesProvider, IElementConfiguration<Application>
302     {
303
304         static Application s_current;
305
306         ReadOnlyCollection<Element> _logicalChildren;
307
308         static SemaphoreSlim SaveSemaphore = new SemaphoreSlim(1, 1);
309
310         [EditorBrowsable(EditorBrowsableState.Never)]
311         public static void SetCurrentApplication(Application value) => Current = value;
312
313         public static Application Current
314         {
315             get { return s_current; }
316             set
317             {
318                 if (s_current == value)
319                     return;
320                 if (value == null)
321                     s_current = null; //Allow to reset current for unittesting
322                 s_current = value;
323             }
324         }
325
326         internal override ReadOnlyCollection<Element> LogicalChildrenInternal
327         {
328             get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
329         }
330
331         internal IResourceDictionary SystemResources { get; }
332
333         ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>();
334
335         ResourceDictionary _resources;
336         public bool IsResourcesCreated => _resources != null;
337
338         public delegate void resChangeCb(object sender, ResourcesChangedEventArgs e);
339
340         static private Dictionary<object, Dictionary<resChangeCb, int>> resourceChangeCallbackDict = new Dictionary<object, Dictionary<resChangeCb, int>>();
341         static public void AddResourceChangedCallback(object handle, resChangeCb cb)
342         {
343             Dictionary<resChangeCb, int> cbDict;
344             resourceChangeCallbackDict.TryGetValue(handle, out cbDict);
345
346             if (null == cbDict)
347             {
348                 cbDict = new Dictionary<resChangeCb, int>();
349                 resourceChangeCallbackDict.Add(handle, cbDict);
350             }
351
352             if (false == cbDict.ContainsKey(cb))
353             {
354                 cbDict.Add(cb, 0);
355             }
356         }
357
358         internal override void OnResourcesChanged(object sender, ResourcesChangedEventArgs e)
359         {
360             base.OnResourcesChanged(sender, e);
361
362             foreach (KeyValuePair<object, Dictionary<resChangeCb, int>> resourcePair in resourceChangeCallbackDict)
363             {
364                 foreach (KeyValuePair<resChangeCb, int> cbPair in resourcePair.Value)
365                 {
366                     cbPair.Key(sender, e);
367                 }
368             }
369         }
370
371         public ResourceDictionary XamlResources
372         {
373             get
374             {
375                 if (_resources != null)
376                     return _resources;
377
378                 _resources = new ResourceDictionary();
379                 int hashCode = _resources.GetHashCode();
380                 ((IResourceDictionary)_resources).ValuesChanged += OnResourcesChanged;
381                 return _resources;
382             }
383             set
384             {
385                 if (_resources == value)
386                     return;
387                 OnPropertyChanging();
388
389                 if (_resources != null)
390                     ((IResourceDictionary)_resources).ValuesChanged -= OnResourcesChanged;
391                 _resources = value;
392                 OnResourcesChanged(value);
393                 if (_resources != null)
394                     ((IResourceDictionary)_resources).ValuesChanged += OnResourcesChanged;
395
396                 OnPropertyChanged();
397             }
398         }
399
400         protected override void OnParentSet()
401         {
402             throw new InvalidOperationException("Setting a Parent on Application is invalid.");
403         }
404
405         [EditorBrowsable(EditorBrowsableState.Never)]
406         public static bool IsApplicationOrNull(Element element)
407         {
408             return element == null || element is Application;
409         }
410
411         internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
412         {
413             if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0)
414             {
415                 base.OnParentResourcesChanged(values);
416                 return;
417             }
418
419             var innerKeys = new HashSet<string>();
420             var changedResources = new List<KeyValuePair<string, object>>();
421             foreach (KeyValuePair<string, object> c in XamlResources)
422                 innerKeys.Add(c.Key);
423             foreach (KeyValuePair<string, object> value in values)
424             {
425                 if (innerKeys.Add(value.Key))
426                     changedResources.Add(value);
427             }
428             OnResourcesChanged(changedResources);
429         }
430
431
432         internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Application_SWIGUpcast(cPtr), cMemoryOwn)
433         {
434             SetCurrentApplication(this);
435
436
437             s_current = this;
438         }
439
440         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj)
441         {
442             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
443         }
444
445         protected override void Dispose(DisposeTypes type)
446         {
447             if (disposed)
448             {
449                 return;
450             }
451
452             //Release your own unmanaged resources here.
453             //You should not access any managed member here except static instance.
454             //because the execution order of Finalizes is non-deterministic.
455
456             if (_applicationInitEventCallbackDelegate != null)
457             {
458                 this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
459             }
460
461             if (_applicationTerminateEventCallbackDelegate != null)
462             {
463                 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
464             }
465
466             if (_applicationPauseEventCallbackDelegate != null)
467             {
468                 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
469             }
470
471             if (_applicationResumeEventCallbackDelegate != null)
472             {
473                 this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
474             }
475
476             if (_applicationResetEventCallbackDelegate != null)
477             {
478                 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
479             }
480
481             if (_applicationLanguageChangedEventCallbackDelegate != null)
482             {
483                 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
484             }
485
486             if (_applicationRegionChangedEventCallbackDelegate != null)
487             {
488                 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
489             }
490
491             if (_applicationBatteryLowEventCallbackDelegate != null)
492             {
493                 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
494             }
495
496             if (_applicationMemoryLowEventCallbackDelegate != null)
497             {
498                 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
499             }
500
501             if (_applicationAppControlEventCallbackDelegate != null)
502             {
503                 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
504             }
505
506             base.Dispose(type);
507         }
508         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
509         {
510             Interop.Application.delete_Application(swigCPtr);
511         }
512
513         /// <since_tizen> 4 </since_tizen>
514         public enum BatteryStatus
515         {
516             Normal,
517             CriticallyLow,
518             PowerOff
519         };
520
521         /// <since_tizen> 4 </since_tizen>
522         public enum MemoryStatus
523         {
524             Normal,
525             Low,
526             CriticallyLow
527         };
528
529         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
530         private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
531         private DaliEventHandler<object, NUIApplicationInitEventArgs> _applicationInitEventHandler;
532         private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
533
534
535         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
536         private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
537         private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> _applicationTerminateEventHandler;
538         private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
539
540
541         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
542         private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
543         private DaliEventHandler<object, NUIApplicationPausedEventArgs> _applicationPauseEventHandler;
544         private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
545
546         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
547         private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
548         private DaliEventHandler<object, NUIApplicationResumedEventArgs> _applicationResumeEventHandler;
549         private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
550
551         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
552         private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
553         private DaliEventHandler<object, NUIApplicationResetEventArgs> _applicationResetEventHandler;
554         private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
555
556         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
557         private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
558         private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
559         private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
560
561
562         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
563         private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
564         private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
565         private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
566
567         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
568         private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status);
569         private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
570         private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
571
572         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
573         private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status);
574         private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
575         private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
576
577         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
578         private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
579         private DaliEventHandler<object, NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
580         private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
581
582         /**
583           * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
584           *  provided by the user. Initialized signal is emitted when application is initialised
585           */
586         public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
587         {
588             add
589             {
590                 lock (this)
591                 {
592                     // Restricted to only one listener
593                     if (_applicationInitEventHandler == null)
594                     {
595                         _applicationInitEventHandler += value;
596
597                         _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
598                         this.InitSignal().Connect(_applicationInitEventCallbackDelegate);
599                     }
600                 }
601             }
602
603             remove
604             {
605                 lock (this)
606                 {
607                     if (_applicationInitEventHandler != null)
608                     {
609                         this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
610                     }
611
612                     _applicationInitEventHandler -= value;
613                 }
614             }
615         }
616
617         // Callback for Application InitSignal
618         private void OnApplicationInit(IntPtr data)
619         {
620             // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
621             DisposeQueue.Instance.Initialize();
622
623             if (_applicationInitEventHandler != null)
624             {
625                 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
626                 e.Application = this;
627                 _applicationInitEventHandler.Invoke(this, e);
628             }
629
630         }
631
632         /**
633           * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
634           *  provided by the user. Terminated signal is emitted when application is terminating
635           */
636         public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
637         {
638             add
639             {
640                 lock (this)
641                 {
642                     // Restricted to only one listener
643                     if (_applicationTerminateEventHandler == null)
644                     {
645                         _applicationTerminateEventHandler += value;
646
647                         _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
648                         this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
649                     }
650                 }
651             }
652
653             remove
654             {
655                 lock (this)
656                 {
657                     if (_applicationTerminateEventHandler != null)
658                     {
659                         this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
660                     }
661
662                     _applicationTerminateEventHandler -= value;
663                 }
664             }
665         }
666
667         // Callback for Application TerminateSignal
668         private void OnNUIApplicationTerminate(IntPtr data)
669         {
670             if (_applicationTerminateEventHandler != null)
671             {
672                 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
673                 e.Application = this;
674                 _applicationTerminateEventHandler.Invoke(this, e);
675             }
676
677             List<Window> windows = GetWindowList();
678             foreach (Window window in windows)
679             {
680                 window?.DisconnectNativeSignals();
681             }
682         }
683
684         /**
685           * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
686           * provided by the user. Paused signal is emitted when application is paused
687           */
688         public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
689         {
690             add
691             {
692                 lock (this)
693                 {
694                     // Restricted to only one listener
695                     if (_applicationPauseEventHandler == null)
696                     {
697                         _applicationPauseEventHandler += value;
698
699                         _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
700                         this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
701                     }
702                 }
703             }
704
705             remove
706             {
707                 lock (this)
708                 {
709                     if (_applicationPauseEventHandler != null)
710                     {
711                         this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
712                     }
713
714                     _applicationPauseEventHandler -= value;
715                 }
716             }
717         }
718
719         // Callback for Application PauseSignal
720         private void OnNUIApplicationPause(IntPtr data)
721         {
722             if (_applicationPauseEventHandler != null)
723             {
724                 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
725                 e.Application = this;
726                 _applicationPauseEventHandler.Invoke(this, e);
727             }
728         }
729
730         /**
731           * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
732           *  provided by the user. Resumed signal is emitted when application is resumed
733           */
734         public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
735         {
736             add
737             {
738                 lock (this)
739                 {
740                     // Restricted to only one listener
741                     if (_applicationResumeEventHandler == null)
742                     {
743                         _applicationResumeEventHandler += value;
744
745                         _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
746                         this.ResumeSignal().Connect(_applicationResumeEventCallbackDelegate);
747                     }
748                 }
749             }
750
751             remove
752             {
753                 lock (this)
754                 {
755                     if (_applicationResumeEventHandler != null)
756                     {
757                         this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
758                     }
759
760                     _applicationResumeEventHandler -= value;
761                 }
762             }
763         }
764
765         // Callback for Application ResumeSignal
766         private void OnNUIApplicationResume(IntPtr data)
767         {
768             if (_applicationResumeEventHandler != null)
769             {
770                 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
771                 e.Application = this;
772                 _applicationResumeEventHandler.Invoke(this, e);
773             }
774         }
775
776         /**
777           * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
778           *  provided by the user. Reset signal is emitted when application is reset
779           */
780         public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
781         {
782             add
783             {
784                 lock (this)
785                 {
786                     // Restricted to only one listener
787                     if (_applicationResetEventHandler == null)
788                     {
789                         _applicationResetEventHandler += value;
790
791                         _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
792                         this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
793                     }
794                 }
795             }
796
797             remove
798             {
799                 lock (this)
800                 {
801                     if (_applicationResetEventHandler != null)
802                     {
803                         this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
804                     }
805
806                     _applicationResetEventHandler -= value;
807                 }
808             }
809         }
810
811         // Callback for Application ResetSignal
812         private void OnNUIApplicationReset(IntPtr data)
813         {
814             if (_applicationResetEventHandler != null)
815             {
816                 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
817                 e.Application = this;
818                 _applicationResetEventHandler.Invoke(this, e);
819             }
820         }
821
822         /**
823           * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
824           *  provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
825           */
826         public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
827         {
828             add
829             {
830                 lock (this)
831                 {
832                     // Restricted to only one listener
833                     if (_applicationLanguageChangedEventHandler == null)
834                     {
835                         _applicationLanguageChangedEventHandler += value;
836
837                         _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
838                         this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
839                     }
840                 }
841             }
842
843             remove
844             {
845                 lock (this)
846                 {
847                     if (_applicationLanguageChangedEventHandler != null)
848                     {
849                         this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
850                     }
851
852                     _applicationLanguageChangedEventHandler -= value;
853                 }
854             }
855         }
856
857         // Callback for Application LanguageChangedSignal
858         private void OnNUIApplicationLanguageChanged(IntPtr data)
859         {
860             if (_applicationLanguageChangedEventHandler != null)
861             {
862                 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
863                 e.Application = this;
864                 _applicationLanguageChangedEventHandler.Invoke(this, e);
865             }
866         }
867
868         /**
869           * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
870           *  provided by the user. RegionChanged signal is emitted when the region of the device is changed.
871           */
872         public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
873         {
874             add
875             {
876                 lock (this)
877                 {
878                     // Restricted to only one listener
879                     if (_applicationRegionChangedEventHandler == null)
880                     {
881                         _applicationRegionChangedEventHandler += value;
882
883                         _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
884                         this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
885                     }
886                 }
887             }
888
889             remove
890             {
891                 lock (this)
892                 {
893                     if (_applicationRegionChangedEventHandler != null)
894                     {
895                         this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
896                     }
897
898                     _applicationRegionChangedEventHandler -= value;
899                 }
900             }
901         }
902
903         // Callback for Application RegionChangedSignal
904         private void OnNUIApplicationRegionChanged(IntPtr data)
905         {
906             if (_applicationRegionChangedEventHandler != null)
907             {
908                 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
909                 e.Application = this;
910                 _applicationRegionChangedEventHandler.Invoke(this, e);
911             }
912         }
913
914         /**
915           * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
916           * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
917           */
918         public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
919         {
920             add
921             {
922                 lock (this)
923                 {
924                     // Restricted to only one listener
925                     if (_applicationBatteryLowEventHandler == null)
926                     {
927                         _applicationBatteryLowEventHandler += value;
928
929                         _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
930                         this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
931                     }
932                 }
933             }
934
935             remove
936             {
937                 lock (this)
938                 {
939                     if (_applicationBatteryLowEventHandler != null)
940                     {
941                         this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
942                     }
943
944                     _applicationBatteryLowEventHandler -= value;
945                 }
946             }
947         }
948
949         // Callback for Application BatteryLowSignal
950         private void OnNUIApplicationBatteryLow(BatteryStatus status)
951         {
952             lock (this)
953             {
954                 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
955
956                 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
957                 e.BatteryStatus = status;
958                 _applicationBatteryLowEventHandler?.Invoke(this, e);
959             }
960         }
961
962         /**
963           * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
964           *  provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
965           */
966         public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
967         {
968             add
969             {
970                 lock (this)
971                 {
972                     // Restricted to only one listener
973                     if (_applicationMemoryLowEventHandler == null)
974                     {
975                         _applicationMemoryLowEventHandler += value;
976
977                         _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
978                         this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
979                     }
980                 }
981             }
982
983             remove
984             {
985                 lock (this)
986                 {
987                     if (_applicationMemoryLowEventHandler != null)
988                     {
989                         this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
990                     }
991
992                     _applicationMemoryLowEventHandler -= value;
993                 }
994             }
995         }
996
997         // Callback for Application MemoryLowSignal
998         private void OnNUIApplicationMemoryLow(MemoryStatus status)
999         {
1000             lock (this)
1001             {
1002                 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1003
1004                 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1005                 e.MemoryStatus = status;
1006                 _applicationMemoryLowEventHandler?.Invoke(this, e);
1007             }
1008         }
1009
1010         /**
1011           * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
1012           *  provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
1013           */
1014         public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
1015         {
1016             add
1017             {
1018                 lock (this)
1019                 {
1020                     // Restricted to only one listener
1021                     if (_applicationAppControlEventHandler == null)
1022                     {
1023                         _applicationAppControlEventHandler += value;
1024
1025                         _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1026                         this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
1027                     }
1028                 }
1029             }
1030
1031             remove
1032             {
1033                 lock (this)
1034                 {
1035                     if (_applicationAppControlEventHandler != null)
1036                     {
1037                         this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
1038                     }
1039
1040                     _applicationAppControlEventHandler -= value;
1041                 }
1042             }
1043         }
1044
1045         // Callback for Application AppControlSignal
1046         private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1047         {
1048             if (_applicationAppControlEventHandler != null)
1049             {
1050                 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1051                 e.VoidP = voidp;
1052                 e.Application = this;
1053                 _applicationAppControlEventHandler.Invoke(this, e);
1054             }
1055         }
1056
1057         protected static Application _instance; // singleton
1058
1059         public static Application Instance
1060         {
1061             get
1062             {
1063                 return _instance;
1064             }
1065         }
1066
1067         public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1068         {
1069             if (cPtr == global::System.IntPtr.Zero)
1070             {
1071                 return null;
1072             }
1073
1074             Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1075             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1076             return ret;
1077         }
1078
1079         public static Application NewApplication()
1080         {
1081             return NewApplication("", Application.WindowMode.Opaque);
1082         }
1083
1084         public static Application NewApplication(string stylesheet)
1085         {
1086             return NewApplication(stylesheet, Application.WindowMode.Opaque);
1087         }
1088
1089         public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
1090         {
1091             // register all Views with the type registry, so that can be created / styled via JSON
1092             //ViewRegistryHelper.Initialize(); //moved to Application side.
1093             if (_instance)
1094             {
1095                 return _instance;
1096             }
1097
1098             Application ret = New(1, stylesheet, windowMode);
1099             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1100
1101             // set the singleton
1102             _instance = ret;
1103             return ret;
1104         }
1105
1106         public static Application NewApplication(string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1107         {
1108             if (_instance)
1109             {
1110                 return _instance;
1111             }
1112             Application ret = New(1, stylesheet, windowMode, positionSize);
1113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1114
1115             // set the singleton
1116             _instance = ret;
1117             return ret;
1118         }
1119
1120         public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
1121         {
1122             if (_instance)
1123             {
1124                 return _instance;
1125             }
1126             Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
1127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1128
1129             // set the singleton
1130             _instance = ret;
1131             return _instance;
1132         }
1133
1134         public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1135         {
1136             if (_instance)
1137             {
1138                 return _instance;
1139             }
1140             Application ret = New(args, stylesheet, (Application.WindowMode)windowMode, positionSize);
1141             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1142
1143             // set the singleton
1144             _instance = ret;
1145             return _instance;
1146         }
1147
1148         /// <summary>
1149         /// Ensures that the function passed in is called from the main loop when it is idle.
1150         /// </summary>
1151         /// <param name="func">The function to call</param>
1152         /// <returns>true if added successfully, false otherwise</returns>
1153         public bool AddIdle(System.Delegate func)
1154         {
1155             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1156             System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1157
1158             bool ret = Interop.Application.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1159
1160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1161             return ret;
1162         }
1163
1164         /**
1165         * Outer::outer_method(int)
1166         */
1167         public static Application New()
1168         {
1169             Application ret = new Application(Interop.Application.Application_New__SWIG_0(), true);
1170             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1171             return ret;
1172         }
1173
1174         public static Application New(int argc)
1175         {
1176             Application ret = new Application(Interop.Application.Application_New__SWIG_1(argc), true);
1177             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1178             return ret;
1179         }
1180
1181         public static Application New(int argc, string stylesheet)
1182         {
1183             Application ret = new Application(Interop.Application.Application_New__SWIG_2(argc, stylesheet), true);
1184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1185             return ret;
1186         }
1187
1188         public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
1189         {
1190             Application ret = new Application(Interop.Application.Application_New__SWIG_3(argc, stylesheet, (int)windowMode), true);
1191             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1192             s_current = ret;
1193             return ret;
1194         }
1195
1196         public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode)
1197         {
1198             Application ret = null;
1199             int argc = 0;
1200             string argvStr = "";
1201             try
1202             {
1203                 argc = args.Length;
1204                 argvStr = string.Join(" ", args);
1205             }
1206             catch (Exception exception)
1207             {
1208                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, msg : " + exception.Message);
1209                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1210                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1211                 throw;
1212             }
1213
1214             ret = new Application(NDalicPINVOKE.Application_New__MANUAL_4(argc, argvStr, stylesheet, (int)windowMode), true);
1215             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1216
1217             return ret;
1218         }
1219
1220         public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1221         {
1222             Application ret = new Application(Interop.Application.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1223             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1224             return ret;
1225         }
1226
1227         public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1228         {
1229             Application ret = null;
1230             int argc = 0;
1231             string argvStr = "";
1232             try
1233             {
1234                 argc = args.Length;
1235                 argvStr = string.Join(" ", args);
1236             }
1237             catch (Exception exception)
1238             {
1239                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, msg : " + exception.Message);
1240                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1241                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1242                 throw;
1243             }
1244
1245             ret = new Application(NDalicPINVOKE.Application_New_WithWindowSizePosition(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1246             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1247
1248             return ret;
1249         }
1250
1251         public Application() : this(Interop.Application.new_Application__SWIG_0(), true)
1252         {
1253             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1254         }
1255
1256         public Application(Application application) : this(Interop.Application.new_Application__SWIG_1(Application.getCPtr(application)), true)
1257         {
1258             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1259         }
1260
1261         public Application Assign(Application application)
1262         {
1263             Application ret = new Application(Interop.Application.Application_Assign(swigCPtr, Application.getCPtr(application)), false);
1264             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1265             return ret;
1266         }
1267
1268         public void MainLoop()
1269         {
1270             NDalicPINVOKE.Application_MainLoop__SWIG_0(swigCPtr);
1271             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1272         }
1273
1274         public void Lower()
1275         {
1276             Interop.Application.Application_Lower(swigCPtr);
1277             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1278         }
1279
1280         public void Quit()
1281         {
1282             Interop.Application.Application_Quit(swigCPtr);
1283             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1284         }
1285
1286         internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1287         {
1288             bool ret = Interop.Application.Application_AddIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1289             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1290             return ret;
1291         }
1292
1293         public Window GetWindow()
1294         {
1295             Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.Application_GetWindow(swigCPtr)) as Window;
1296             if (ret == null)
1297             {
1298                 ret = new Window(Interop.Application.Application_GetWindow(swigCPtr), true);
1299             }
1300
1301             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1302             return ret;
1303         }
1304
1305         public static string GetResourcePath()
1306         {
1307             string ret = Interop.Application.Application_GetResourcePath();
1308             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1309             return ret;
1310         }
1311
1312         public string GetLanguage()
1313         {
1314             string ret = Interop.Application.Application_GetLanguage(swigCPtr);
1315             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1316             return ret;
1317         }
1318
1319         public string GetRegion()
1320         {
1321             string ret = Interop.Application.Application_GetRegion(swigCPtr);
1322             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1323             return ret;
1324         }
1325
1326         [EditorBrowsable(EditorBrowsableState.Never)]
1327         public static List<Window> GetWindowList()
1328         {
1329             uint ListSize = Interop.Application.Application_GetWindowsListSize();
1330             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1331
1332             List<Window> WindowList = new List<Window>();
1333             for (uint i = 0; i < ListSize; ++i)
1334             {
1335                 Window currWin = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.Application_GetWindowsFromList(i)) as Window;
1336                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1337                 if (currWin)
1338                 {
1339                     WindowList.Add(currWin);
1340                 }
1341             }
1342             return WindowList;
1343         }
1344
1345         internal ApplicationSignal InitSignal()
1346         {
1347             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_InitSignal(swigCPtr), false);
1348             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1349             return ret;
1350         }
1351
1352         internal ApplicationSignal TerminateSignal()
1353         {
1354             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_TerminateSignal(swigCPtr), false);
1355             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1356             return ret;
1357         }
1358
1359         internal ApplicationSignal PauseSignal()
1360         {
1361             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_PauseSignal(swigCPtr), false);
1362             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1363             return ret;
1364         }
1365
1366         internal ApplicationSignal ResumeSignal()
1367         {
1368             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResumeSignal(swigCPtr), false);
1369             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1370             return ret;
1371         }
1372
1373         internal ApplicationSignal ResetSignal()
1374         {
1375             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResetSignal(swigCPtr), false);
1376             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1377             return ret;
1378         }
1379
1380         internal ApplicationControlSignal AppControlSignal()
1381         {
1382             ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.Application_AppControlSignal(swigCPtr), false);
1383             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1384             return ret;
1385         }
1386
1387         internal ApplicationSignal LanguageChangedSignal()
1388         {
1389             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_LanguageChangedSignal(swigCPtr), false);
1390             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1391             return ret;
1392         }
1393
1394         internal ApplicationSignal RegionChangedSignal()
1395         {
1396             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_RegionChangedSignal(swigCPtr), false);
1397             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1398             return ret;
1399         }
1400
1401         internal LowBatterySignalType BatteryLowSignal()
1402         {
1403             LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.Application_LowBatterySignal(swigCPtr), false);
1404             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1405             return ret;
1406         }
1407
1408         internal LowMemorySignalType MemoryLowSignal()
1409         {
1410             LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.Application_LowMemorySignal(swigCPtr), false);
1411             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1412             return ret;
1413         }
1414
1415         /// <since_tizen> 3 </since_tizen>
1416         public enum WindowMode
1417         {
1418             Opaque = 0,
1419             Transparent = 1
1420         }
1421     }
1422 }