c1f958efc85f72d25c6e1eb060f397c81dcdff4d
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Application / 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 sealed 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         [EditorBrowsable(EditorBrowsableState.Never)]
309         public static void SetCurrentApplication(Application value) => Current = value;
310
311         public static Application Current
312         {
313             get { return s_current; }
314             set
315             {
316                 if (s_current == value)
317                     return;
318                 if (value == null)
319                     s_current = null; //Allow to reset current for unittesting
320                 s_current = value;
321             }
322         }
323
324         internal override ReadOnlyCollection<Element> LogicalChildrenInternal
325         {
326             get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
327         }
328
329         internal IResourceDictionary SystemResources { get; }
330
331         ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>();
332
333         ResourceDictionary _resources;
334         public bool IsResourcesCreated => _resources != null;
335
336         public delegate void resChangeCb(object sender, ResourcesChangedEventArgs e);
337
338         static private Dictionary<object, Dictionary<resChangeCb, int>> resourceChangeCallbackDict = new Dictionary<object, Dictionary<resChangeCb, int>>();
339         static public void AddResourceChangedCallback(object handle, resChangeCb cb)
340         {
341             Dictionary<resChangeCb, int> cbDict;
342             resourceChangeCallbackDict.TryGetValue(handle, out cbDict);
343
344             if (null == cbDict)
345             {
346                 cbDict = new Dictionary<resChangeCb, int>();
347                 resourceChangeCallbackDict.Add(handle, cbDict);
348             }
349
350             if (false == cbDict.ContainsKey(cb))
351             {
352                 cbDict.Add(cb, 0);
353             }
354         }
355
356         internal override void OnResourcesChanged(object sender, ResourcesChangedEventArgs e)
357         {
358             base.OnResourcesChanged(sender, e);
359
360             foreach (KeyValuePair<object, Dictionary<resChangeCb, int>> resourcePair in resourceChangeCallbackDict)
361             {
362                 foreach (KeyValuePair<resChangeCb, int> cbPair in resourcePair.Value)
363                 {
364                     cbPair.Key(sender, e);
365                 }
366             }
367         }
368
369         public ResourceDictionary XamlResources
370         {
371             get
372             {
373                 if (_resources != null)
374                     return _resources;
375
376                 _resources = new ResourceDictionary();
377                 int hashCode = _resources.GetHashCode();
378                 ((IResourceDictionary)_resources).ValuesChanged += OnResourcesChanged;
379                 return _resources;
380             }
381             set
382             {
383                 if (_resources == value)
384                     return;
385                 OnPropertyChanging();
386
387                 if (_resources != null)
388                     ((IResourceDictionary)_resources).ValuesChanged -= OnResourcesChanged;
389                 _resources = value;
390                 OnResourcesChanged(value);
391                 if (_resources != null)
392                     ((IResourceDictionary)_resources).ValuesChanged += OnResourcesChanged;
393
394                 OnPropertyChanged();
395             }
396         }
397
398         protected override void OnParentSet()
399         {
400             throw new InvalidOperationException("Setting a Parent on Application is invalid.");
401         }
402
403         [EditorBrowsable(EditorBrowsableState.Never)]
404         public static bool IsApplicationOrNull(Element element)
405         {
406             return element == null || element is Application;
407         }
408
409         internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
410         {
411             if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0)
412             {
413                 base.OnParentResourcesChanged(values);
414                 return;
415             }
416
417             var innerKeys = new HashSet<string>();
418             var changedResources = new List<KeyValuePair<string, object>>();
419             foreach (KeyValuePair<string, object> c in XamlResources)
420                 innerKeys.Add(c.Key);
421             foreach (KeyValuePair<string, object> value in values)
422             {
423                 if (innerKeys.Add(value.Key))
424                     changedResources.Add(value);
425             }
426             OnResourcesChanged(changedResources);
427         }
428
429
430         internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
431         {
432             SetCurrentApplication(this);
433
434
435             s_current = this;
436         }
437
438         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj)
439         {
440             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
441         }
442
443         protected override void Dispose(DisposeTypes type)
444         {
445             if (disposed)
446             {
447                 return;
448             }
449
450             //Release your own unmanaged resources here.
451             //You should not access any managed member here except static instance.
452             //because the execution order of Finalizes is non-deterministic.
453
454             if (_applicationInitEventCallbackDelegate != null)
455             {
456                 initSignal?.Disconnect(_applicationInitEventCallbackDelegate);
457                 initSignal?.Dispose();
458                 initSignal = null;
459             }
460
461             if (_applicationTerminateEventCallbackDelegate != null)
462             {
463                 terminateSignal?.Disconnect(_applicationTerminateEventCallbackDelegate);
464                 terminateSignal?.Dispose();
465                 terminateSignal = null;
466             }
467
468             if (_applicationPauseEventCallbackDelegate != null)
469             {
470                 pauseSignal?.Disconnect(_applicationPauseEventCallbackDelegate);
471                 pauseSignal?.Dispose();
472                 pauseSignal = null;
473             }
474
475             if (_applicationResumeEventCallbackDelegate != null)
476             {
477                 resumeSignal?.Disconnect(_applicationResumeEventCallbackDelegate);
478                 resumeSignal?.Dispose();
479                 resumeSignal = null;
480             }
481
482             if (_applicationResetEventCallbackDelegate != null)
483             {
484                 resetSignal?.Disconnect(_applicationResetEventCallbackDelegate);
485                 resetSignal?.Dispose();
486                 resetSignal = null;
487             }
488
489             if (_applicationLanguageChangedEventCallbackDelegate != null)
490             {
491                 languageChangedSignal?.Disconnect(_applicationLanguageChangedEventCallbackDelegate);
492                 languageChangedSignal?.Dispose();
493                 languageChangedSignal = null;
494             }
495
496             if (_applicationRegionChangedEventCallbackDelegate != null)
497             {
498                 regionChangedSignal?.Disconnect(_applicationRegionChangedEventCallbackDelegate);
499                 regionChangedSignal?.Dispose();
500                 regionChangedSignal = null;
501             }
502
503             if (_applicationBatteryLowEventCallbackDelegate != null)
504             {
505                 batteryLowSignal?.Disconnect(_applicationBatteryLowEventCallbackDelegate);
506                 batteryLowSignal?.Dispose();
507                 batteryLowSignal = null;
508             }
509
510             if (_applicationMemoryLowEventCallbackDelegate != null)
511             {
512                 memoryLowSignal?.Disconnect(_applicationMemoryLowEventCallbackDelegate);
513                 memoryLowSignal?.Dispose();
514                 memoryLowSignal = null;
515             }
516
517             if (_applicationAppControlEventCallbackDelegate != null)
518             {
519                 appControlSignal?.Disconnect(_applicationAppControlEventCallbackDelegate);
520                 appControlSignal?.Dispose();
521                 appControlSignal = null;
522             }
523
524             win?.Dispose();
525             win = null;
526
527             base.Dispose(type);
528         }
529         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
530         {
531             Interop.Application.DeleteApplication(swigCPtr);
532         }
533
534         public enum BatteryStatus
535         {
536             Normal,
537             CriticallyLow,
538             PowerOff
539         };
540
541         public enum MemoryStatus
542         {
543             Normal,
544             Low,
545             CriticallyLow
546         };
547
548         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
549         private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
550         private DaliEventHandler<object, NUIApplicationInitEventArgs> _applicationInitEventHandler;
551         private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
552         private ApplicationSignal initSignal;
553
554
555         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
556         private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
557         private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> _applicationTerminateEventHandler;
558         private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
559         private ApplicationSignal terminateSignal;
560
561
562         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
563         private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
564         private DaliEventHandler<object, NUIApplicationPausedEventArgs> _applicationPauseEventHandler;
565         private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
566         private ApplicationSignal pauseSignal;
567
568         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
569         private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
570         private DaliEventHandler<object, NUIApplicationResumedEventArgs> _applicationResumeEventHandler;
571         private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
572         private ApplicationSignal resumeSignal;
573
574         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
575         private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
576         private DaliEventHandler<object, NUIApplicationResetEventArgs> _applicationResetEventHandler;
577         private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
578         private ApplicationSignal resetSignal;
579
580         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
581         private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
582         private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
583         private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
584         private ApplicationSignal languageChangedSignal;
585
586
587         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
588         private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
589         private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
590         private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
591         private ApplicationSignal regionChangedSignal;
592
593         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
594         private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status);
595         private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
596         private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
597         private LowBatterySignalType batteryLowSignal;
598
599         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
600         private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status);
601         private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
602         private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
603         private LowMemorySignalType memoryLowSignal;
604
605         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
606         private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
607         private DaliEventHandler<object, NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
608         private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
609         private ApplicationControlSignal appControlSignal;
610
611         private Window win;
612
613         /**
614           * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
615           *  provided by the user. Initialized signal is emitted when application is initialised
616           */
617         public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
618         {
619             add
620             {
621                 // Restricted to only one listener
622                 if (_applicationInitEventHandler == null)
623                 {
624                     _applicationInitEventHandler += value;
625                     _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
626                     initSignal = this.InitSignal();
627                     initSignal?.Connect(_applicationInitEventCallbackDelegate);
628                 }
629             }
630
631             remove
632             {
633                 if (_applicationInitEventHandler != null)
634                 {
635                     initSignal?.Disconnect(_applicationInitEventCallbackDelegate);
636                     initSignal?.Dispose();
637                     initSignal = null;
638                 }
639
640                 _applicationInitEventHandler -= value;
641             }
642         }
643
644         // Callback for Application InitSignal
645         private void OnApplicationInit(IntPtr data)
646         {
647             // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
648             DisposeQueue.Instance.Initialize();
649
650             // Notify that the window is displayed to the app core.
651             if (NUIApplication.IsPreLoad)
652             {
653                 Window.Instance.Show();
654             }
655
656             if (_applicationInitEventHandler != null)
657             {
658                 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
659                 e.Application = this;
660                 _applicationInitEventHandler.Invoke(this, e);
661             }
662
663         }
664
665         /**
666           * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
667           *  provided by the user. Terminated signal is emitted when application is terminating
668           */
669         public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
670         {
671             add
672             {
673                 // Restricted to only one listener
674                 if (_applicationTerminateEventHandler == null)
675                 {
676                     _applicationTerminateEventHandler += value;
677
678                     _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
679                     terminateSignal = this.TerminateSignal();
680                     terminateSignal?.Connect(_applicationTerminateEventCallbackDelegate);
681                 }
682             }
683
684             remove
685             {
686                 if (_applicationTerminateEventHandler != null)
687                 {
688                     terminateSignal?.Disconnect(_applicationTerminateEventCallbackDelegate);
689                     terminateSignal?.Dispose();
690                     terminateSignal = null;
691                 }
692
693                 _applicationTerminateEventHandler -= value;
694             }
695         }
696
697         // Callback for Application TerminateSignal
698         private void OnNUIApplicationTerminate(IntPtr data)
699         {
700             if (_applicationTerminateEventHandler != null)
701             {
702                 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
703                 e.Application = this;
704                 _applicationTerminateEventHandler.Invoke(this, e);
705             }
706
707             List<Window> windows = GetWindowList();
708             foreach (Window window in windows)
709             {
710                 window?.DisconnectNativeSignals();
711             }
712         }
713
714         /**
715           * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
716           * provided by the user. Paused signal is emitted when application is paused
717           */
718         public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
719         {
720             add
721             {
722                 // Restricted to only one listener
723                 if (_applicationPauseEventHandler == null)
724                 {
725                     _applicationPauseEventHandler += value;
726
727                     _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
728                     pauseSignal = this.PauseSignal();
729                     pauseSignal?.Connect(_applicationPauseEventCallbackDelegate);
730                 }
731             }
732
733             remove
734             {
735                 if (_applicationPauseEventHandler != null)
736                 {
737                     pauseSignal?.Disconnect(_applicationPauseEventCallbackDelegate);
738                     pauseSignal?.Dispose();
739                     pauseSignal = null;
740                 }
741
742                 _applicationPauseEventHandler -= value;
743             }
744         }
745
746         // Callback for Application PauseSignal
747         private void OnNUIApplicationPause(IntPtr data)
748         {
749             if (_applicationPauseEventHandler != null)
750             {
751                 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
752                 e.Application = this;
753                 _applicationPauseEventHandler.Invoke(this, e);
754             }
755         }
756
757         /**
758           * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
759           *  provided by the user. Resumed signal is emitted when application is resumed
760           */
761         public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
762         {
763             add
764             {
765                 // Restricted to only one listener
766                 if (_applicationResumeEventHandler == null)
767                 {
768                     _applicationResumeEventHandler += value;
769
770                     _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
771                     resumeSignal = this.ResumeSignal();
772                     resumeSignal?.Connect(_applicationResumeEventCallbackDelegate);
773                 }
774             }
775
776             remove
777             {
778                 if (_applicationResumeEventHandler != null)
779                 {
780                     resumeSignal?.Disconnect(_applicationResumeEventCallbackDelegate);
781                     resumeSignal?.Dispose();
782                     resumeSignal = null;
783                 }
784
785                 _applicationResumeEventHandler -= value;
786             }
787         }
788
789         // Callback for Application ResumeSignal
790         private void OnNUIApplicationResume(IntPtr data)
791         {
792             if (_applicationResumeEventHandler != null)
793             {
794                 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
795                 e.Application = this;
796                 _applicationResumeEventHandler.Invoke(this, e);
797             }
798         }
799
800         /**
801           * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
802           *  provided by the user. Reset signal is emitted when application is reset
803           */
804         public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
805         {
806             add
807             {
808                 // Restricted to only one listener
809                 if (_applicationResetEventHandler == null)
810                 {
811                     _applicationResetEventHandler += value;
812
813                     _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
814                     resetSignal = this.ResetSignal();
815                     resetSignal?.Connect(_applicationResetEventCallbackDelegate);
816                 }
817             }
818
819             remove
820             {
821                 if (_applicationResetEventHandler != null)
822                 {
823                     resetSignal?.Disconnect(_applicationResetEventCallbackDelegate);
824                     resetSignal?.Dispose();
825                     resetSignal = null;
826                 }
827
828                 _applicationResetEventHandler -= value;
829             }
830         }
831
832         // Callback for Application ResetSignal
833         private void OnNUIApplicationReset(IntPtr data)
834         {
835             if (_applicationResetEventHandler != null)
836             {
837                 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
838                 e.Application = this;
839                 _applicationResetEventHandler.Invoke(this, e);
840             }
841         }
842
843         /**
844           * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
845           *  provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
846           */
847         public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
848         {
849             add
850             {
851                 // Restricted to only one listener
852                 if (_applicationLanguageChangedEventHandler == null)
853                 {
854                     _applicationLanguageChangedEventHandler += value;
855
856                     _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
857                     languageChangedSignal = this.LanguageChangedSignal();
858                     languageChangedSignal?.Connect(_applicationLanguageChangedEventCallbackDelegate);
859                 }
860             }
861
862             remove
863             {
864                 if (_applicationLanguageChangedEventHandler != null)
865                 {
866                     languageChangedSignal?.Disconnect(_applicationLanguageChangedEventCallbackDelegate);
867                     languageChangedSignal?.Dispose();
868                     languageChangedSignal = null;
869                 }
870
871                 _applicationLanguageChangedEventHandler -= value;
872             }
873         }
874
875         // Callback for Application LanguageChangedSignal
876         private void OnNUIApplicationLanguageChanged(IntPtr data)
877         {
878             if (_applicationLanguageChangedEventHandler != null)
879             {
880                 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
881                 e.Application = this;
882                 _applicationLanguageChangedEventHandler.Invoke(this, e);
883             }
884         }
885
886         /**
887           * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
888           *  provided by the user. RegionChanged signal is emitted when the region of the device is changed.
889           */
890         public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
891         {
892             add
893             {
894                 // Restricted to only one listener
895                 if (_applicationRegionChangedEventHandler == null)
896                 {
897                     _applicationRegionChangedEventHandler += value;
898
899                     _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
900                     regionChangedSignal = this.RegionChangedSignal();
901                     regionChangedSignal?.Connect(_applicationRegionChangedEventCallbackDelegate);
902                 }
903             }
904
905             remove
906             {
907                 if (_applicationRegionChangedEventHandler != null)
908                 {
909                     regionChangedSignal?.Disconnect(_applicationRegionChangedEventCallbackDelegate);
910                     regionChangedSignal?.Dispose();
911                     regionChangedSignal = null;
912                 }
913
914                 _applicationRegionChangedEventHandler -= value;
915             }
916         }
917
918         // Callback for Application RegionChangedSignal
919         private void OnNUIApplicationRegionChanged(IntPtr data)
920         {
921             if (_applicationRegionChangedEventHandler != null)
922             {
923                 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
924                 e.Application = this;
925                 _applicationRegionChangedEventHandler.Invoke(this, e);
926             }
927         }
928
929         /**
930           * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
931           * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
932           */
933         public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
934         {
935             add
936             {
937                 // Restricted to only one listener
938                 if (_applicationBatteryLowEventHandler == null)
939                 {
940                     _applicationBatteryLowEventHandler += value;
941
942                     _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
943                     batteryLowSignal = this.BatteryLowSignal();
944                     batteryLowSignal?.Connect(_applicationBatteryLowEventCallbackDelegate);
945                 }
946             }
947
948             remove
949             {
950                 if (_applicationBatteryLowEventHandler != null)
951                 {
952                     batteryLowSignal?.Disconnect(_applicationBatteryLowEventCallbackDelegate);
953                     batteryLowSignal?.Dispose();
954                     batteryLowSignal = null;
955                 }
956
957                 _applicationBatteryLowEventHandler -= value;
958             }
959         }
960
961         // Callback for Application BatteryLowSignal
962         private void OnNUIApplicationBatteryLow(BatteryStatus status)
963         {
964             NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
965
966             // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
967             e.BatteryStatus = status;
968             _applicationBatteryLowEventHandler?.Invoke(this, e);
969         }
970
971         /**
972           * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
973           *  provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
974           */
975         public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
976         {
977             add
978             {
979                 // Restricted to only one listener
980                 if (_applicationMemoryLowEventHandler == null)
981                 {
982                     _applicationMemoryLowEventHandler += value;
983
984                     _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
985                     memoryLowSignal = this.MemoryLowSignal();
986                     memoryLowSignal?.Connect(_applicationMemoryLowEventCallbackDelegate);
987                 }
988             }
989
990             remove
991             {
992                 if (_applicationMemoryLowEventHandler != null)
993                 {
994                     memoryLowSignal?.Disconnect(_applicationMemoryLowEventCallbackDelegate);
995                     memoryLowSignal?.Dispose();
996                     memoryLowSignal = null;
997                 }
998
999                 _applicationMemoryLowEventHandler -= value;
1000             }
1001         }
1002
1003         // Callback for Application MemoryLowSignal
1004         private void OnNUIApplicationMemoryLow(MemoryStatus status)
1005         {
1006             NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1007
1008             // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1009             e.MemoryStatus = status;
1010             _applicationMemoryLowEventHandler?.Invoke(this, e);
1011         }
1012
1013         /**
1014           * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
1015           *  provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
1016           */
1017         public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
1018         {
1019             add
1020             {
1021                 // Restricted to only one listener
1022                 if (_applicationAppControlEventHandler == null)
1023                 {
1024                     _applicationAppControlEventHandler += value;
1025
1026                     _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1027                     appControlSignal = this.AppControlSignal();
1028                     appControlSignal?.Connect(_applicationAppControlEventCallbackDelegate);
1029                 }
1030             }
1031
1032             remove
1033             {
1034                 if (_applicationAppControlEventHandler != null)
1035                 {
1036                     appControlSignal?.Disconnect(_applicationAppControlEventCallbackDelegate);
1037                     appControlSignal?.Dispose();
1038                     appControlSignal = null;
1039                 }
1040
1041                 _applicationAppControlEventHandler -= value;
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.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.New(), 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.New(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.New(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.New(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.ApplicationNewManual4(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.New(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.ApplicationNewWithWindowSizePosition(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.NewApplication(), true)
1252         {
1253             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1254         }
1255
1256         public Application(Application application) : this(Interop.Application.NewApplication(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.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.ApplicationMainLoop(SwigCPtr);
1271             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1272         }
1273
1274         public void Lower()
1275         {
1276             Interop.Application.Lower(SwigCPtr);
1277             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1278         }
1279
1280         public void Quit()
1281         {
1282             Interop.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.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             win = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindow(SwigCPtr)) as Window;
1296             if (win == null)
1297             {
1298                 win = new Window(Interop.Application.GetWindow(SwigCPtr), true);
1299             }
1300
1301             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1302             return win;
1303         }
1304
1305         public static string GetResourcePath()
1306         {
1307             string ret = Interop.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.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.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.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.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.ApplicationInitSignal(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.ApplicationTerminateSignal(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.ApplicationPauseSignal(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.ApplicationResumeSignal(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.ApplicationResetSignal(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.ApplicationAppControlSignal(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.ApplicationLanguageChangedSignal(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.ApplicationRegionChangedSignal(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.ApplicationLowBatterySignal(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.ApplicationLowMemorySignal(SwigCPtr), false);
1411             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1412             return ret;
1413         }
1414
1415         public enum WindowMode
1416         {
1417             Opaque = 0,
1418             Transparent = 1
1419         }
1420     }
1421 }