Release 12.0.0.18314
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Application / Application.cs
1 /*
2  * Copyright(c) 2022 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 Tizen.NUI.Binding;
24
25 namespace Tizen.NUI
26 {
27     // Event arguments that passed via NUIApplicationInit signal
28     internal class NUIApplicationInitEventArgs : EventArgs
29     {
30         private Application application;
31
32         // Application - is the application that is being initialized
33         public Application Application
34         {
35             get
36             {
37                 return application;
38             }
39             set
40             {
41                 application = value;
42             }
43         }
44     }
45
46     // Event arguments that passed via NUIApplicationTerminate signal
47     internal class NUIApplicationTerminatingEventArgs : EventArgs
48     {
49         private Application application;
50
51         // Application - is the application that is being Terminated
52         public Application Application
53         {
54             get
55             {
56                 return application;
57             }
58             set
59             {
60                 application = value;
61             }
62         }
63     }
64
65     // Event arguments that passed via NUIApplicationPause signal
66     internal class NUIApplicationPausedEventArgs : EventArgs
67     {
68         private Application application;
69
70         // Application - is the application that is being Paused
71         public Application Application
72         {
73             get
74             {
75                 return application;
76             }
77             set
78             {
79                 application = value;
80             }
81         }
82     }
83
84     // Event arguments that passed via NUIApplicationResume signal
85     internal class NUIApplicationResumedEventArgs : EventArgs
86     {
87         private Application application;
88         // Application - is the application that is being Resumed
89         public Application Application
90         {
91             get
92             {
93                 return application;
94             }
95             set
96             {
97                 application = value;
98             }
99         }
100     }
101
102     // Event arguments that passed via NUIApplicationReset signal
103     internal class NUIApplicationResetEventArgs : EventArgs
104     {
105         private Application application;
106
107         // Application - is the application that is being Reset
108         public Application Application
109         {
110             get
111             {
112                 return application;
113             }
114             set
115             {
116                 application = value;
117             }
118         }
119     }
120
121     // Event arguments that passed via NUIApplicationLanguageChanged signal
122     internal class NUIApplicationLanguageChangedEventArgs : EventArgs
123     {
124         private Application application;
125
126         // Application - is the application that is being affected with Device's language change
127         public Application Application
128         {
129             get
130             {
131                 return application;
132             }
133             set
134             {
135                 application = value;
136             }
137         }
138     }
139
140     // Event arguments that passed via NUIApplicationRegionChanged signal
141     internal class NUIApplicationRegionChangedEventArgs : EventArgs
142     {
143         private Application application;
144
145         // Application - is the application that is being affected with Device's region change
146         public Application Application
147         {
148             get
149             {
150                 return application;
151             }
152             set
153             {
154                 application = value;
155             }
156         }
157     }
158
159     // Event arguments that passed via NUIApplicationBatteryLow signal
160     internal class NUIApplicationBatteryLowEventArgs : EventArgs
161     {
162         private Application.BatteryStatus status;
163
164         // Application - is the application that is being affected when the battery level of the device is low
165         public Application.BatteryStatus BatteryStatus
166         {
167             get
168             {
169                 return status;
170             }
171             set
172             {
173                 status = value;
174             }
175         }
176     }
177
178     // Event arguments that passed via NUIApplicationMemoryLow signal
179     internal class NUIApplicationMemoryLowEventArgs : EventArgs
180     {
181         private Application.MemoryStatus status;
182
183         // Application - is the application that is being affected when the memory level of the device is low
184         public Application.MemoryStatus MemoryStatus
185         {
186             get
187             {
188                 return status;
189             }
190             set
191             {
192                 status = value;
193             }
194         }
195     }
196
197     // Event arguments that passed via NUIApplicationDeviceOrientationChanged signal
198     internal class NUIApplicationDeviceOrientationChangedEventArgs : EventArgs
199     {
200         private Application.DeviceOrientationStatus status;
201
202         // Application - is the application that is being affected when the device orientation is changed.
203         public Application.DeviceOrientationStatus DeviceOrientationStatus
204         {
205             get
206             {
207                 return status;
208             }
209             set
210             {
211                 status = value;
212             }
213         }
214     }
215
216     // Event arguments that passed via NUIApplicationAppControl  signal
217     internal class NUIApplicationAppControlEventArgs : EventArgs
218     {
219         private Application application;
220         private IntPtr voidp;
221
222         // Application - is the application that is receiving the launch request from another application
223         public Application Application
224         {
225             get
226             {
227                 return application;
228             }
229             set
230             {
231                 application = value;
232             }
233         }
234
235         // VoidP - contains the information about why the application is launched
236         public IntPtr VoidP
237         {
238             get
239             {
240                 return voidp;
241             }
242             set
243             {
244                 voidp = value;
245             }
246         }
247     }
248
249     /// <summary>
250     /// A class to get resources in current application.
251     /// </summary>
252     public sealed class GetResourcesProvider
253     {
254         /// <summary>
255         /// Get resources in current application.
256         /// </summary>
257         static public IResourcesProvider Get()
258         {
259             return Tizen.NUI.Application.Current;
260         }
261     }
262
263     internal class Application : BaseHandle, IResourcesProvider, IElementConfiguration<Application>
264     {
265         static Application s_current;
266
267         ReadOnlyCollection<Element> logicalChildren;
268
269         [EditorBrowsable(EditorBrowsableState.Never)]
270         public static void SetCurrentApplication(Application value) => Current = value;
271
272         public static Application Current
273         {
274             get { return s_current; }
275             set
276             {
277                 if (s_current == value)
278                     return;
279                 s_current = value;
280             }
281         }
282
283         internal override ReadOnlyCollection<Element> LogicalChildrenInternal
284         {
285             get { return logicalChildren ?? (logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
286         }
287
288         internal IResourceDictionary SystemResources { get; }
289
290         ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>();
291
292         ResourceDictionary resources;
293         public bool IsResourcesCreated => resources != null;
294
295         public delegate void resChangeCb(object sender, ResourcesChangedEventArgs e);
296
297         internal override void OnResourcesChanged(object sender, ResourcesChangedEventArgs e)
298         {
299             base.OnResourcesChanged(sender, e);
300         }
301
302         public ResourceDictionary XamlResources
303         {
304             get
305             {
306                 if (resources == null)
307                 {
308                     resources = new ResourceDictionary();
309                     int hashCode = resources.GetHashCode();
310                     ((IResourceDictionary)resources).ValuesChanged += OnResourcesChanged;
311                 }
312                 return resources;
313             }
314             set
315             {
316                 if (resources == value)
317                     return;
318                 OnPropertyChanging();
319
320                 if (resources != null)
321                     ((IResourceDictionary)resources).ValuesChanged -= OnResourcesChanged;
322                 resources = value;
323                 OnResourcesChanged(value);
324                 if (resources != null)
325                     ((IResourceDictionary)resources).ValuesChanged += OnResourcesChanged;
326
327                 OnPropertyChanged();
328             }
329         }
330
331         protected override void OnParentSet()
332         {
333             throw new InvalidOperationException("Setting a Parent on Application is invalid.");
334         }
335
336         [EditorBrowsable(EditorBrowsableState.Never)]
337         public static bool IsApplicationOrNull(Element element)
338         {
339             return element == null || element is Application;
340         }
341
342         internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
343         {
344             if (values == null)
345                 return;
346
347             if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0)
348             {
349                 base.OnParentResourcesChanged(values);
350                 return;
351             }
352
353             var innerKeys = new HashSet<string>();
354             var changedResources = new List<KeyValuePair<string, object>>();
355             foreach (KeyValuePair<string, object> c in XamlResources)
356                 innerKeys.Add(c.Key);
357             foreach (KeyValuePair<string, object> value in values)
358             {
359                 if (innerKeys.Add(value.Key))
360                     changedResources.Add(value);
361             }
362             if (changedResources.Count != 0)
363                 OnResourcesChanged(changedResources);
364         }
365
366         internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
367         {
368             SetCurrentApplication(this);
369             s_current = this;
370         }
371
372         protected override void Dispose(DisposeTypes type)
373         {
374             if (disposed)
375             {
376                 return;
377             }
378
379             //Release your own unmanaged resources here.
380             //You should not access any managed member here except static instance.
381             //because the execution order of Finalizes is non-deterministic.
382             if (applicationInitEventCallbackDelegate != null)
383             {
384                 initSignal?.Disconnect(applicationInitEventCallbackDelegate);
385                 initSignal?.Dispose();
386                 initSignal = null;
387             }
388
389             if (applicationTerminateEventCallbackDelegate != null)
390             {
391                 terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
392                 terminateSignal?.Dispose();
393                 terminateSignal = null;
394             }
395
396             if (applicationPauseEventCallbackDelegate != null)
397             {
398                 pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
399                 pauseSignal?.Dispose();
400                 pauseSignal = null;
401             }
402
403             if (applicationResumeEventCallbackDelegate != null)
404             {
405                 resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
406                 resumeSignal?.Dispose();
407                 resumeSignal = null;
408             }
409
410             if (applicationResetEventCallbackDelegate != null)
411             {
412                 resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
413                 resetSignal?.Dispose();
414                 resetSignal = null;
415             }
416
417             if (applicationLanguageChangedEventCallbackDelegate != null)
418             {
419                 languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
420                 languageChangedSignal?.Dispose();
421                 languageChangedSignal = null;
422             }
423
424             if (applicationRegionChangedEventCallbackDelegate != null)
425             {
426                 regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
427                 regionChangedSignal?.Dispose();
428                 regionChangedSignal = null;
429             }
430
431             if (applicationBatteryLowEventCallbackDelegate != null)
432             {
433                 batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
434                 batteryLowSignal?.Dispose();
435                 batteryLowSignal = null;
436             }
437
438             if (applicationMemoryLowEventCallbackDelegate != null)
439             {
440                 memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
441                 memoryLowSignal?.Dispose();
442                 memoryLowSignal = null;
443             }
444
445             if (applicationDeviceOrientationChangedEventCallback != null)
446             {
447                 deviceOrientationChangedSignal?.Disconnect(applicationDeviceOrientationChangedEventCallback);
448                 deviceOrientationChangedSignal?.Dispose();
449                 deviceOrientationChangedSignal = null;
450             }
451
452             if (applicationAppControlEventCallbackDelegate != null)
453             {
454                 appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
455                 appControlSignal?.Dispose();
456                 appControlSignal = null;
457             }
458
459             //Task
460             if (applicationTaskInitEventCallbackDelegate != null)
461             {
462                 taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
463                 taskInitSignal?.Dispose();
464                 taskInitSignal = null;
465             }
466
467             if (applicationTaskTerminateEventCallbackDelegate != null)
468             {
469                 taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
470                 taskTerminateSignal?.Dispose();
471                 taskTerminateSignal = null;
472             }
473
474             if (applicationTaskLanguageChangedEventCallbackDelegate != null)
475             {
476                 taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
477                 taskLanguageChangedSignal?.Dispose();
478                 taskLanguageChangedSignal = null;
479             }
480
481             if (applicationTaskRegionChangedEventCallbackDelegate != null)
482             {
483                 taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
484                 taskRegionChangedSignal?.Dispose();
485                 taskRegionChangedSignal = null;
486             }
487
488             if (applicationTaskBatteryLowEventCallbackDelegate != null)
489             {
490                 taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
491                 taskBatteryLowSignal?.Dispose();
492                 taskBatteryLowSignal = null;
493             }
494
495             if (applicationTaskMemoryLowEventCallbackDelegate != null)
496             {
497                 taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
498                 taskMemoryLowSignal?.Dispose();
499                 taskMemoryLowSignal = null;
500             }
501
502             if (applicationTaskDeviceOrientationChangedEventCallback != null)
503             {
504                 taskDeviceOrientationChangedSignal?.Disconnect(applicationTaskDeviceOrientationChangedEventCallback);
505                 taskDeviceOrientationChangedSignal?.Dispose();
506                 taskDeviceOrientationChangedSignal = null;
507             }
508
509             if (applicationTaskAppControlEventCallbackDelegate != null)
510             {
511                 taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
512                 taskAppControlSignal?.Dispose();
513                 taskAppControlSignal = null;
514             }
515
516             window?.Dispose();
517             window = null;
518
519             base.Dispose(type);
520         }
521         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
522         {
523             Interop.Application.DeleteApplication(swigCPtr);
524         }
525
526         public enum BatteryStatus
527         {
528             Normal,
529             CriticallyLow,
530             PowerOff
531         };
532
533         public enum MemoryStatus
534         {
535             Normal,
536             Low,
537             CriticallyLow
538         };
539
540         public enum DeviceOrientationStatus
541         {
542             Orientation_0 = 0,
543             Orientation_90 = 90,
544             Orientation_180 = 180,
545             Orientation_270 = 270
546         };
547
548         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
549         private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
550         private DaliEventHandler<object, NUIApplicationInitEventArgs> applicationInitEventHandler;
551         private NUIApplicationInitEventCallbackDelegate applicationInitEventCallbackDelegate;
552         private ApplicationSignal initSignal;
553
554         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
555         private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
556         private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> applicationTerminateEventHandler;
557         private NUIApplicationTerminateEventCallbackDelegate applicationTerminateEventCallbackDelegate;
558         private ApplicationSignal terminateSignal;
559
560         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
561         private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
562         private DaliEventHandler<object, NUIApplicationPausedEventArgs> applicationPauseEventHandler;
563         private NUIApplicationPauseEventCallbackDelegate applicationPauseEventCallbackDelegate;
564         private ApplicationSignal pauseSignal;
565
566         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
567         private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
568         private DaliEventHandler<object, NUIApplicationResumedEventArgs> applicationResumeEventHandler;
569         private NUIApplicationResumeEventCallbackDelegate applicationResumeEventCallbackDelegate;
570         private ApplicationSignal resumeSignal;
571
572         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
573         private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
574         private DaliEventHandler<object, NUIApplicationResetEventArgs> applicationResetEventHandler;
575         private NUIApplicationResetEventCallbackDelegate applicationResetEventCallbackDelegate;
576         private ApplicationSignal resetSignal;
577
578         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
579         private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
580         private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> applicationLanguageChangedEventHandler;
581         private NUIApplicationLanguageChangedEventCallbackDelegate applicationLanguageChangedEventCallbackDelegate;
582         private ApplicationSignal languageChangedSignal;
583
584
585         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
586         private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
587         private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> applicationRegionChangedEventHandler;
588         private NUIApplicationRegionChangedEventCallbackDelegate applicationRegionChangedEventCallbackDelegate;
589         private ApplicationSignal regionChangedSignal;
590
591         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
592         private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status);
593         private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> applicationBatteryLowEventHandler;
594         private NUIApplicationBatteryLowEventCallbackDelegate applicationBatteryLowEventCallbackDelegate;
595         private LowBatterySignalType batteryLowSignal;
596
597         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
598         private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status);
599         private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> applicationMemoryLowEventHandler;
600         private NUIApplicationMemoryLowEventCallbackDelegate applicationMemoryLowEventCallbackDelegate;
601         private LowMemorySignalType memoryLowSignal;
602
603         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
604         private delegate void NUIApplicationDeviceOrientationChangedEventCallback(DeviceOrientationStatus status);
605         private DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> applicationDeviceOrientationChangedEventHandler;
606         private NUIApplicationDeviceOrientationChangedEventCallback applicationDeviceOrientationChangedEventCallback;
607         private DeviceOrientationChangedSignalType deviceOrientationChangedSignal;
608
609         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
610         private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
611         private DaliEventHandler<object, NUIApplicationAppControlEventArgs> applicationAppControlEventHandler;
612         private NUIApplicationAppControlEventCallbackDelegate applicationAppControlEventCallbackDelegate;
613         private ApplicationControlSignal appControlSignal;
614
615         private DaliEventHandler<object, NUIApplicationInitEventArgs> applicationTaskInitEventHandler;
616         private NUIApplicationInitEventCallbackDelegate applicationTaskInitEventCallbackDelegate;
617         private ApplicationSignal taskInitSignal;
618
619         private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> applicationTaskTerminateEventHandler;
620         private NUIApplicationTerminateEventCallbackDelegate applicationTaskTerminateEventCallbackDelegate;
621         private ApplicationSignal taskTerminateSignal;
622
623         private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> applicationTaskLanguageChangedEventHandler;
624         private NUIApplicationLanguageChangedEventCallbackDelegate applicationTaskLanguageChangedEventCallbackDelegate;
625         private ApplicationSignal taskLanguageChangedSignal;
626
627         private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> applicationTaskRegionChangedEventHandler;
628         private NUIApplicationRegionChangedEventCallbackDelegate applicationTaskRegionChangedEventCallbackDelegate;
629         private ApplicationSignal taskRegionChangedSignal;
630
631         private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> applicationTaskBatteryLowEventHandler;
632         private NUIApplicationBatteryLowEventCallbackDelegate applicationTaskBatteryLowEventCallbackDelegate;
633         private LowBatterySignalType taskBatteryLowSignal;
634
635         private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> applicationTaskMemoryLowEventHandler;
636         private NUIApplicationMemoryLowEventCallbackDelegate applicationTaskMemoryLowEventCallbackDelegate;
637         private LowMemorySignalType taskMemoryLowSignal;
638
639         private DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> applicationTaskDeviceOrientationChangedEventHandler;
640         private NUIApplicationDeviceOrientationChangedEventCallback applicationTaskDeviceOrientationChangedEventCallback;
641         private DeviceOrientationChangedSignalType taskDeviceOrientationChangedSignal;
642
643         private DaliEventHandler<object, NUIApplicationAppControlEventArgs> applicationTaskAppControlEventHandler;
644         private NUIApplicationAppControlEventCallbackDelegate applicationTaskAppControlEventCallbackDelegate;
645         private ApplicationControlSignal taskAppControlSignal;
646
647         private Window window;
648
649         // Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
650         // provided by the user. Initialized signal is emitted when application is initialized
651         public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
652         {
653             add
654             {
655                 // Restricted to only one listener
656                 if (applicationInitEventHandler == null)
657                 {
658                     applicationInitEventHandler += value;
659                     applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
660                     initSignal = this.InitSignal();
661                     initSignal?.Connect(applicationInitEventCallbackDelegate);
662                 }
663             }
664
665             remove
666             {
667                 if (applicationInitEventHandler != null)
668                 {
669                     initSignal?.Disconnect(applicationInitEventCallbackDelegate);
670                     initSignal?.Dispose();
671                     initSignal = null;
672                 }
673
674                 applicationInitEventHandler -= value;
675             }
676         }
677
678         // Callback for Application InitSignal
679         private void OnApplicationInit(IntPtr data)
680         {
681             Log.Info("NUI", "[NUI] OnApplicationInit: DisposeQueue Initialize");
682             Tizen.Tracer.Begin("[NUI] OnApplicationInit: DisposeQueue Initialize");
683             // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
684             DisposeQueue.Instance.Initialize();
685             Tizen.Tracer.End();
686
687             Log.Info("NUI", "[NUI] OnApplicationInit: ProcessorController Initialize");
688             Tizen.Tracer.Begin("[NUI] OnApplicationInit: ProcessorController Initialize");
689             // Initialize ProcessorController Singleton class. This is also required to create ProcessorController on main thread.
690             ProcessorController.Instance.Initialize();
691             Tizen.Tracer.End();
692
693 #if REMOVE_READONLY_FOR_BINDABLE_PROPERTY
694             if(NUIApplication.IsUsingXaml)
695             {
696                 Tizen.NUI.BaseComponents.View.CreateBindableProperties();
697             }
698 #endif
699             Log.Info("NUI", "[NUI] OnApplicationInit: GetWindow");
700             Tizen.Tracer.Begin("[NUI] OnApplicationInit: GetWindow");
701             Window.Instance = GetWindow();
702
703 #if !PROFILE_TV
704             //tv profile never use default focus indicator, so this is not needed!
705             _ = FocusManager.Instance;
706 #endif
707             Tizen.Tracer.End();
708
709             Log.Info("NUI", "[NUI] OnApplicationInit: Window Show");
710             Tizen.Tracer.Begin("[NUI] OnApplicationInit: Window Show");
711             // Notify that the window is displayed to the app core.
712             if (NUIApplication.IsPreload)
713             {
714                 Window.Instance.Show();
715             }
716             Tizen.Tracer.End();
717
718             Log.Info("NUI", "[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
719             Tizen.Tracer.Begin("[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
720             if (applicationInitEventHandler != null)
721             {
722                 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
723                 e.Application = this;
724                 applicationInitEventHandler.Invoke(this, e);
725             }
726             Tizen.Tracer.End();
727         }
728
729         // Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
730         //  provided by the user. Terminated signal is emitted when application is terminating
731         public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
732         {
733             add
734             {
735                 // Restricted to only one listener
736                 if (applicationTerminateEventHandler == null)
737                 {
738                     applicationTerminateEventHandler += value;
739
740                     applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
741                     terminateSignal = this.TerminateSignal();
742                     terminateSignal?.Connect(applicationTerminateEventCallbackDelegate);
743                 }
744             }
745
746             remove
747             {
748                 if (applicationTerminateEventHandler != null)
749                 {
750                     terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
751                     terminateSignal?.Dispose();
752                     terminateSignal = null;
753                 }
754
755                 applicationTerminateEventHandler -= value;
756             }
757         }
758
759         // Callback for Application TerminateSignal
760         private void OnNUIApplicationTerminate(IntPtr data)
761         {
762             if (applicationTerminateEventHandler != null)
763             {
764                 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
765                 e.Application = this;
766                 applicationTerminateEventHandler.Invoke(this, e);
767             }
768
769             List<Window> windows = GetWindowList();
770             if (windows != null)
771             {
772                 foreach (Window window in windows)
773                 {
774                     window?.DisconnectNativeSignals();
775                 }
776             }
777         }
778
779         // Event for Paused signal which can be used to subscribe/unsubscribe the event handler
780         // provided by the user. Paused signal is emitted when application is paused
781         public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
782         {
783             add
784             {
785                 // Restricted to only one listener
786                 if (applicationPauseEventHandler == null)
787                 {
788                     applicationPauseEventHandler += value;
789
790                     applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
791                     pauseSignal = this.PauseSignal();
792                     pauseSignal?.Connect(applicationPauseEventCallbackDelegate);
793                 }
794             }
795
796             remove
797             {
798                 if (applicationPauseEventHandler != null)
799                 {
800                     pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
801                     pauseSignal?.Dispose();
802                     pauseSignal = null;
803                 }
804
805                 applicationPauseEventHandler -= value;
806             }
807         }
808
809         // Callback for Application PauseSignal
810         private void OnNUIApplicationPause(IntPtr data)
811         {
812             if (applicationPauseEventHandler != null)
813             {
814                 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
815                 e.Application = this;
816                 applicationPauseEventHandler.Invoke(this, e);
817             }
818         }
819
820         // Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
821         //  provided by the user. Resumed signal is emitted when application is resumed
822         public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
823         {
824             add
825             {
826                 // Restricted to only one listener
827                 if (applicationResumeEventHandler == null)
828                 {
829                     applicationResumeEventHandler += value;
830
831                     applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
832                     resumeSignal = this.ResumeSignal();
833                     resumeSignal?.Connect(applicationResumeEventCallbackDelegate);
834                 }
835             }
836
837             remove
838             {
839                 if (applicationResumeEventHandler != null)
840                 {
841                     resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
842                     resumeSignal?.Dispose();
843                     resumeSignal = null;
844                 }
845
846                 applicationResumeEventHandler -= value;
847             }
848         }
849
850         // Callback for Application ResumeSignal
851         private void OnNUIApplicationResume(IntPtr data)
852         {
853             if (applicationResumeEventHandler != null)
854             {
855                 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
856                 e.Application = this;
857                 applicationResumeEventHandler.Invoke(this, e);
858             }
859         }
860
861         // Event for Reset signal which can be used to subscribe/unsubscribe the event handler
862         //  provided by the user. Reset signal is emitted when application is reset
863         public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
864         {
865             add
866             {
867                 // Restricted to only one listener
868                 if (applicationResetEventHandler == null)
869                 {
870                     applicationResetEventHandler += value;
871
872                     applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
873                     resetSignal = this.ResetSignal();
874                     resetSignal?.Connect(applicationResetEventCallbackDelegate);
875                 }
876             }
877
878             remove
879             {
880                 if (applicationResetEventHandler != null)
881                 {
882                     resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
883                     resetSignal?.Dispose();
884                     resetSignal = null;
885                 }
886
887                 applicationResetEventHandler -= value;
888             }
889         }
890
891         // Callback for Application ResetSignal
892         private void OnNUIApplicationReset(IntPtr data)
893         {
894             if (applicationResetEventHandler != null)
895             {
896                 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
897                 e.Application = this;
898                 applicationResetEventHandler.Invoke(this, e);
899             }
900         }
901
902         // Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
903         //  provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
904         public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
905         {
906             add
907             {
908                 // Restricted to only one listener
909                 if (applicationLanguageChangedEventHandler == null)
910                 {
911                     applicationLanguageChangedEventHandler += value;
912
913                     applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
914                     languageChangedSignal = this.LanguageChangedSignal();
915                     languageChangedSignal?.Connect(applicationLanguageChangedEventCallbackDelegate);
916                 }
917             }
918
919             remove
920             {
921                 if (applicationLanguageChangedEventHandler != null)
922                 {
923                     languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
924                     languageChangedSignal?.Dispose();
925                     languageChangedSignal = null;
926                 }
927
928                 applicationLanguageChangedEventHandler -= value;
929             }
930         }
931
932         // Callback for Application LanguageChangedSignal
933         private void OnNUIApplicationLanguageChanged(IntPtr data)
934         {
935             if (applicationLanguageChangedEventHandler != null)
936             {
937                 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
938                 e.Application = this;
939                 applicationLanguageChangedEventHandler.Invoke(this, e);
940             }
941         }
942
943         // Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
944         //  provided by the user. RegionChanged signal is emitted when the region of the device is changed.
945         public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
946         {
947             add
948             {
949                 // Restricted to only one listener
950                 if (applicationRegionChangedEventHandler == null)
951                 {
952                     applicationRegionChangedEventHandler += value;
953
954                     applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
955                     regionChangedSignal = this.RegionChangedSignal();
956                     regionChangedSignal?.Connect(applicationRegionChangedEventCallbackDelegate);
957                 }
958             }
959
960             remove
961             {
962                 if (applicationRegionChangedEventHandler != null)
963                 {
964                     regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
965                     regionChangedSignal?.Dispose();
966                     regionChangedSignal = null;
967                 }
968
969                 applicationRegionChangedEventHandler -= value;
970             }
971         }
972
973         // Callback for Application RegionChangedSignal
974         private void OnNUIApplicationRegionChanged(IntPtr data)
975         {
976             if (applicationRegionChangedEventHandler != null)
977             {
978                 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
979                 e.Application = this;
980                 applicationRegionChangedEventHandler.Invoke(this, e);
981             }
982         }
983
984         // Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
985         // provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
986         public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
987         {
988             add
989             {
990                 // Restricted to only one listener
991                 if (applicationBatteryLowEventHandler == null)
992                 {
993                     applicationBatteryLowEventHandler += value;
994
995                     applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
996                     batteryLowSignal = this.BatteryLowSignal();
997                     batteryLowSignal?.Connect(applicationBatteryLowEventCallbackDelegate);
998                 }
999             }
1000
1001             remove
1002             {
1003                 if (applicationBatteryLowEventHandler != null)
1004                 {
1005                     batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
1006                     batteryLowSignal?.Dispose();
1007                     batteryLowSignal = null;
1008                 }
1009
1010                 applicationBatteryLowEventHandler -= value;
1011             }
1012         }
1013
1014         // Callback for Application BatteryLowSignal
1015         private void OnNUIApplicationBatteryLow(BatteryStatus status)
1016         {
1017             NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1018
1019             // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1020             e.BatteryStatus = status;
1021             applicationBatteryLowEventHandler?.Invoke(this, e);
1022         }
1023
1024         // Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
1025         //  provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
1026         public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
1027         {
1028             add
1029             {
1030                 // Restricted to only one listener
1031                 if (applicationMemoryLowEventHandler == null)
1032                 {
1033                     applicationMemoryLowEventHandler += value;
1034
1035                     applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
1036                     memoryLowSignal = this.MemoryLowSignal();
1037                     memoryLowSignal?.Connect(applicationMemoryLowEventCallbackDelegate);
1038                 }
1039             }
1040
1041             remove
1042             {
1043                 if (applicationMemoryLowEventHandler != null)
1044                 {
1045                     memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
1046                     memoryLowSignal?.Dispose();
1047                     memoryLowSignal = null;
1048                 }
1049
1050                 applicationMemoryLowEventHandler -= value;
1051             }
1052         }
1053
1054         // Callback for Application MemoryLowSignal
1055         private void OnNUIApplicationMemoryLow(MemoryStatus status)
1056         {
1057             NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1058
1059             // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1060             e.MemoryStatus = status;
1061             applicationMemoryLowEventHandler?.Invoke(this, e);
1062         }
1063
1064         // Event for changing Device orientation signal which can be used to subscribe/unsubscribe the event handler
1065         //  provided by the user. DeviceOrientationChanged signal is emitted when the device orientation is changed.
1066         public event DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> DeviceOrientationChanged
1067         {
1068             add
1069             {
1070                 // Restricted to only one listener
1071                 if (applicationDeviceOrientationChangedEventHandler == null)
1072                 {
1073                     applicationDeviceOrientationChangedEventHandler += value;
1074
1075                     applicationDeviceOrientationChangedEventCallback = new NUIApplicationDeviceOrientationChangedEventCallback(OnNUIApplicationDeviceOrientationChanged);
1076                     deviceOrientationChangedSignal = this.DeviceOrientationChangedSignal();
1077                     deviceOrientationChangedSignal?.Connect(applicationDeviceOrientationChangedEventCallback);
1078                 }
1079             }
1080
1081             remove
1082             {
1083                 if (applicationDeviceOrientationChangedEventHandler != null)
1084                 {
1085                     deviceOrientationChangedSignal?.Disconnect(applicationDeviceOrientationChangedEventCallback);
1086                     deviceOrientationChangedSignal?.Dispose();
1087                     deviceOrientationChangedSignal = null;
1088                 }
1089
1090                 applicationDeviceOrientationChangedEventHandler -= value;
1091             }
1092         }
1093
1094         // Callback for Application DeviceOrientationChangedSignal
1095         private void OnNUIApplicationDeviceOrientationChanged(DeviceOrientationStatus status)
1096         {
1097             NUIApplicationDeviceOrientationChangedEventArgs e = new NUIApplicationDeviceOrientationChangedEventArgs();
1098
1099             e.DeviceOrientationStatus = status;
1100             applicationDeviceOrientationChangedEventHandler?.Invoke(this, e);
1101         }
1102
1103         // Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
1104         //  provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
1105         public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
1106         {
1107             add
1108             {
1109                 // Restricted to only one listener
1110                 if (applicationAppControlEventHandler == null)
1111                 {
1112                     applicationAppControlEventHandler += value;
1113
1114                     applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1115                     appControlSignal = this.AppControlSignal();
1116                     appControlSignal?.Connect(applicationAppControlEventCallbackDelegate);
1117                 }
1118             }
1119
1120             remove
1121             {
1122                 if (applicationAppControlEventHandler != null)
1123                 {
1124                     appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
1125                     appControlSignal?.Dispose();
1126                     appControlSignal = null;
1127                 }
1128
1129                 applicationAppControlEventHandler -= value;
1130             }
1131         }
1132
1133         // Callback for Application AppControlSignal
1134         private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1135         {
1136             if (applicationAppControlEventHandler != null)
1137             {
1138                 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1139                 e.VoidP = voidp;
1140                 e.Application = this;
1141                 applicationAppControlEventHandler.Invoke(this, e);
1142             }
1143         }
1144
1145         /// <summary>
1146         /// Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
1147         ///  provided by the user. Initialized signal is emitted when application is initialized
1148         /// </summary>
1149         public event DaliEventHandler<object, NUIApplicationInitEventArgs> TaskInitialized
1150         {
1151             add
1152             {
1153                 // Restricted to only one listener
1154                 if (applicationTaskInitEventHandler == null)
1155                 {
1156                     Tizen.Log.Fatal("NUI", "TaskInitialized Property adding");
1157                     applicationTaskInitEventHandler += value;
1158                     applicationTaskInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationTaskInit);
1159                     taskInitSignal = this.TaskInitSignal();
1160                     taskInitSignal?.Connect(applicationTaskInitEventCallbackDelegate);
1161                 }
1162             }
1163
1164             remove
1165             {
1166                 if (applicationTaskInitEventHandler != null)
1167                 {
1168                     taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
1169                     taskInitSignal?.Dispose();
1170                     taskInitSignal = null;
1171                 }
1172
1173                 applicationTaskInitEventHandler -= value;
1174             }
1175         }
1176
1177         private void OnApplicationTaskInit(IntPtr data)
1178         {
1179             if (applicationTaskInitEventHandler != null)
1180             {
1181                 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
1182                 e.Application = this;
1183                 applicationTaskInitEventHandler.Invoke(this, e);
1184             }
1185
1186         }
1187
1188         /// <summary>
1189         /// Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
1190         ///  provided by the user. Terminated signal is emitted when application is terminating
1191         /// </summary>
1192         public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> TaskTerminating
1193         {
1194             add
1195             {
1196                 // Restricted to only one listener
1197                 if (applicationTaskTerminateEventHandler == null)
1198                 {
1199                     applicationTaskTerminateEventHandler += value;
1200
1201                     applicationTaskTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTaskTerminate);
1202                     taskTerminateSignal = this.TaskTerminateSignal();
1203                     taskTerminateSignal?.Connect(applicationTaskTerminateEventCallbackDelegate);
1204                 }
1205             }
1206
1207             remove
1208             {
1209                 if (applicationTaskTerminateEventHandler != null)
1210                 {
1211                     taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
1212                     taskTerminateSignal?.Dispose();
1213                     taskTerminateSignal = null;
1214                 }
1215
1216                 applicationTaskTerminateEventHandler -= value;
1217             }
1218         }
1219
1220         private void OnNUIApplicationTaskTerminate(IntPtr data)
1221         {
1222             if (applicationTaskTerminateEventHandler != null)
1223             {
1224                 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
1225                 e.Application = this;
1226                 applicationTaskTerminateEventHandler.Invoke(this, e);
1227             }
1228         }
1229
1230         /// <summary>
1231         /// Event for TaskLanguageChanged signal which can be used to subscribe/unsubscribe the event handler
1232         ///  provided by the user. TaskLanguageChanged signal is emitted when the region of the device is changed.
1233         /// </summary>
1234         public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> TaskLanguageChanged
1235         {
1236             add
1237             {
1238                 // Restricted to only one listener
1239                 if (applicationTaskLanguageChangedEventHandler == null)
1240                 {
1241                     applicationTaskLanguageChangedEventHandler += value;
1242
1243                     applicationTaskLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationTaskLanguageChanged);
1244                     taskLanguageChangedSignal = this.TaskLanguageChangedSignal();
1245                     taskLanguageChangedSignal?.Connect(applicationTaskLanguageChangedEventCallbackDelegate);
1246                 }
1247             }
1248
1249             remove
1250             {
1251                 if (applicationTaskLanguageChangedEventHandler != null)
1252                 {
1253                     taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
1254                     taskLanguageChangedSignal?.Dispose();
1255                     taskLanguageChangedSignal = null;
1256                 }
1257
1258                 applicationTaskLanguageChangedEventHandler -= value;
1259             }
1260         }
1261
1262         private void OnNUIApplicationTaskLanguageChanged(IntPtr data)
1263         {
1264             if (applicationTaskLanguageChangedEventHandler != null)
1265             {
1266                 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
1267                 e.Application = this;
1268                 applicationTaskLanguageChangedEventHandler.Invoke(this, e);
1269             }
1270         }
1271
1272         /// <summary>
1273         /// Event for TaskRegionChanged signal which can be used to subscribe/unsubscribe the event handler
1274         ///  provided by the user. TaskRegionChanged signal is emitted when the region of the device is changed.
1275         /// </summary>
1276         public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> TaskRegionChanged
1277         {
1278             add
1279             {
1280                 // Restricted to only one listener
1281                 if (applicationTaskRegionChangedEventHandler == null)
1282                 {
1283                     applicationTaskRegionChangedEventHandler += value;
1284
1285                     applicationTaskRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationTaskRegionChanged);
1286                     taskRegionChangedSignal = this.TaskRegionChangedSignal();
1287                     taskRegionChangedSignal?.Connect(applicationTaskRegionChangedEventCallbackDelegate);
1288                 }
1289             }
1290
1291             remove
1292             {
1293                 if (applicationTaskRegionChangedEventHandler != null)
1294                 {
1295                     taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
1296                     taskRegionChangedSignal?.Dispose();
1297                     taskRegionChangedSignal = null;
1298                 }
1299
1300                 applicationTaskRegionChangedEventHandler -= value;
1301             }
1302         }
1303
1304         private void OnNUIApplicationTaskRegionChanged(IntPtr data)
1305         {
1306             if (applicationTaskRegionChangedEventHandler != null)
1307             {
1308                 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
1309                 e.Application = this;
1310                 applicationTaskRegionChangedEventHandler.Invoke(this, e);
1311             }
1312         }
1313
1314         /// <summary>
1315         /// Event for TaskBatteryLow signal which can be used to subscribe/unsubscribe the event handler
1316         /// provided by the user. TaskBatteryLow signal is emitted when the battery level of the device is low.
1317         /// </summary>
1318         public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> TaskBatteryLow
1319         {
1320             add
1321             {
1322                 // Restricted to only one listener
1323                 if (applicationTaskBatteryLowEventHandler == null)
1324                 {
1325                     applicationTaskBatteryLowEventHandler += value;
1326
1327                     applicationTaskBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationTaskBatteryLow);
1328                     taskBatteryLowSignal = this.TaskBatteryLowSignal();
1329                     taskBatteryLowSignal?.Connect(applicationTaskBatteryLowEventCallbackDelegate);
1330                 }
1331             }
1332
1333             remove
1334             {
1335                 if (applicationTaskBatteryLowEventHandler != null)
1336                 {
1337                     taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
1338                     taskBatteryLowSignal?.Dispose();
1339                     taskBatteryLowSignal = null;
1340                 }
1341
1342                 applicationTaskBatteryLowEventHandler -= value;
1343             }
1344         }
1345
1346         private void OnNUIApplicationTaskBatteryLow(BatteryStatus status)
1347         {
1348             NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1349
1350             // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1351             e.BatteryStatus = status;
1352             applicationTaskBatteryLowEventHandler?.Invoke(this, e);
1353         }
1354
1355         /// <summary>
1356         /// Event for TaskMemoryLow signal which can be used to subscribe/unsubscribe the event handler
1357         /// provided by the user. TaskMemoryLow signal is emitted when the memory level of the device is low.
1358         /// </summary>
1359         public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> TaskMemoryLow
1360         {
1361             add
1362             {
1363                 // Restricted to only one listener
1364                 if (applicationTaskMemoryLowEventHandler == null)
1365                 {
1366                     applicationTaskMemoryLowEventHandler += value;
1367
1368                     applicationTaskMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationTaskMemoryLow);
1369                     taskMemoryLowSignal = this.TaskMemoryLowSignal();
1370                     taskMemoryLowSignal?.Connect(applicationTaskMemoryLowEventCallbackDelegate);
1371                 }
1372             }
1373
1374             remove
1375             {
1376                 if (applicationTaskMemoryLowEventHandler != null)
1377                 {
1378                     taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
1379                     taskMemoryLowSignal?.Dispose();
1380                     taskMemoryLowSignal = null;
1381                 }
1382
1383                 applicationTaskMemoryLowEventHandler -= value;
1384             }
1385         }
1386
1387         private void OnNUIApplicationTaskMemoryLow(MemoryStatus status)
1388         {
1389             NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1390
1391             // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1392             e.MemoryStatus = status;
1393             applicationTaskMemoryLowEventHandler?.Invoke(this, e);
1394         }
1395
1396         /// <summary>
1397         /// Event for TaskDeviceOrientationChanged signal which can be used to subscribe/unsubscribe the event handler
1398         /// provided by the user. TaskDeviceOrientationChanged signal is emitted when the device orientation is changed.
1399         /// </summary>
1400         public event DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> TaskDeviceOrientationChanged
1401         {
1402             add
1403             {
1404                 if (applicationTaskDeviceOrientationChangedEventHandler == null)
1405                 {
1406                     applicationTaskDeviceOrientationChangedEventHandler += value;
1407
1408                     applicationTaskDeviceOrientationChangedEventCallback = new NUIApplicationDeviceOrientationChangedEventCallback(OnNUIApplicationTaskDeviceOrientationChanged);
1409                     taskDeviceOrientationChangedSignal = this.TaskDeviceOrientationChangedSignal();
1410                     taskDeviceOrientationChangedSignal?.Connect(applicationTaskDeviceOrientationChangedEventCallback);
1411                 }
1412             }
1413
1414             remove
1415             {
1416                 if (applicationTaskDeviceOrientationChangedEventHandler != null)
1417                 {
1418                     taskDeviceOrientationChangedSignal?.Disconnect(applicationTaskDeviceOrientationChangedEventCallback);
1419                     taskDeviceOrientationChangedSignal?.Dispose();
1420                     taskDeviceOrientationChangedSignal = null;
1421                 }
1422
1423                 applicationTaskDeviceOrientationChangedEventHandler -= value;
1424             }
1425         }
1426
1427         private void OnNUIApplicationTaskDeviceOrientationChanged(DeviceOrientationStatus status)
1428         {
1429             NUIApplicationDeviceOrientationChangedEventArgs e = new NUIApplicationDeviceOrientationChangedEventArgs();
1430
1431             e.DeviceOrientationStatus = status;
1432             applicationTaskDeviceOrientationChangedEventHandler?.Invoke(this, e);
1433         }
1434
1435         /// <summary>
1436         /// Event for TaskAppControl signal which can be used to subscribe/unsubscribe the event handler
1437         /// provided by the user. TaskAppControl signal is emitted when another application sends a launch request to the application.
1438         /// </summary>
1439         public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> TaskAppControl
1440         {
1441             add
1442             {
1443                 // Restricted to only one listener
1444                 if (applicationTaskAppControlEventHandler == null)
1445                 {
1446                     applicationTaskAppControlEventHandler += value;
1447
1448                     applicationTaskAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationTaskAppControl);
1449                     taskAppControlSignal = this.TaskAppControlSignal();
1450                     taskAppControlSignal?.Connect(applicationTaskAppControlEventCallbackDelegate);
1451                 }
1452             }
1453
1454             remove
1455             {
1456                 if (applicationTaskAppControlEventHandler != null)
1457                 {
1458                     taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
1459                     taskAppControlSignal?.Dispose();
1460                     taskAppControlSignal = null;
1461                 }
1462
1463                 applicationTaskAppControlEventHandler -= value;
1464             }
1465         }
1466
1467         private void OnNUIApplicationTaskAppControl(IntPtr application, IntPtr voidp)
1468         {
1469             if (applicationTaskAppControlEventHandler != null)
1470             {
1471                 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1472                 e.VoidP = voidp;
1473                 e.Application = this;
1474                 applicationTaskAppControlEventHandler.Invoke(this, e);
1475             }
1476         }
1477
1478         protected static Application instance; // singleton
1479
1480         public static Application Instance
1481         {
1482             get
1483             {
1484                 return instance;
1485             }
1486         }
1487
1488         public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1489         {
1490             if (cPtr == global::System.IntPtr.Zero)
1491             {
1492                 return null;
1493             }
1494
1495             Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1496             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1497             return ret;
1498         }
1499
1500         public static Application NewApplication()
1501         {
1502             return NewApplication("", NUIApplication.WindowMode.Opaque);
1503         }
1504
1505         public static Application NewApplication(string stylesheet)
1506         {
1507             return NewApplication(stylesheet, NUIApplication.WindowMode.Opaque);
1508         }
1509
1510         public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode)
1511         {
1512             // register all Views with the type registry, so that can be created / styled via JSON
1513             //ViewRegistryHelper.Initialize(); //moved to Application side.
1514             if (instance != null)
1515             {
1516                 return instance;
1517             }
1518
1519             Application ret = New(1, stylesheet, windowMode);
1520             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1521
1522             // set the singleton
1523             instance = ret;
1524             return ret;
1525         }
1526
1527         public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1528         {
1529             if (instance != null)
1530             {
1531                 return instance;
1532             }
1533             Application ret = New(1, stylesheet, windowMode, positionSize);
1534             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1535
1536             // set the singleton
1537             instance = ret;
1538             return ret;
1539         }
1540
1541         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1542         {
1543             if (instance != null)
1544             {
1545                 return instance;
1546             }
1547             Application ret = New(args, stylesheet, windowMode);
1548             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1549
1550             // set the singleton
1551             instance = ret;
1552             return instance;
1553         }
1554
1555         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1556         {
1557             if (instance != null)
1558             {
1559                 return instance;
1560             }
1561             Application ret = New(args, stylesheet, windowMode, positionSize);
1562             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1563
1564             // set the singleton
1565             instance = ret;
1566             return instance;
1567         }
1568
1569         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1570         {
1571             if (instance != null)
1572             {
1573                 return instance;
1574             }
1575             Application ret = New(args, stylesheet, windowMode, type);
1576             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1577
1578             instance = ret;
1579             return instance;
1580         }
1581
1582         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1583         {
1584             if (instance != null)
1585             {
1586                 return instance;
1587             }
1588             Application ret = New(args, stylesheet, windowMode, positionSize, useUIThread);
1589             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1590
1591             instance = ret;
1592             return instance;
1593         }
1594
1595         public static Application NewApplication(string[] args, string stylesheet, bool useUIThread, WindowData windowData)
1596         {
1597             if (instance != null)
1598             {
1599                 return instance;
1600             }
1601             Application ret = New(args, stylesheet, useUIThread, windowData);
1602             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1603
1604             instance = ret;
1605             return instance;
1606         }
1607
1608         /// <summary>
1609         /// Ensures that the function passed in is called from the main loop when it is idle.
1610         /// </summary>
1611         /// <param name="func">The function to call</param>
1612         /// <returns>true if added successfully, false otherwise</returns>
1613         /// <remarks>
1614         /// It will return false when one of the following conditions is met.
1615         /// 1) the <see cref="Window"/> is hidden.
1616         /// 2) the <see cref="Window"/> is iconified.
1617         /// </remarks>
1618         public bool AddIdle(System.Delegate func)
1619         {
1620             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1621             System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1622
1623             bool ret = Interop.Application.AddIdle(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1624
1625             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1626             return ret;
1627         }
1628
1629         /**
1630         * Outer::outer_method(int)
1631         */
1632         public static Application New()
1633         {
1634             Application ret = new Application(Interop.Application.New(), true);
1635             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1636             return ret;
1637         }
1638
1639         public static Application New(int argc)
1640         {
1641             Application ret = new Application(Interop.Application.New(argc), true);
1642             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1643             return ret;
1644         }
1645
1646         public static Application New(int argc, string stylesheet)
1647         {
1648             Application ret = new Application(Interop.Application.New(argc, stylesheet), true);
1649             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1650             return ret;
1651         }
1652
1653         public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode)
1654         {
1655             Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
1656             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1657             s_current = ret;
1658             return ret;
1659         }
1660
1661         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1662         {
1663             Application ret = null;
1664             int argc = 0;
1665             string argvStr = "";
1666             try
1667             {
1668                 argc = args.Length;
1669                 argvStr = string.Join(" ", args);
1670             }
1671             catch (Exception exception)
1672             {
1673                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1674                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1675                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1676                 throw;
1677             }
1678
1679             ret = new Application(NDalicPINVOKE.ApplicationNewManual4(argc, argvStr, stylesheet, (int)windowMode), true);
1680             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1681
1682             return ret;
1683         }
1684
1685         public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1686         {
1687             Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1688             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1689             return ret;
1690         }
1691
1692         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1693         {
1694             Application ret = null;
1695             int argc = 0;
1696             string argvStr = "";
1697             try
1698             {
1699                 argc = args.Length;
1700                 argvStr = string.Join(" ", args);
1701             }
1702             catch (Exception exception)
1703             {
1704                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1705                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1706                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1707                 throw;
1708             }
1709
1710             ret = new Application(NDalicPINVOKE.ApplicationNewWithWindowSizePosition(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1711             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1712
1713             return ret;
1714         }
1715
1716         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1717         {
1718             int argc = 0;
1719             string argvStr = "";
1720             try
1721             {
1722                 argc = args.Length;
1723                 argvStr = string.Join(" ", args);
1724             }
1725             catch (Exception exception)
1726             {
1727                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1728                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1729                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1730                 throw;
1731             }
1732
1733             // It will be removed until dali APIs are prepared.
1734             Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
1735
1736             Application ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
1737             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1738             return ret;
1739         }
1740
1741         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1742         {
1743             Application ret = null;
1744             int argc = 0;
1745             string argvStr = "";
1746             try
1747             {
1748                 argc = args.Length;
1749                 argvStr = string.Join(" ", args);
1750
1751                 ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize), useUIThread), true);
1752                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1753             }
1754             catch (Exception exception)
1755             {
1756                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1757                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1758                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1759                 throw;
1760             }
1761
1762             return ret;
1763         }
1764
1765         public static Application New(string[] args, string stylesheet, bool useUIThread, WindowData windowData)
1766         {
1767             Application ret = null;
1768             int argc = 0;
1769             string argvStr = "";
1770             try
1771             {
1772                 argc = args.Length;
1773                 argvStr = string.Join(" ", args);
1774
1775                 ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, useUIThread, WindowData.getCPtr(windowData)), true);
1776                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1777             }
1778             catch (Exception exception)
1779             {
1780                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1781                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1782                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1783                 throw;
1784             }
1785
1786             return ret;
1787         }
1788
1789         public Application() : this(Interop.Application.NewApplication(), true)
1790         {
1791             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1792         }
1793
1794         public Application(Application application) : this(Interop.Application.NewApplication(Application.getCPtr(application)), true)
1795         {
1796             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1797         }
1798
1799         public Application Assign(Application application)
1800         {
1801             Application ret = new Application(Interop.Application.Assign(SwigCPtr, Application.getCPtr(application)), false);
1802             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1803             return ret;
1804         }
1805
1806         public void MainLoop()
1807         {
1808             NDalicPINVOKE.ApplicationMainLoop(SwigCPtr);
1809             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1810         }
1811
1812         public void Lower()
1813         {
1814             Interop.Application.Lower(SwigCPtr);
1815             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1816         }
1817
1818         public void Quit()
1819         {
1820             Interop.Application.Quit(SwigCPtr);
1821             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1822         }
1823
1824         internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1825         {
1826             bool ret = Interop.Application.AddIdle(SwigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1827             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1828             return ret;
1829         }
1830
1831         public Window GetWindow()
1832         {
1833             if (window != null)
1834             {
1835                 return window;
1836             }
1837
1838             var nativeWindow = Interop.Application.GetWindow(SwigCPtr);
1839             window = Registry.GetManagedBaseHandleFromNativePtr(nativeWindow) as Window;
1840             if (window != null)
1841             {
1842                 HandleRef CPtr = new HandleRef(this, nativeWindow);
1843                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
1844                 CPtr = new HandleRef(null, IntPtr.Zero);
1845             }
1846             else
1847             {
1848                 window = new Window(nativeWindow, true);
1849             }
1850
1851             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1852             return window;
1853         }
1854
1855         public static string GetResourcePath()
1856         {
1857             string ret = Interop.Application.GetResourcePath();
1858             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1859             return ret;
1860         }
1861
1862         public string GetLanguage()
1863         {
1864             string ret = Interop.Application.GetLanguage(SwigCPtr);
1865             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1866             return ret;
1867         }
1868
1869         public string GetRegion()
1870         {
1871             string ret = Interop.Application.GetRegion(SwigCPtr);
1872             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1873             return ret;
1874         }
1875
1876         public void FlushUpdateMessages()
1877         {
1878             Interop.Application.FlushUpdateMessages(SwigCPtr);
1879             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1880         }
1881
1882         [EditorBrowsable(EditorBrowsableState.Never)]
1883         public static List<Window> GetWindowList()
1884         {
1885             if (Interop.Stage.IsInstalled() == false)
1886             {
1887                 NUILog.ErrorBacktrace($"[ERROR] dali adaptor and dali window is not ready. just return NULL here");
1888                 return null;
1889             }
1890
1891             uint ListSize = Interop.Application.GetWindowsListSize();
1892             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1893
1894             List<Window> WindowList = new List<Window>();
1895             for (uint i = 0; i < ListSize; ++i)
1896             {
1897                 Window currWin = WindowList.GetInstanceSafely<Window>(Interop.Application.GetWindowsFromList(i));
1898                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1899                 if (currWin != null)
1900                 {
1901                     WindowList.Add(currWin);
1902                 }
1903             }
1904             return WindowList;
1905         }
1906
1907         internal ApplicationSignal InitSignal()
1908         {
1909             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationInitSignal(SwigCPtr), false);
1910             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1911             return ret;
1912         }
1913
1914         internal ApplicationSignal TerminateSignal()
1915         {
1916             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTerminateSignal(SwigCPtr), false);
1917             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1918             return ret;
1919         }
1920
1921         internal ApplicationSignal PauseSignal()
1922         {
1923             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationPauseSignal(SwigCPtr), false);
1924             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1925             return ret;
1926         }
1927
1928         internal ApplicationSignal ResumeSignal()
1929         {
1930             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResumeSignal(SwigCPtr), false);
1931             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1932             return ret;
1933         }
1934
1935         internal ApplicationSignal ResetSignal()
1936         {
1937             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResetSignal(SwigCPtr), false);
1938             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1939             return ret;
1940         }
1941
1942         internal ApplicationControlSignal AppControlSignal()
1943         {
1944             ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationAppControlSignal(SwigCPtr), false);
1945             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1946             return ret;
1947         }
1948
1949         internal ApplicationSignal LanguageChangedSignal()
1950         {
1951             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationLanguageChangedSignal(SwigCPtr), false);
1952             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1953             return ret;
1954         }
1955
1956         internal ApplicationSignal RegionChangedSignal()
1957         {
1958             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationRegionChangedSignal(SwigCPtr), false);
1959             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1960             return ret;
1961         }
1962
1963         internal LowBatterySignalType BatteryLowSignal()
1964         {
1965             LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationLowBatterySignal(SwigCPtr), false);
1966             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1967             return ret;
1968         }
1969
1970         internal LowMemorySignalType MemoryLowSignal()
1971         {
1972             LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationLowMemorySignal(SwigCPtr), false);
1973             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1974             return ret;
1975         }
1976
1977         internal DeviceOrientationChangedSignalType DeviceOrientationChangedSignal()
1978         {
1979             DeviceOrientationChangedSignalType ret = new DeviceOrientationChangedSignalType(NDalicPINVOKE.ApplicationDeviceOrientationChangedSignal(SwigCPtr), false);
1980             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1981             return ret;
1982         }
1983
1984         //Task
1985         internal ApplicationSignal TaskInitSignal()
1986         {
1987             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskInitSignal(SwigCPtr), false);
1988             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1989             return ret;
1990         }
1991
1992         internal ApplicationSignal TaskTerminateSignal()
1993         {
1994             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskTerminateSignal(SwigCPtr), false);
1995             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1996             return ret;
1997         }
1998
1999         internal ApplicationControlSignal TaskAppControlSignal()
2000         {
2001             ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationTaskAppControlSignal(SwigCPtr), false);
2002             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2003             return ret;
2004         }
2005
2006         internal ApplicationSignal TaskLanguageChangedSignal()
2007         {
2008             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskLanguageChangedSignal(SwigCPtr), false);
2009             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2010             return ret;
2011         }
2012
2013         internal ApplicationSignal TaskRegionChangedSignal()
2014         {
2015             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskRegionChangedSignal(SwigCPtr), false);
2016             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2017             return ret;
2018         }
2019
2020         internal LowBatterySignalType TaskBatteryLowSignal()
2021         {
2022             LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationTaskLowBatterySignal(SwigCPtr), false);
2023             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2024             return ret;
2025         }
2026
2027         internal LowMemorySignalType TaskMemoryLowSignal()
2028         {
2029             LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationTaskLowMemorySignal(SwigCPtr), false);
2030             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2031             return ret;
2032         }
2033
2034         internal DeviceOrientationChangedSignalType TaskDeviceOrientationChangedSignal()
2035         {
2036             DeviceOrientationChangedSignalType ret = new DeviceOrientationChangedSignalType(NDalicPINVOKE.ApplicationTaskDeviceOrientationChangedSignal(SwigCPtr), false);
2037             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2038             return ret;
2039         }
2040     }
2041 }