d66cd5320d3c9100494a0bacb356ee6c25579d39
[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: GetWindow");
688             Tizen.Tracer.Begin("[NUI] OnApplicationInit: GetWindow");
689             Window.Instance = GetWindow();
690 #if !PROFILE_TV
691             //tv profile never use default focus indicator, so this is not needed!
692             _ = FocusManager.Instance;
693 #endif
694             Tizen.Tracer.End();
695
696             Log.Info("NUI", "[NUI] OnApplicationInit: Window Show");
697             Tizen.Tracer.Begin("[NUI] OnApplicationInit: Window Show");
698             // Notify that the window is displayed to the app core.
699             if (NUIApplication.IsPreload)
700             {
701                 Window.Instance.Show();
702             }
703             Tizen.Tracer.End();
704
705             Log.Info("NUI", "[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
706             Tizen.Tracer.Begin("[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
707             if (applicationInitEventHandler != null)
708             {
709                 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
710                 e.Application = this;
711                 applicationInitEventHandler.Invoke(this, e);
712             }
713             Tizen.Tracer.End();
714         }
715
716         // Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
717         //  provided by the user. Terminated signal is emitted when application is terminating
718         public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
719         {
720             add
721             {
722                 // Restricted to only one listener
723                 if (applicationTerminateEventHandler == null)
724                 {
725                     applicationTerminateEventHandler += value;
726
727                     applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
728                     terminateSignal = this.TerminateSignal();
729                     terminateSignal?.Connect(applicationTerminateEventCallbackDelegate);
730                 }
731             }
732
733             remove
734             {
735                 if (applicationTerminateEventHandler != null)
736                 {
737                     terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
738                     terminateSignal?.Dispose();
739                     terminateSignal = null;
740                 }
741
742                 applicationTerminateEventHandler -= value;
743             }
744         }
745
746         // Callback for Application TerminateSignal
747         private void OnNUIApplicationTerminate(IntPtr data)
748         {
749             if (applicationTerminateEventHandler != null)
750             {
751                 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
752                 e.Application = this;
753                 applicationTerminateEventHandler.Invoke(this, e);
754             }
755
756             List<Window> windows = GetWindowList();
757             if (windows != null)
758             {
759                 foreach (Window window in windows)
760                 {
761                     window?.DisconnectNativeSignals();
762                 }
763             }
764         }
765
766         // Event for Paused signal which can be used to subscribe/unsubscribe the event handler
767         // provided by the user. Paused signal is emitted when application is paused
768         public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
769         {
770             add
771             {
772                 // Restricted to only one listener
773                 if (applicationPauseEventHandler == null)
774                 {
775                     applicationPauseEventHandler += value;
776
777                     applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
778                     pauseSignal = this.PauseSignal();
779                     pauseSignal?.Connect(applicationPauseEventCallbackDelegate);
780                 }
781             }
782
783             remove
784             {
785                 if (applicationPauseEventHandler != null)
786                 {
787                     pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
788                     pauseSignal?.Dispose();
789                     pauseSignal = null;
790                 }
791
792                 applicationPauseEventHandler -= value;
793             }
794         }
795
796         // Callback for Application PauseSignal
797         private void OnNUIApplicationPause(IntPtr data)
798         {
799             if (applicationPauseEventHandler != null)
800             {
801                 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
802                 e.Application = this;
803                 applicationPauseEventHandler.Invoke(this, e);
804             }
805         }
806
807         // Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
808         //  provided by the user. Resumed signal is emitted when application is resumed
809         public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
810         {
811             add
812             {
813                 // Restricted to only one listener
814                 if (applicationResumeEventHandler == null)
815                 {
816                     applicationResumeEventHandler += value;
817
818                     applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
819                     resumeSignal = this.ResumeSignal();
820                     resumeSignal?.Connect(applicationResumeEventCallbackDelegate);
821                 }
822             }
823
824             remove
825             {
826                 if (applicationResumeEventHandler != null)
827                 {
828                     resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
829                     resumeSignal?.Dispose();
830                     resumeSignal = null;
831                 }
832
833                 applicationResumeEventHandler -= value;
834             }
835         }
836
837         // Callback for Application ResumeSignal
838         private void OnNUIApplicationResume(IntPtr data)
839         {
840             if (applicationResumeEventHandler != null)
841             {
842                 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
843                 e.Application = this;
844                 applicationResumeEventHandler.Invoke(this, e);
845             }
846         }
847
848         // Event for Reset signal which can be used to subscribe/unsubscribe the event handler
849         //  provided by the user. Reset signal is emitted when application is reset
850         public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
851         {
852             add
853             {
854                 // Restricted to only one listener
855                 if (applicationResetEventHandler == null)
856                 {
857                     applicationResetEventHandler += value;
858
859                     applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
860                     resetSignal = this.ResetSignal();
861                     resetSignal?.Connect(applicationResetEventCallbackDelegate);
862                 }
863             }
864
865             remove
866             {
867                 if (applicationResetEventHandler != null)
868                 {
869                     resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
870                     resetSignal?.Dispose();
871                     resetSignal = null;
872                 }
873
874                 applicationResetEventHandler -= value;
875             }
876         }
877
878         // Callback for Application ResetSignal
879         private void OnNUIApplicationReset(IntPtr data)
880         {
881             if (applicationResetEventHandler != null)
882             {
883                 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
884                 e.Application = this;
885                 applicationResetEventHandler.Invoke(this, e);
886             }
887         }
888
889         // Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
890         //  provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
891         public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
892         {
893             add
894             {
895                 // Restricted to only one listener
896                 if (applicationLanguageChangedEventHandler == null)
897                 {
898                     applicationLanguageChangedEventHandler += value;
899
900                     applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
901                     languageChangedSignal = this.LanguageChangedSignal();
902                     languageChangedSignal?.Connect(applicationLanguageChangedEventCallbackDelegate);
903                 }
904             }
905
906             remove
907             {
908                 if (applicationLanguageChangedEventHandler != null)
909                 {
910                     languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
911                     languageChangedSignal?.Dispose();
912                     languageChangedSignal = null;
913                 }
914
915                 applicationLanguageChangedEventHandler -= value;
916             }
917         }
918
919         // Callback for Application LanguageChangedSignal
920         private void OnNUIApplicationLanguageChanged(IntPtr data)
921         {
922             if (applicationLanguageChangedEventHandler != null)
923             {
924                 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
925                 e.Application = this;
926                 applicationLanguageChangedEventHandler.Invoke(this, e);
927             }
928         }
929
930         // Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
931         //  provided by the user. RegionChanged signal is emitted when the region of the device is changed.
932         public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
933         {
934             add
935             {
936                 // Restricted to only one listener
937                 if (applicationRegionChangedEventHandler == null)
938                 {
939                     applicationRegionChangedEventHandler += value;
940
941                     applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
942                     regionChangedSignal = this.RegionChangedSignal();
943                     regionChangedSignal?.Connect(applicationRegionChangedEventCallbackDelegate);
944                 }
945             }
946
947             remove
948             {
949                 if (applicationRegionChangedEventHandler != null)
950                 {
951                     regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
952                     regionChangedSignal?.Dispose();
953                     regionChangedSignal = null;
954                 }
955
956                 applicationRegionChangedEventHandler -= value;
957             }
958         }
959
960         // Callback for Application RegionChangedSignal
961         private void OnNUIApplicationRegionChanged(IntPtr data)
962         {
963             if (applicationRegionChangedEventHandler != null)
964             {
965                 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
966                 e.Application = this;
967                 applicationRegionChangedEventHandler.Invoke(this, e);
968             }
969         }
970
971         // Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
972         // provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
973         public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
974         {
975             add
976             {
977                 // Restricted to only one listener
978                 if (applicationBatteryLowEventHandler == null)
979                 {
980                     applicationBatteryLowEventHandler += value;
981
982                     applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
983                     batteryLowSignal = this.BatteryLowSignal();
984                     batteryLowSignal?.Connect(applicationBatteryLowEventCallbackDelegate);
985                 }
986             }
987
988             remove
989             {
990                 if (applicationBatteryLowEventHandler != null)
991                 {
992                     batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
993                     batteryLowSignal?.Dispose();
994                     batteryLowSignal = null;
995                 }
996
997                 applicationBatteryLowEventHandler -= value;
998             }
999         }
1000
1001         // Callback for Application BatteryLowSignal
1002         private void OnNUIApplicationBatteryLow(BatteryStatus status)
1003         {
1004             NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1005
1006             // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1007             e.BatteryStatus = status;
1008             applicationBatteryLowEventHandler?.Invoke(this, e);
1009         }
1010
1011         // Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
1012         //  provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
1013         public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
1014         {
1015             add
1016             {
1017                 // Restricted to only one listener
1018                 if (applicationMemoryLowEventHandler == null)
1019                 {
1020                     applicationMemoryLowEventHandler += value;
1021
1022                     applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
1023                     memoryLowSignal = this.MemoryLowSignal();
1024                     memoryLowSignal?.Connect(applicationMemoryLowEventCallbackDelegate);
1025                 }
1026             }
1027
1028             remove
1029             {
1030                 if (applicationMemoryLowEventHandler != null)
1031                 {
1032                     memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
1033                     memoryLowSignal?.Dispose();
1034                     memoryLowSignal = null;
1035                 }
1036
1037                 applicationMemoryLowEventHandler -= value;
1038             }
1039         }
1040
1041         // Callback for Application MemoryLowSignal
1042         private void OnNUIApplicationMemoryLow(MemoryStatus status)
1043         {
1044             NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1045
1046             // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1047             e.MemoryStatus = status;
1048             applicationMemoryLowEventHandler?.Invoke(this, e);
1049         }
1050
1051         // Event for changing Device orientation signal which can be used to subscribe/unsubscribe the event handler
1052         //  provided by the user. DeviceOrientationChanged signal is emitted when the device orientation is changed.
1053         public event DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> DeviceOrientationChanged
1054         {
1055             add
1056             {
1057                 // Restricted to only one listener
1058                 if (applicationDeviceOrientationChangedEventHandler == null)
1059                 {
1060                     applicationDeviceOrientationChangedEventHandler += value;
1061
1062                     applicationDeviceOrientationChangedEventCallback = new NUIApplicationDeviceOrientationChangedEventCallback(OnNUIApplicationDeviceOrientationChanged);
1063                     deviceOrientationChangedSignal = this.DeviceOrientationChangedSignal();
1064                     deviceOrientationChangedSignal?.Connect(applicationDeviceOrientationChangedEventCallback);
1065                 }
1066             }
1067
1068             remove
1069             {
1070                 if (applicationDeviceOrientationChangedEventHandler != null)
1071                 {
1072                     deviceOrientationChangedSignal?.Disconnect(applicationDeviceOrientationChangedEventCallback);
1073                     deviceOrientationChangedSignal?.Dispose();
1074                     deviceOrientationChangedSignal = null;
1075                 }
1076
1077                 applicationDeviceOrientationChangedEventHandler -= value;
1078             }
1079         }
1080
1081         // Callback for Application DeviceOrientationChangedSignal
1082         private void OnNUIApplicationDeviceOrientationChanged(DeviceOrientationStatus status)
1083         {
1084             NUIApplicationDeviceOrientationChangedEventArgs e = new NUIApplicationDeviceOrientationChangedEventArgs();
1085
1086             e.DeviceOrientationStatus = status;
1087             applicationDeviceOrientationChangedEventHandler?.Invoke(this, e);
1088         }
1089
1090         // Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
1091         //  provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
1092         public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
1093         {
1094             add
1095             {
1096                 // Restricted to only one listener
1097                 if (applicationAppControlEventHandler == null)
1098                 {
1099                     applicationAppControlEventHandler += value;
1100
1101                     applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1102                     appControlSignal = this.AppControlSignal();
1103                     appControlSignal?.Connect(applicationAppControlEventCallbackDelegate);
1104                 }
1105             }
1106
1107             remove
1108             {
1109                 if (applicationAppControlEventHandler != null)
1110                 {
1111                     appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
1112                     appControlSignal?.Dispose();
1113                     appControlSignal = null;
1114                 }
1115
1116                 applicationAppControlEventHandler -= value;
1117             }
1118         }
1119
1120         // Callback for Application AppControlSignal
1121         private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1122         {
1123             if (applicationAppControlEventHandler != null)
1124             {
1125                 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1126                 e.VoidP = voidp;
1127                 e.Application = this;
1128                 applicationAppControlEventHandler.Invoke(this, e);
1129             }
1130         }
1131
1132         /// <summary>
1133         /// Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
1134         ///  provided by the user. Initialized signal is emitted when application is initialized
1135         /// </summary>
1136         public event DaliEventHandler<object, NUIApplicationInitEventArgs> TaskInitialized
1137         {
1138             add
1139             {
1140                 // Restricted to only one listener
1141                 if (applicationTaskInitEventHandler == null)
1142                 {
1143                     Tizen.Log.Fatal("NUI", "TaskInitialized Property adding");
1144                     applicationTaskInitEventHandler += value;
1145                     applicationTaskInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationTaskInit);
1146                     taskInitSignal = this.TaskInitSignal();
1147                     taskInitSignal?.Connect(applicationTaskInitEventCallbackDelegate);
1148                 }
1149             }
1150
1151             remove
1152             {
1153                 if (applicationTaskInitEventHandler != null)
1154                 {
1155                     taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
1156                     taskInitSignal?.Dispose();
1157                     taskInitSignal = null;
1158                 }
1159
1160                 applicationTaskInitEventHandler -= value;
1161             }
1162         }
1163
1164         private void OnApplicationTaskInit(IntPtr data)
1165         {
1166             if (applicationTaskInitEventHandler != null)
1167             {
1168                 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
1169                 e.Application = this;
1170                 applicationTaskInitEventHandler.Invoke(this, e);
1171             }
1172
1173         }
1174
1175         /// <summary>
1176         /// Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
1177         ///  provided by the user. Terminated signal is emitted when application is terminating
1178         /// </summary>
1179         public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> TaskTerminating
1180         {
1181             add
1182             {
1183                 // Restricted to only one listener
1184                 if (applicationTaskTerminateEventHandler == null)
1185                 {
1186                     applicationTaskTerminateEventHandler += value;
1187
1188                     applicationTaskTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTaskTerminate);
1189                     taskTerminateSignal = this.TaskTerminateSignal();
1190                     taskTerminateSignal?.Connect(applicationTaskTerminateEventCallbackDelegate);
1191                 }
1192             }
1193
1194             remove
1195             {
1196                 if (applicationTaskTerminateEventHandler != null)
1197                 {
1198                     taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
1199                     taskTerminateSignal?.Dispose();
1200                     taskTerminateSignal = null;
1201                 }
1202
1203                 applicationTaskTerminateEventHandler -= value;
1204             }
1205         }
1206
1207         private void OnNUIApplicationTaskTerminate(IntPtr data)
1208         {
1209             if (applicationTaskTerminateEventHandler != null)
1210             {
1211                 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
1212                 e.Application = this;
1213                 applicationTaskTerminateEventHandler.Invoke(this, e);
1214             }
1215         }
1216
1217         /// <summary>
1218         /// Event for TaskLanguageChanged signal which can be used to subscribe/unsubscribe the event handler
1219         ///  provided by the user. TaskLanguageChanged signal is emitted when the region of the device is changed.
1220         /// </summary>
1221         public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> TaskLanguageChanged
1222         {
1223             add
1224             {
1225                 // Restricted to only one listener
1226                 if (applicationTaskLanguageChangedEventHandler == null)
1227                 {
1228                     applicationTaskLanguageChangedEventHandler += value;
1229
1230                     applicationTaskLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationTaskLanguageChanged);
1231                     taskLanguageChangedSignal = this.TaskLanguageChangedSignal();
1232                     taskLanguageChangedSignal?.Connect(applicationTaskLanguageChangedEventCallbackDelegate);
1233                 }
1234             }
1235
1236             remove
1237             {
1238                 if (applicationTaskLanguageChangedEventHandler != null)
1239                 {
1240                     taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
1241                     taskLanguageChangedSignal?.Dispose();
1242                     taskLanguageChangedSignal = null;
1243                 }
1244
1245                 applicationTaskLanguageChangedEventHandler -= value;
1246             }
1247         }
1248
1249         private void OnNUIApplicationTaskLanguageChanged(IntPtr data)
1250         {
1251             if (applicationTaskLanguageChangedEventHandler != null)
1252             {
1253                 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
1254                 e.Application = this;
1255                 applicationTaskLanguageChangedEventHandler.Invoke(this, e);
1256             }
1257         }
1258
1259         /// <summary>
1260         /// Event for TaskRegionChanged signal which can be used to subscribe/unsubscribe the event handler
1261         ///  provided by the user. TaskRegionChanged signal is emitted when the region of the device is changed.
1262         /// </summary>
1263         public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> TaskRegionChanged
1264         {
1265             add
1266             {
1267                 // Restricted to only one listener
1268                 if (applicationTaskRegionChangedEventHandler == null)
1269                 {
1270                     applicationTaskRegionChangedEventHandler += value;
1271
1272                     applicationTaskRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationTaskRegionChanged);
1273                     taskRegionChangedSignal = this.TaskRegionChangedSignal();
1274                     taskRegionChangedSignal?.Connect(applicationTaskRegionChangedEventCallbackDelegate);
1275                 }
1276             }
1277
1278             remove
1279             {
1280                 if (applicationTaskRegionChangedEventHandler != null)
1281                 {
1282                     taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
1283                     taskRegionChangedSignal?.Dispose();
1284                     taskRegionChangedSignal = null;
1285                 }
1286
1287                 applicationTaskRegionChangedEventHandler -= value;
1288             }
1289         }
1290
1291         private void OnNUIApplicationTaskRegionChanged(IntPtr data)
1292         {
1293             if (applicationTaskRegionChangedEventHandler != null)
1294             {
1295                 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
1296                 e.Application = this;
1297                 applicationTaskRegionChangedEventHandler.Invoke(this, e);
1298             }
1299         }
1300
1301         /// <summary>
1302         /// Event for TaskBatteryLow signal which can be used to subscribe/unsubscribe the event handler
1303         /// provided by the user. TaskBatteryLow signal is emitted when the battery level of the device is low.
1304         /// </summary>
1305         public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> TaskBatteryLow
1306         {
1307             add
1308             {
1309                 // Restricted to only one listener
1310                 if (applicationTaskBatteryLowEventHandler == null)
1311                 {
1312                     applicationTaskBatteryLowEventHandler += value;
1313
1314                     applicationTaskBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationTaskBatteryLow);
1315                     taskBatteryLowSignal = this.TaskBatteryLowSignal();
1316                     taskBatteryLowSignal?.Connect(applicationTaskBatteryLowEventCallbackDelegate);
1317                 }
1318             }
1319
1320             remove
1321             {
1322                 if (applicationTaskBatteryLowEventHandler != null)
1323                 {
1324                     taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
1325                     taskBatteryLowSignal?.Dispose();
1326                     taskBatteryLowSignal = null;
1327                 }
1328
1329                 applicationTaskBatteryLowEventHandler -= value;
1330             }
1331         }
1332
1333         private void OnNUIApplicationTaskBatteryLow(BatteryStatus status)
1334         {
1335             NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1336
1337             // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1338             e.BatteryStatus = status;
1339             applicationTaskBatteryLowEventHandler?.Invoke(this, e);
1340         }
1341
1342         /// <summary>
1343         /// Event for TaskMemoryLow signal which can be used to subscribe/unsubscribe the event handler
1344         /// provided by the user. TaskMemoryLow signal is emitted when the memory level of the device is low.
1345         /// </summary>
1346         public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> TaskMemoryLow
1347         {
1348             add
1349             {
1350                 // Restricted to only one listener
1351                 if (applicationTaskMemoryLowEventHandler == null)
1352                 {
1353                     applicationTaskMemoryLowEventHandler += value;
1354
1355                     applicationTaskMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationTaskMemoryLow);
1356                     taskMemoryLowSignal = this.TaskMemoryLowSignal();
1357                     taskMemoryLowSignal?.Connect(applicationTaskMemoryLowEventCallbackDelegate);
1358                 }
1359             }
1360
1361             remove
1362             {
1363                 if (applicationTaskMemoryLowEventHandler != null)
1364                 {
1365                     taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
1366                     taskMemoryLowSignal?.Dispose();
1367                     taskMemoryLowSignal = null;
1368                 }
1369
1370                 applicationTaskMemoryLowEventHandler -= value;
1371             }
1372         }
1373
1374         private void OnNUIApplicationTaskMemoryLow(MemoryStatus status)
1375         {
1376             NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1377
1378             // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1379             e.MemoryStatus = status;
1380             applicationTaskMemoryLowEventHandler?.Invoke(this, e);
1381         }
1382
1383         /// <summary>
1384         /// Event for TaskDeviceOrientationChanged signal which can be used to subscribe/unsubscribe the event handler
1385         /// provided by the user. TaskDeviceOrientationChanged signal is emitted when the device orientation is changed.
1386         /// </summary>
1387         public event DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> TaskDeviceOrientationChanged
1388         {
1389             add
1390             {
1391                 if (applicationTaskDeviceOrientationChangedEventHandler == null)
1392                 {
1393                     applicationTaskDeviceOrientationChangedEventHandler += value;
1394
1395                     applicationTaskDeviceOrientationChangedEventCallback = new NUIApplicationDeviceOrientationChangedEventCallback(OnNUIApplicationTaskDeviceOrientationChanged);
1396                     taskDeviceOrientationChangedSignal = this.TaskDeviceOrientationChangedSignal();
1397                     taskDeviceOrientationChangedSignal?.Connect(applicationTaskDeviceOrientationChangedEventCallback);
1398                 }
1399             }
1400
1401             remove
1402             {
1403                 if (applicationTaskDeviceOrientationChangedEventHandler != null)
1404                 {
1405                     taskDeviceOrientationChangedSignal?.Disconnect(applicationTaskDeviceOrientationChangedEventCallback);
1406                     taskDeviceOrientationChangedSignal?.Dispose();
1407                     taskDeviceOrientationChangedSignal = null;
1408                 }
1409
1410                 applicationTaskDeviceOrientationChangedEventHandler -= value;
1411             }
1412         }
1413
1414         private void OnNUIApplicationTaskDeviceOrientationChanged(DeviceOrientationStatus status)
1415         {
1416             NUIApplicationDeviceOrientationChangedEventArgs e = new NUIApplicationDeviceOrientationChangedEventArgs();
1417
1418             e.DeviceOrientationStatus = status;
1419             applicationTaskDeviceOrientationChangedEventHandler?.Invoke(this, e);
1420         }
1421
1422         /// <summary>
1423         /// Event for TaskAppControl signal which can be used to subscribe/unsubscribe the event handler
1424         /// provided by the user. TaskAppControl signal is emitted when another application sends a launch request to the application.
1425         /// </summary>
1426         public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> TaskAppControl
1427         {
1428             add
1429             {
1430                 // Restricted to only one listener
1431                 if (applicationTaskAppControlEventHandler == null)
1432                 {
1433                     applicationTaskAppControlEventHandler += value;
1434
1435                     applicationTaskAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationTaskAppControl);
1436                     taskAppControlSignal = this.TaskAppControlSignal();
1437                     taskAppControlSignal?.Connect(applicationTaskAppControlEventCallbackDelegate);
1438                 }
1439             }
1440
1441             remove
1442             {
1443                 if (applicationTaskAppControlEventHandler != null)
1444                 {
1445                     taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
1446                     taskAppControlSignal?.Dispose();
1447                     taskAppControlSignal = null;
1448                 }
1449
1450                 applicationTaskAppControlEventHandler -= value;
1451             }
1452         }
1453
1454         private void OnNUIApplicationTaskAppControl(IntPtr application, IntPtr voidp)
1455         {
1456             if (applicationTaskAppControlEventHandler != null)
1457             {
1458                 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1459                 e.VoidP = voidp;
1460                 e.Application = this;
1461                 applicationTaskAppControlEventHandler.Invoke(this, e);
1462             }
1463         }
1464
1465         protected static Application instance; // singleton
1466
1467         public static Application Instance
1468         {
1469             get
1470             {
1471                 return instance;
1472             }
1473         }
1474
1475         public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1476         {
1477             if (cPtr == global::System.IntPtr.Zero)
1478             {
1479                 return null;
1480             }
1481
1482             Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1483             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1484             return ret;
1485         }
1486
1487         public static Application NewApplication()
1488         {
1489             return NewApplication("", NUIApplication.WindowMode.Opaque);
1490         }
1491
1492         public static Application NewApplication(string stylesheet)
1493         {
1494             return NewApplication(stylesheet, NUIApplication.WindowMode.Opaque);
1495         }
1496
1497         public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode)
1498         {
1499             // register all Views with the type registry, so that can be created / styled via JSON
1500             //ViewRegistryHelper.Initialize(); //moved to Application side.
1501             if (instance != null)
1502             {
1503                 return instance;
1504             }
1505
1506             Application ret = New(1, stylesheet, windowMode);
1507             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1508
1509             // set the singleton
1510             instance = ret;
1511             return ret;
1512         }
1513
1514         public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1515         {
1516             if (instance != null)
1517             {
1518                 return instance;
1519             }
1520             Application ret = New(1, stylesheet, windowMode, positionSize);
1521             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1522
1523             // set the singleton
1524             instance = ret;
1525             return ret;
1526         }
1527
1528         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1529         {
1530             if (instance != null)
1531             {
1532                 return instance;
1533             }
1534             Application ret = New(args, stylesheet, windowMode);
1535             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1536
1537             // set the singleton
1538             instance = ret;
1539             return instance;
1540         }
1541
1542         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1543         {
1544             if (instance != null)
1545             {
1546                 return instance;
1547             }
1548             Application ret = New(args, stylesheet, windowMode, positionSize);
1549             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1550
1551             // set the singleton
1552             instance = ret;
1553             return instance;
1554         }
1555
1556         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1557         {
1558             if (instance != null)
1559             {
1560                 return instance;
1561             }
1562             Application ret = New(args, stylesheet, windowMode, type);
1563             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1564
1565             instance = ret;
1566             return instance;
1567         }
1568
1569         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1570         {
1571             if (instance != null)
1572             {
1573                 return instance;
1574             }
1575             Application ret = New(args, stylesheet, windowMode, positionSize, useUIThread);
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, bool useUIThread, WindowData windowData)
1583         {
1584             if (instance != null)
1585             {
1586                 return instance;
1587             }
1588             Application ret = New(args, stylesheet, useUIThread, windowData);
1589             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1590
1591             instance = ret;
1592             return instance;
1593         }
1594
1595         /// <summary>
1596         /// Ensures that the function passed in is called from the main loop when it is idle.
1597         /// </summary>
1598         /// <param name="func">The function to call</param>
1599         /// <returns>true if added successfully, false otherwise</returns>
1600         /// <remarks>
1601         /// It will return false when one of the following conditions is met.
1602         /// 1) the <see cref="Window"/> is hidden.
1603         /// 2) the <see cref="Window"/> is iconified.
1604         /// </remarks>
1605         public bool AddIdle(System.Delegate func)
1606         {
1607             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1608             System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1609
1610             bool ret = Interop.Application.AddIdle(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1611
1612             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1613             return ret;
1614         }
1615
1616         /**
1617         * Outer::outer_method(int)
1618         */
1619         public static Application New()
1620         {
1621             Application ret = new Application(Interop.Application.New(), true);
1622             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1623             return ret;
1624         }
1625
1626         public static Application New(int argc)
1627         {
1628             Application ret = new Application(Interop.Application.New(argc), true);
1629             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1630             return ret;
1631         }
1632
1633         public static Application New(int argc, string stylesheet)
1634         {
1635             Application ret = new Application(Interop.Application.New(argc, stylesheet), true);
1636             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1637             return ret;
1638         }
1639
1640         public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode)
1641         {
1642             Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
1643             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1644             s_current = ret;
1645             return ret;
1646         }
1647
1648         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1649         {
1650             Application ret = null;
1651             int argc = 0;
1652             string argvStr = "";
1653             try
1654             {
1655                 argc = args.Length;
1656                 argvStr = string.Join(" ", args);
1657             }
1658             catch (Exception exception)
1659             {
1660                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1661                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1662                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1663                 throw;
1664             }
1665
1666             ret = new Application(NDalicPINVOKE.ApplicationNewManual4(argc, argvStr, stylesheet, (int)windowMode), true);
1667             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1668
1669             return ret;
1670         }
1671
1672         public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1673         {
1674             Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1675             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1676             return ret;
1677         }
1678
1679         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1680         {
1681             Application ret = null;
1682             int argc = 0;
1683             string argvStr = "";
1684             try
1685             {
1686                 argc = args.Length;
1687                 argvStr = string.Join(" ", args);
1688             }
1689             catch (Exception exception)
1690             {
1691                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1692                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1693                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1694                 throw;
1695             }
1696
1697             ret = new Application(NDalicPINVOKE.ApplicationNewWithWindowSizePosition(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1698             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1699
1700             return ret;
1701         }
1702
1703         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1704         {
1705             int argc = 0;
1706             string argvStr = "";
1707             try
1708             {
1709                 argc = args.Length;
1710                 argvStr = string.Join(" ", args);
1711             }
1712             catch (Exception exception)
1713             {
1714                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1715                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1716                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1717                 throw;
1718             }
1719
1720             // It will be removed until dali APIs are prepared.
1721             Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
1722
1723             Application ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
1724             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1725             return ret;
1726         }
1727
1728         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1729         {
1730             Application ret = null;
1731             int argc = 0;
1732             string argvStr = "";
1733             try
1734             {
1735                 argc = args.Length;
1736                 argvStr = string.Join(" ", args);
1737
1738                 ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize), useUIThread), true);
1739                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1740             }
1741             catch (Exception exception)
1742             {
1743                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1744                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1745                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1746                 throw;
1747             }
1748
1749             return ret;
1750         }
1751
1752         public static Application New(string[] args, string stylesheet, bool useUIThread, WindowData windowData)
1753         {
1754             Application ret = null;
1755             int argc = 0;
1756             string argvStr = "";
1757             try
1758             {
1759                 argc = args.Length;
1760                 argvStr = string.Join(" ", args);
1761
1762                 ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, useUIThread, WindowData.getCPtr(windowData)), true);
1763                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1764             }
1765             catch (Exception exception)
1766             {
1767                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1768                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1769                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1770                 throw;
1771             }
1772
1773             return ret;
1774         }
1775
1776         public Application() : this(Interop.Application.NewApplication(), true)
1777         {
1778             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1779         }
1780
1781         public Application(Application application) : this(Interop.Application.NewApplication(Application.getCPtr(application)), true)
1782         {
1783             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1784         }
1785
1786         public Application Assign(Application application)
1787         {
1788             Application ret = new Application(Interop.Application.Assign(SwigCPtr, Application.getCPtr(application)), false);
1789             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1790             return ret;
1791         }
1792
1793         public void MainLoop()
1794         {
1795             NDalicPINVOKE.ApplicationMainLoop(SwigCPtr);
1796             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1797         }
1798
1799         public void Lower()
1800         {
1801             Interop.Application.Lower(SwigCPtr);
1802             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1803         }
1804
1805         public void Quit()
1806         {
1807             Interop.Application.Quit(SwigCPtr);
1808             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1809         }
1810
1811         internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1812         {
1813             bool ret = Interop.Application.AddIdle(SwigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1814             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1815             return ret;
1816         }
1817
1818         public Window GetWindow()
1819         {
1820             if (window != null)
1821             {
1822                 return window;
1823             }
1824
1825             var nativeWindow = Interop.Application.GetWindow(SwigCPtr);
1826             window = Registry.GetManagedBaseHandleFromNativePtr(nativeWindow) as Window;
1827             if (window != null)
1828             {
1829                 HandleRef CPtr = new HandleRef(this, nativeWindow);
1830                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
1831                 CPtr = new HandleRef(null, IntPtr.Zero);
1832             }
1833             else
1834             {
1835                 window = new Window(nativeWindow, true);
1836             }
1837
1838             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1839             return window;
1840         }
1841
1842         public static string GetResourcePath()
1843         {
1844             string ret = Interop.Application.GetResourcePath();
1845             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1846             return ret;
1847         }
1848
1849         public string GetLanguage()
1850         {
1851             string ret = Interop.Application.GetLanguage(SwigCPtr);
1852             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1853             return ret;
1854         }
1855
1856         public string GetRegion()
1857         {
1858             string ret = Interop.Application.GetRegion(SwigCPtr);
1859             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1860             return ret;
1861         }
1862
1863         public void FlushUpdateMessages()
1864         {
1865             Interop.Application.FlushUpdateMessages(SwigCPtr);
1866             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1867         }
1868
1869         [EditorBrowsable(EditorBrowsableState.Never)]
1870         public static List<Window> GetWindowList()
1871         {
1872             if (Interop.Stage.IsInstalled() == false)
1873             {
1874                 NUILog.ErrorBacktrace($"[ERROR] dali adaptor and dali window is not ready. just return NULL here");
1875                 return null;
1876             }
1877
1878             uint ListSize = Interop.Application.GetWindowsListSize();
1879             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1880
1881             List<Window> WindowList = new List<Window>();
1882             for (uint i = 0; i < ListSize; ++i)
1883             {
1884                 Window currWin = WindowList.GetInstanceSafely<Window>(Interop.Application.GetWindowsFromList(i));
1885                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1886                 if (currWin != null)
1887                 {
1888                     WindowList.Add(currWin);
1889                 }
1890             }
1891             return WindowList;
1892         }
1893
1894         internal ApplicationSignal InitSignal()
1895         {
1896             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationInitSignal(SwigCPtr), false);
1897             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1898             return ret;
1899         }
1900
1901         internal ApplicationSignal TerminateSignal()
1902         {
1903             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTerminateSignal(SwigCPtr), false);
1904             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1905             return ret;
1906         }
1907
1908         internal ApplicationSignal PauseSignal()
1909         {
1910             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationPauseSignal(SwigCPtr), false);
1911             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1912             return ret;
1913         }
1914
1915         internal ApplicationSignal ResumeSignal()
1916         {
1917             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResumeSignal(SwigCPtr), false);
1918             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1919             return ret;
1920         }
1921
1922         internal ApplicationSignal ResetSignal()
1923         {
1924             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResetSignal(SwigCPtr), false);
1925             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1926             return ret;
1927         }
1928
1929         internal ApplicationControlSignal AppControlSignal()
1930         {
1931             ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationAppControlSignal(SwigCPtr), false);
1932             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1933             return ret;
1934         }
1935
1936         internal ApplicationSignal LanguageChangedSignal()
1937         {
1938             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationLanguageChangedSignal(SwigCPtr), false);
1939             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1940             return ret;
1941         }
1942
1943         internal ApplicationSignal RegionChangedSignal()
1944         {
1945             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationRegionChangedSignal(SwigCPtr), false);
1946             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1947             return ret;
1948         }
1949
1950         internal LowBatterySignalType BatteryLowSignal()
1951         {
1952             LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationLowBatterySignal(SwigCPtr), false);
1953             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1954             return ret;
1955         }
1956
1957         internal LowMemorySignalType MemoryLowSignal()
1958         {
1959             LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationLowMemorySignal(SwigCPtr), false);
1960             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1961             return ret;
1962         }
1963
1964         internal DeviceOrientationChangedSignalType DeviceOrientationChangedSignal()
1965         {
1966             DeviceOrientationChangedSignalType ret = new DeviceOrientationChangedSignalType(NDalicPINVOKE.ApplicationDeviceOrientationChangedSignal(SwigCPtr), false);
1967             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1968             return ret;
1969         }
1970
1971         //Task
1972         internal ApplicationSignal TaskInitSignal()
1973         {
1974             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskInitSignal(SwigCPtr), false);
1975             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1976             return ret;
1977         }
1978
1979         internal ApplicationSignal TaskTerminateSignal()
1980         {
1981             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskTerminateSignal(SwigCPtr), false);
1982             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1983             return ret;
1984         }
1985
1986         internal ApplicationControlSignal TaskAppControlSignal()
1987         {
1988             ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationTaskAppControlSignal(SwigCPtr), false);
1989             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1990             return ret;
1991         }
1992
1993         internal ApplicationSignal TaskLanguageChangedSignal()
1994         {
1995             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskLanguageChangedSignal(SwigCPtr), false);
1996             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1997             return ret;
1998         }
1999
2000         internal ApplicationSignal TaskRegionChangedSignal()
2001         {
2002             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskRegionChangedSignal(SwigCPtr), false);
2003             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2004             return ret;
2005         }
2006
2007         internal LowBatterySignalType TaskBatteryLowSignal()
2008         {
2009             LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationTaskLowBatterySignal(SwigCPtr), false);
2010             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2011             return ret;
2012         }
2013
2014         internal LowMemorySignalType TaskMemoryLowSignal()
2015         {
2016             LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationTaskLowMemorySignal(SwigCPtr), false);
2017             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2018             return ret;
2019         }
2020
2021         internal DeviceOrientationChangedSignalType TaskDeviceOrientationChangedSignal()
2022         {
2023             DeviceOrientationChangedSignalType ret = new DeviceOrientationChangedSignalType(NDalicPINVOKE.ApplicationTaskDeviceOrientationChangedSignal(SwigCPtr), false);
2024             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2025             return ret;
2026         }
2027     }
2028 }