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