[NUI] Fix build warning & clean code [CA1051]
[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 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(NDalicPINVOKE.ApplicationUpcast(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                 ApplicationSignal initSignal = this.InitSignal();
457                 initSignal?.Disconnect(_applicationInitEventCallbackDelegate);
458                 initSignal?.Dispose();
459             }
460
461             if (_applicationTerminateEventCallbackDelegate != null)
462             {
463                 ApplicationSignal terminateSignal = this.TerminateSignal();
464                 terminateSignal?.Disconnect(_applicationTerminateEventCallbackDelegate);
465                 terminateSignal?.Dispose();
466             }
467
468             if (_applicationPauseEventCallbackDelegate != null)
469             {
470                 ApplicationSignal pauseSignal = this.PauseSignal();
471                 pauseSignal?.Disconnect(_applicationPauseEventCallbackDelegate);
472                 pauseSignal?.Dispose();
473             }
474
475             if (_applicationResumeEventCallbackDelegate != null)
476             {
477                 ApplicationSignal resumeSignal = this.ResumeSignal();
478                 resumeSignal?.Disconnect(_applicationResumeEventCallbackDelegate);
479                 resumeSignal?.Dispose();
480             }
481
482             if (_applicationResetEventCallbackDelegate != null)
483             {
484                 ApplicationSignal resetSignal = this.ResetSignal();
485                 resetSignal?.Disconnect(_applicationResetEventCallbackDelegate);
486                 resetSignal?.Dispose();
487             }
488
489             if (_applicationLanguageChangedEventCallbackDelegate != null)
490             {
491                 ApplicationSignal languageChangedSignal = this.LanguageChangedSignal();
492                 languageChangedSignal?.Disconnect(_applicationLanguageChangedEventCallbackDelegate);
493                 languageChangedSignal?.Dispose();
494             }
495
496             if (_applicationRegionChangedEventCallbackDelegate != null)
497             {
498                 ApplicationSignal regionChangedSignal = this.RegionChangedSignal();
499                 regionChangedSignal?.Disconnect(_applicationRegionChangedEventCallbackDelegate);
500                 regionChangedSignal?.Dispose();
501             }
502
503             if (_applicationBatteryLowEventCallbackDelegate != null)
504             {
505                 LowBatterySignalType batteryLowSignal = this.BatteryLowSignal();
506                 batteryLowSignal?.Disconnect(_applicationBatteryLowEventCallbackDelegate);
507                 batteryLowSignal?.Dispose();
508             }
509
510             if (_applicationMemoryLowEventCallbackDelegate != null)
511             {
512                 LowMemorySignalType memoryLowSignal = this.MemoryLowSignal();
513                 memoryLowSignal?.Disconnect(_applicationMemoryLowEventCallbackDelegate);
514                 memoryLowSignal?.Dispose();
515             }
516
517             if (_applicationAppControlEventCallbackDelegate != null)
518             {
519                 ApplicationControlSignal appControlSignal = this.AppControlSignal();
520                 appControlSignal?.Disconnect(_applicationAppControlEventCallbackDelegate);
521                 appControlSignal?.Dispose();
522             }
523
524             base.Dispose(type);
525         }
526         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
527         {
528             Interop.Application.DeleteApplication(swigCPtr);
529         }
530
531         /// <since_tizen> 4 </since_tizen>
532         public enum BatteryStatus
533         {
534             Normal,
535             CriticallyLow,
536             PowerOff
537         };
538
539         /// <since_tizen> 4 </since_tizen>
540         public enum MemoryStatus
541         {
542             Normal,
543             Low,
544             CriticallyLow
545         };
546
547         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
548         private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
549         private DaliEventHandler<object, NUIApplicationInitEventArgs> _applicationInitEventHandler;
550         private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
551
552
553         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
554         private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
555         private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> _applicationTerminateEventHandler;
556         private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
557
558
559         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
560         private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
561         private DaliEventHandler<object, NUIApplicationPausedEventArgs> _applicationPauseEventHandler;
562         private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
563
564         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
565         private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
566         private DaliEventHandler<object, NUIApplicationResumedEventArgs> _applicationResumeEventHandler;
567         private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
568
569         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
570         private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
571         private DaliEventHandler<object, NUIApplicationResetEventArgs> _applicationResetEventHandler;
572         private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
573
574         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
575         private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
576         private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
577         private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
578
579
580         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
581         private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
582         private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
583         private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
584
585         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
586         private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status);
587         private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
588         private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
589
590         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
591         private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status);
592         private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
593         private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
594
595         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
596         private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
597         private DaliEventHandler<object, NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
598         private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
599
600         /**
601           * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
602           *  provided by the user. Initialized signal is emitted when application is initialised
603           */
604         public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
605         {
606             add
607             {
608                 lock (this)
609                 {
610                     // Restricted to only one listener
611                     if (_applicationInitEventHandler == null)
612                     {
613                         _applicationInitEventHandler += value;
614
615                         _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
616                         this.InitSignal().Connect(_applicationInitEventCallbackDelegate);
617                     }
618                 }
619             }
620
621             remove
622             {
623                 lock (this)
624                 {
625                     if (_applicationInitEventHandler != null)
626                     {
627                         ApplicationSignal initSignal = this.InitSignal();
628                         initSignal?.Disconnect(_applicationInitEventCallbackDelegate);
629                         initSignal?.Dispose();
630                     }
631
632                     _applicationInitEventHandler -= value;
633                 }
634             }
635         }
636
637         // Callback for Application InitSignal
638         private void OnApplicationInit(IntPtr data)
639         {
640             // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
641             DisposeQueue.Instance.Initialize();
642
643             // Notify that the window is displayed to the app core.
644             if (NUIApplication.IsPreLoad)
645             {
646                 Window.Instance.Show();
647             }
648
649             if (_applicationInitEventHandler != null)
650             {
651                 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
652                 e.Application = this;
653                 _applicationInitEventHandler.Invoke(this, e);
654             }
655
656         }
657
658         /**
659           * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
660           *  provided by the user. Terminated signal is emitted when application is terminating
661           */
662         public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
663         {
664             add
665             {
666                 lock (this)
667                 {
668                     // Restricted to only one listener
669                     if (_applicationTerminateEventHandler == null)
670                     {
671                         _applicationTerminateEventHandler += value;
672
673                         _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
674                         this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
675                     }
676                 }
677             }
678
679             remove
680             {
681                 lock (this)
682                 {
683                     if (_applicationTerminateEventHandler != null)
684                     {
685                         ApplicationSignal terminateSignal = this.TerminateSignal();
686                         terminateSignal?.Disconnect(_applicationTerminateEventCallbackDelegate);
687                         terminateSignal?.Dispose();
688                     }
689
690                     _applicationTerminateEventHandler -= value;
691                 }
692             }
693         }
694
695         // Callback for Application TerminateSignal
696         private void OnNUIApplicationTerminate(IntPtr data)
697         {
698             if (_applicationTerminateEventHandler != null)
699             {
700                 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
701                 e.Application = this;
702                 _applicationTerminateEventHandler.Invoke(this, e);
703             }
704
705             List<Window> windows = GetWindowList();
706             foreach (Window window in windows)
707             {
708                 window?.DisconnectNativeSignals();
709             }
710         }
711
712         /**
713           * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
714           * provided by the user. Paused signal is emitted when application is paused
715           */
716         public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
717         {
718             add
719             {
720                 lock (this)
721                 {
722                     // Restricted to only one listener
723                     if (_applicationPauseEventHandler == null)
724                     {
725                         _applicationPauseEventHandler += value;
726
727                         _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
728                         this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
729                     }
730                 }
731             }
732
733             remove
734             {
735                 lock (this)
736                 {
737                     if (_applicationPauseEventHandler != null)
738                     {
739                         ApplicationSignal pauseSignal = this.PauseSignal();
740                         pauseSignal?.Disconnect(_applicationPauseEventCallbackDelegate);
741                         pauseSignal?.Dispose();
742                     }
743
744                     _applicationPauseEventHandler -= value;
745                 }
746             }
747         }
748
749         // Callback for Application PauseSignal
750         private void OnNUIApplicationPause(IntPtr data)
751         {
752             if (_applicationPauseEventHandler != null)
753             {
754                 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
755                 e.Application = this;
756                 _applicationPauseEventHandler.Invoke(this, e);
757             }
758         }
759
760         /**
761           * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
762           *  provided by the user. Resumed signal is emitted when application is resumed
763           */
764         public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
765         {
766             add
767             {
768                 lock (this)
769                 {
770                     // Restricted to only one listener
771                     if (_applicationResumeEventHandler == null)
772                     {
773                         _applicationResumeEventHandler += value;
774
775                         _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
776                         this.ResumeSignal().Connect(_applicationResumeEventCallbackDelegate);
777                     }
778                 }
779             }
780
781             remove
782             {
783                 lock (this)
784                 {
785                     if (_applicationResumeEventHandler != null)
786                     {
787                         ApplicationSignal resumeSignal = this.ResumeSignal();
788                         resumeSignal?.Disconnect(_applicationResumeEventCallbackDelegate);
789                         resumeSignal?.Dispose();
790                     }
791
792                     _applicationResumeEventHandler -= value;
793                 }
794             }
795         }
796
797         // Callback for Application ResumeSignal
798         private void OnNUIApplicationResume(IntPtr data)
799         {
800             if (_applicationResumeEventHandler != null)
801             {
802                 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
803                 e.Application = this;
804                 _applicationResumeEventHandler.Invoke(this, e);
805             }
806         }
807
808         /**
809           * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
810           *  provided by the user. Reset signal is emitted when application is reset
811           */
812         public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
813         {
814             add
815             {
816                 lock (this)
817                 {
818                     // Restricted to only one listener
819                     if (_applicationResetEventHandler == null)
820                     {
821                         _applicationResetEventHandler += value;
822
823                         _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
824                         this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
825                     }
826                 }
827             }
828
829             remove
830             {
831                 lock (this)
832                 {
833                     if (_applicationResetEventHandler != null)
834                     {
835                         ApplicationSignal resetSignal = this.ResetSignal();
836                         resetSignal?.Disconnect(_applicationResetEventCallbackDelegate);
837                         resetSignal?.Dispose();
838                     }
839
840                     _applicationResetEventHandler -= value;
841                 }
842             }
843         }
844
845         // Callback for Application ResetSignal
846         private void OnNUIApplicationReset(IntPtr data)
847         {
848             if (_applicationResetEventHandler != null)
849             {
850                 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
851                 e.Application = this;
852                 _applicationResetEventHandler.Invoke(this, e);
853             }
854         }
855
856         /**
857           * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
858           *  provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
859           */
860         public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
861         {
862             add
863             {
864                 lock (this)
865                 {
866                     // Restricted to only one listener
867                     if (_applicationLanguageChangedEventHandler == null)
868                     {
869                         _applicationLanguageChangedEventHandler += value;
870
871                         _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
872                         this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
873                     }
874                 }
875             }
876
877             remove
878             {
879                 lock (this)
880                 {
881                     if (_applicationLanguageChangedEventHandler != null)
882                     {
883                         ApplicationSignal languageChangedSignal = this.LanguageChangedSignal();
884                         languageChangedSignal?.Disconnect(_applicationLanguageChangedEventCallbackDelegate);
885                         languageChangedSignal?.Dispose();
886                     }
887
888                     _applicationLanguageChangedEventHandler -= value;
889                 }
890             }
891         }
892
893         // Callback for Application LanguageChangedSignal
894         private void OnNUIApplicationLanguageChanged(IntPtr data)
895         {
896             if (_applicationLanguageChangedEventHandler != null)
897             {
898                 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
899                 e.Application = this;
900                 _applicationLanguageChangedEventHandler.Invoke(this, e);
901             }
902         }
903
904         /**
905           * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
906           *  provided by the user. RegionChanged signal is emitted when the region of the device is changed.
907           */
908         public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
909         {
910             add
911             {
912                 lock (this)
913                 {
914                     // Restricted to only one listener
915                     if (_applicationRegionChangedEventHandler == null)
916                     {
917                         _applicationRegionChangedEventHandler += value;
918
919                         _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
920                         this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
921                     }
922                 }
923             }
924
925             remove
926             {
927                 lock (this)
928                 {
929                     if (_applicationRegionChangedEventHandler != null)
930                     {
931                         ApplicationSignal regionChangedSignal = this.RegionChangedSignal();
932                         regionChangedSignal?.Disconnect(_applicationRegionChangedEventCallbackDelegate);
933                         regionChangedSignal?.Dispose();
934                     }
935
936                     _applicationRegionChangedEventHandler -= value;
937                 }
938             }
939         }
940
941         // Callback for Application RegionChangedSignal
942         private void OnNUIApplicationRegionChanged(IntPtr data)
943         {
944             if (_applicationRegionChangedEventHandler != null)
945             {
946                 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
947                 e.Application = this;
948                 _applicationRegionChangedEventHandler.Invoke(this, e);
949             }
950         }
951
952         /**
953           * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
954           * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
955           */
956         public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
957         {
958             add
959             {
960                 lock (this)
961                 {
962                     // Restricted to only one listener
963                     if (_applicationBatteryLowEventHandler == null)
964                     {
965                         _applicationBatteryLowEventHandler += value;
966
967                         _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
968                         this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
969                     }
970                 }
971             }
972
973             remove
974             {
975                 lock (this)
976                 {
977                     if (_applicationBatteryLowEventHandler != null)
978                     {
979                         LowBatterySignalType BatteryLowSignal = this.BatteryLowSignal();
980                         BatteryLowSignal?.Disconnect(_applicationBatteryLowEventCallbackDelegate);
981                         BatteryLowSignal?.Dispose();
982                     }
983
984                     _applicationBatteryLowEventHandler -= value;
985                 }
986             }
987         }
988
989         // Callback for Application BatteryLowSignal
990         private void OnNUIApplicationBatteryLow(BatteryStatus status)
991         {
992             lock (this)
993             {
994                 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
995
996                 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
997                 e.BatteryStatus = status;
998                 _applicationBatteryLowEventHandler?.Invoke(this, e);
999             }
1000         }
1001
1002         /**
1003           * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
1004           *  provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
1005           */
1006         public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
1007         {
1008             add
1009             {
1010                 lock (this)
1011                 {
1012                     // Restricted to only one listener
1013                     if (_applicationMemoryLowEventHandler == null)
1014                     {
1015                         _applicationMemoryLowEventHandler += value;
1016
1017                         _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
1018                         this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
1019                     }
1020                 }
1021             }
1022
1023             remove
1024             {
1025                 lock (this)
1026                 {
1027                     if (_applicationMemoryLowEventHandler != null)
1028                     {
1029                         LowMemorySignalType memoryLowSignal = this.MemoryLowSignal();
1030                         memoryLowSignal?.Disconnect(_applicationMemoryLowEventCallbackDelegate);
1031                         memoryLowSignal?.Dispose();
1032                     }
1033
1034                     _applicationMemoryLowEventHandler -= value;
1035                 }
1036             }
1037         }
1038
1039         // Callback for Application MemoryLowSignal
1040         private void OnNUIApplicationMemoryLow(MemoryStatus status)
1041         {
1042             lock (this)
1043             {
1044                 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1045
1046                 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1047                 e.MemoryStatus = status;
1048                 _applicationMemoryLowEventHandler?.Invoke(this, e);
1049             }
1050         }
1051
1052         /**
1053           * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
1054           *  provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
1055           */
1056         public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
1057         {
1058             add
1059             {
1060                 lock (this)
1061                 {
1062                     // Restricted to only one listener
1063                     if (_applicationAppControlEventHandler == null)
1064                     {
1065                         _applicationAppControlEventHandler += value;
1066
1067                         _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1068                         this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
1069                     }
1070                 }
1071             }
1072
1073             remove
1074             {
1075                 lock (this)
1076                 {
1077                     if (_applicationAppControlEventHandler != null)
1078                     {
1079                         ApplicationControlSignal appControlSignal = this.AppControlSignal();
1080                         appControlSignal?.Disconnect(_applicationAppControlEventCallbackDelegate);
1081                         appControlSignal?.Dispose();
1082                     }
1083
1084                     _applicationAppControlEventHandler -= value;
1085                 }
1086             }
1087         }
1088
1089         // Callback for Application AppControlSignal
1090         private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1091         {
1092             if (_applicationAppControlEventHandler != null)
1093             {
1094                 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1095                 e.VoidP = voidp;
1096                 e.Application = this;
1097                 _applicationAppControlEventHandler.Invoke(this, e);
1098             }
1099         }
1100
1101         protected static Application _instance; // singleton
1102
1103         public static Application Instance
1104         {
1105             get
1106             {
1107                 return _instance;
1108             }
1109         }
1110
1111         public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1112         {
1113             if (cPtr == global::System.IntPtr.Zero)
1114             {
1115                 return null;
1116             }
1117
1118             Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1119             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1120             return ret;
1121         }
1122
1123         public static Application NewApplication()
1124         {
1125             return NewApplication("", Application.WindowMode.Opaque);
1126         }
1127
1128         public static Application NewApplication(string stylesheet)
1129         {
1130             return NewApplication(stylesheet, Application.WindowMode.Opaque);
1131         }
1132
1133         public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
1134         {
1135             // register all Views with the type registry, so that can be created / styled via JSON
1136             //ViewRegistryHelper.Initialize(); //moved to Application side.
1137             if (_instance)
1138             {
1139                 return _instance;
1140             }
1141
1142             Application ret = New(1, stylesheet, windowMode);
1143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1144
1145             // set the singleton
1146             _instance = ret;
1147             return ret;
1148         }
1149
1150         public static Application NewApplication(string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1151         {
1152             if (_instance)
1153             {
1154                 return _instance;
1155             }
1156             Application ret = New(1, stylesheet, windowMode, positionSize);
1157             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1158
1159             // set the singleton
1160             _instance = ret;
1161             return ret;
1162         }
1163
1164         public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
1165         {
1166             if (_instance)
1167             {
1168                 return _instance;
1169             }
1170             Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
1171             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1172
1173             // set the singleton
1174             _instance = ret;
1175             return _instance;
1176         }
1177
1178         public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1179         {
1180             if (_instance)
1181             {
1182                 return _instance;
1183             }
1184             Application ret = New(args, stylesheet, (Application.WindowMode)windowMode, positionSize);
1185             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1186
1187             // set the singleton
1188             _instance = ret;
1189             return _instance;
1190         }
1191
1192         /// <summary>
1193         /// Ensures that the function passed in is called from the main loop when it is idle.
1194         /// </summary>
1195         /// <param name="func">The function to call</param>
1196         /// <returns>true if added successfully, false otherwise</returns>
1197         public bool AddIdle(System.Delegate func)
1198         {
1199             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1200             System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1201
1202             bool ret = Interop.Application.AddIdle(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1203
1204             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1205             return ret;
1206         }
1207
1208         /**
1209         * Outer::outer_method(int)
1210         */
1211         public static Application New()
1212         {
1213             Application ret = new Application(Interop.Application.New(), true);
1214             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1215             return ret;
1216         }
1217
1218         public static Application New(int argc)
1219         {
1220             Application ret = new Application(Interop.Application.New(argc), true);
1221             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1222             return ret;
1223         }
1224
1225         public static Application New(int argc, string stylesheet)
1226         {
1227             Application ret = new Application(Interop.Application.New(argc, stylesheet), true);
1228             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1229             return ret;
1230         }
1231
1232         public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
1233         {
1234             Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
1235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1236             s_current = ret;
1237             return ret;
1238         }
1239
1240         public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode)
1241         {
1242             Application ret = null;
1243             int argc = 0;
1244             string argvStr = "";
1245             try
1246             {
1247                 argc = args.Length;
1248                 argvStr = string.Join(" ", args);
1249             }
1250             catch (Exception exception)
1251             {
1252                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, msg : " + exception.Message);
1253                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1254                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1255                 throw;
1256             }
1257
1258             ret = new Application(NDalicPINVOKE.ApplicationNewManual4(argc, argvStr, stylesheet, (int)windowMode), true);
1259             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1260
1261             return ret;
1262         }
1263
1264         public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1265         {
1266             Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1267             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1268             return ret;
1269         }
1270
1271         public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1272         {
1273             Application ret = null;
1274             int argc = 0;
1275             string argvStr = "";
1276             try
1277             {
1278                 argc = args.Length;
1279                 argvStr = string.Join(" ", args);
1280             }
1281             catch (Exception exception)
1282             {
1283                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, msg : " + exception.Message);
1284                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1285                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1286                 throw;
1287             }
1288
1289             ret = new Application(NDalicPINVOKE.ApplicationNewWithWindowSizePosition(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1290             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1291
1292             return ret;
1293         }
1294
1295         public Application() : this(Interop.Application.NewApplication(), true)
1296         {
1297             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1298         }
1299
1300         public Application(Application application) : this(Interop.Application.NewApplication(Application.getCPtr(application)), true)
1301         {
1302             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1303         }
1304
1305         public Application Assign(Application application)
1306         {
1307             Application ret = new Application(Interop.Application.Assign(SwigCPtr, Application.getCPtr(application)), false);
1308             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1309             return ret;
1310         }
1311
1312         public void MainLoop()
1313         {
1314             NDalicPINVOKE.ApplicationMainLoop(SwigCPtr);
1315             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1316         }
1317
1318         public void Lower()
1319         {
1320             Interop.Application.Lower(SwigCPtr);
1321             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1322         }
1323
1324         public void Quit()
1325         {
1326             Interop.Application.Quit(SwigCPtr);
1327             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1328         }
1329
1330         internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1331         {
1332             bool ret = Interop.Application.AddIdle(SwigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1333             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1334             return ret;
1335         }
1336
1337         public Window GetWindow()
1338         {
1339             Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindow(SwigCPtr)) as Window;
1340             if (ret == null)
1341             {
1342                 ret = new Window(Interop.Application.GetWindow(SwigCPtr), true);
1343             }
1344
1345             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1346             return ret;
1347         }
1348
1349         public static string GetResourcePath()
1350         {
1351             string ret = Interop.Application.GetResourcePath();
1352             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1353             return ret;
1354         }
1355
1356         public string GetLanguage()
1357         {
1358             string ret = Interop.Application.GetLanguage(SwigCPtr);
1359             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1360             return ret;
1361         }
1362
1363         public string GetRegion()
1364         {
1365             string ret = Interop.Application.GetRegion(SwigCPtr);
1366             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1367             return ret;
1368         }
1369
1370         [EditorBrowsable(EditorBrowsableState.Never)]
1371         public static List<Window> GetWindowList()
1372         {
1373             uint ListSize = Interop.Application.GetWindowsListSize();
1374             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1375
1376             List<Window> WindowList = new List<Window>();
1377             for (uint i = 0; i < ListSize; ++i)
1378             {
1379                 Window currWin = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindowsFromList(i)) as Window;
1380                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1381                 if (currWin)
1382                 {
1383                     WindowList.Add(currWin);
1384                 }
1385             }
1386             return WindowList;
1387         }
1388
1389         internal ApplicationSignal InitSignal()
1390         {
1391             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationInitSignal(SwigCPtr), false);
1392             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1393             return ret;
1394         }
1395
1396         internal ApplicationSignal TerminateSignal()
1397         {
1398             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTerminateSignal(SwigCPtr), false);
1399             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1400             return ret;
1401         }
1402
1403         internal ApplicationSignal PauseSignal()
1404         {
1405             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationPauseSignal(SwigCPtr), false);
1406             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1407             return ret;
1408         }
1409
1410         internal ApplicationSignal ResumeSignal()
1411         {
1412             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResumeSignal(SwigCPtr), false);
1413             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1414             return ret;
1415         }
1416
1417         internal ApplicationSignal ResetSignal()
1418         {
1419             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResetSignal(SwigCPtr), false);
1420             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1421             return ret;
1422         }
1423
1424         internal ApplicationControlSignal AppControlSignal()
1425         {
1426             ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationAppControlSignal(SwigCPtr), false);
1427             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1428             return ret;
1429         }
1430
1431         internal ApplicationSignal LanguageChangedSignal()
1432         {
1433             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationLanguageChangedSignal(SwigCPtr), false);
1434             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1435             return ret;
1436         }
1437
1438         internal ApplicationSignal RegionChangedSignal()
1439         {
1440             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationRegionChangedSignal(SwigCPtr), false);
1441             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1442             return ret;
1443         }
1444
1445         internal LowBatterySignalType BatteryLowSignal()
1446         {
1447             LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationLowBatterySignal(SwigCPtr), false);
1448             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1449             return ret;
1450         }
1451
1452         internal LowMemorySignalType MemoryLowSignal()
1453         {
1454             LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationLowMemorySignal(SwigCPtr), false);
1455             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1456             return ret;
1457         }
1458
1459         /// <since_tizen> 3 </since_tizen>
1460         public enum WindowMode
1461         {
1462             Opaque = 0,
1463             Transparent = 1
1464         }
1465     }
1466 }