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