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