[NUI] Add license, delete unnecessary code (#2679)
[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             win?.Dispose();
494             win = 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 win;
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 initialised
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
617             // Notify that the window is displayed to the app core.
618             if (NUIApplication.IsPreload)
619             {
620                 Window.Instance.Show();
621             }
622
623             if (applicationInitEventHandler != null)
624             {
625                 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
626                 e.Application = this;
627                 applicationInitEventHandler.Invoke(this, e);
628             }
629
630         }
631
632         /**
633           * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
634           *  provided by the user. Terminated signal is emitted when application is terminating
635           */
636         public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
637         {
638             add
639             {
640                 // Restricted to only one listener
641                 if (applicationTerminateEventHandler == null)
642                 {
643                     applicationTerminateEventHandler += value;
644
645                     applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
646                     terminateSignal = this.TerminateSignal();
647                     terminateSignal?.Connect(applicationTerminateEventCallbackDelegate);
648                 }
649             }
650
651             remove
652             {
653                 if (applicationTerminateEventHandler != null)
654                 {
655                     terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
656                     terminateSignal?.Dispose();
657                     terminateSignal = null;
658                 }
659
660                 applicationTerminateEventHandler -= value;
661             }
662         }
663
664         // Callback for Application TerminateSignal
665         private void OnNUIApplicationTerminate(IntPtr data)
666         {
667             if (applicationTerminateEventHandler != null)
668             {
669                 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
670                 e.Application = this;
671                 applicationTerminateEventHandler.Invoke(this, e);
672             }
673
674             List<Window> windows = GetWindowList();
675             foreach (Window window in windows)
676             {
677                 window?.DisconnectNativeSignals();
678             }
679         }
680
681         /**
682           * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
683           * provided by the user. Paused signal is emitted when application is paused
684           */
685         public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
686         {
687             add
688             {
689                 // Restricted to only one listener
690                 if (applicationPauseEventHandler == null)
691                 {
692                     applicationPauseEventHandler += value;
693
694                     applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
695                     pauseSignal = this.PauseSignal();
696                     pauseSignal?.Connect(applicationPauseEventCallbackDelegate);
697                 }
698             }
699
700             remove
701             {
702                 if (applicationPauseEventHandler != null)
703                 {
704                     pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
705                     pauseSignal?.Dispose();
706                     pauseSignal = null;
707                 }
708
709                 applicationPauseEventHandler -= value;
710             }
711         }
712
713         // Callback for Application PauseSignal
714         private void OnNUIApplicationPause(IntPtr data)
715         {
716             if (applicationPauseEventHandler != null)
717             {
718                 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
719                 e.Application = this;
720                 applicationPauseEventHandler.Invoke(this, e);
721             }
722         }
723
724         /**
725           * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
726           *  provided by the user. Resumed signal is emitted when application is resumed
727           */
728         public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
729         {
730             add
731             {
732                 // Restricted to only one listener
733                 if (applicationResumeEventHandler == null)
734                 {
735                     applicationResumeEventHandler += value;
736
737                     applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
738                     resumeSignal = this.ResumeSignal();
739                     resumeSignal?.Connect(applicationResumeEventCallbackDelegate);
740                 }
741             }
742
743             remove
744             {
745                 if (applicationResumeEventHandler != null)
746                 {
747                     resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
748                     resumeSignal?.Dispose();
749                     resumeSignal = null;
750                 }
751
752                 applicationResumeEventHandler -= value;
753             }
754         }
755
756         // Callback for Application ResumeSignal
757         private void OnNUIApplicationResume(IntPtr data)
758         {
759             if (applicationResumeEventHandler != null)
760             {
761                 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
762                 e.Application = this;
763                 applicationResumeEventHandler.Invoke(this, e);
764             }
765         }
766
767         /**
768           * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
769           *  provided by the user. Reset signal is emitted when application is reset
770           */
771         public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
772         {
773             add
774             {
775                 // Restricted to only one listener
776                 if (applicationResetEventHandler == null)
777                 {
778                     applicationResetEventHandler += value;
779
780                     applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
781                     resetSignal = this.ResetSignal();
782                     resetSignal?.Connect(applicationResetEventCallbackDelegate);
783                 }
784             }
785
786             remove
787             {
788                 if (applicationResetEventHandler != null)
789                 {
790                     resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
791                     resetSignal?.Dispose();
792                     resetSignal = null;
793                 }
794
795                 applicationResetEventHandler -= value;
796             }
797         }
798
799         // Callback for Application ResetSignal
800         private void OnNUIApplicationReset(IntPtr data)
801         {
802             if (applicationResetEventHandler != null)
803             {
804                 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
805                 e.Application = this;
806                 applicationResetEventHandler.Invoke(this, e);
807             }
808         }
809
810         /**
811           * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
812           *  provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
813           */
814         public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
815         {
816             add
817             {
818                 // Restricted to only one listener
819                 if (applicationLanguageChangedEventHandler == null)
820                 {
821                     applicationLanguageChangedEventHandler += value;
822
823                     applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
824                     languageChangedSignal = this.LanguageChangedSignal();
825                     languageChangedSignal?.Connect(applicationLanguageChangedEventCallbackDelegate);
826                 }
827             }
828
829             remove
830             {
831                 if (applicationLanguageChangedEventHandler != null)
832                 {
833                     languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
834                     languageChangedSignal?.Dispose();
835                     languageChangedSignal = null;
836                 }
837
838                 applicationLanguageChangedEventHandler -= value;
839             }
840         }
841
842         // Callback for Application LanguageChangedSignal
843         private void OnNUIApplicationLanguageChanged(IntPtr data)
844         {
845             if (applicationLanguageChangedEventHandler != null)
846             {
847                 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
848                 e.Application = this;
849                 applicationLanguageChangedEventHandler.Invoke(this, e);
850             }
851         }
852
853         /**
854           * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
855           *  provided by the user. RegionChanged signal is emitted when the region of the device is changed.
856           */
857         public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
858         {
859             add
860             {
861                 // Restricted to only one listener
862                 if (applicationRegionChangedEventHandler == null)
863                 {
864                     applicationRegionChangedEventHandler += value;
865
866                     applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
867                     regionChangedSignal = this.RegionChangedSignal();
868                     regionChangedSignal?.Connect(applicationRegionChangedEventCallbackDelegate);
869                 }
870             }
871
872             remove
873             {
874                 if (applicationRegionChangedEventHandler != null)
875                 {
876                     regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
877                     regionChangedSignal?.Dispose();
878                     regionChangedSignal = null;
879                 }
880
881                 applicationRegionChangedEventHandler -= value;
882             }
883         }
884
885         // Callback for Application RegionChangedSignal
886         private void OnNUIApplicationRegionChanged(IntPtr data)
887         {
888             if (applicationRegionChangedEventHandler != null)
889             {
890                 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
891                 e.Application = this;
892                 applicationRegionChangedEventHandler.Invoke(this, e);
893             }
894         }
895
896         /**
897           * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
898           * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
899           */
900         public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
901         {
902             add
903             {
904                 // Restricted to only one listener
905                 if (applicationBatteryLowEventHandler == null)
906                 {
907                     applicationBatteryLowEventHandler += value;
908
909                     applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
910                     batteryLowSignal = this.BatteryLowSignal();
911                     batteryLowSignal?.Connect(applicationBatteryLowEventCallbackDelegate);
912                 }
913             }
914
915             remove
916             {
917                 if (applicationBatteryLowEventHandler != null)
918                 {
919                     batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
920                     batteryLowSignal?.Dispose();
921                     batteryLowSignal = null;
922                 }
923
924                 applicationBatteryLowEventHandler -= value;
925             }
926         }
927
928         // Callback for Application BatteryLowSignal
929         private void OnNUIApplicationBatteryLow(BatteryStatus status)
930         {
931             NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
932
933             // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
934             e.BatteryStatus = status;
935             applicationBatteryLowEventHandler?.Invoke(this, e);
936         }
937
938         /**
939           * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
940           *  provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
941           */
942         public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
943         {
944             add
945             {
946                 // Restricted to only one listener
947                 if (applicationMemoryLowEventHandler == null)
948                 {
949                     applicationMemoryLowEventHandler += value;
950
951                     applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
952                     memoryLowSignal = this.MemoryLowSignal();
953                     memoryLowSignal?.Connect(applicationMemoryLowEventCallbackDelegate);
954                 }
955             }
956
957             remove
958             {
959                 if (applicationMemoryLowEventHandler != null)
960                 {
961                     memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
962                     memoryLowSignal?.Dispose();
963                     memoryLowSignal = null;
964                 }
965
966                 applicationMemoryLowEventHandler -= value;
967             }
968         }
969
970         // Callback for Application MemoryLowSignal
971         private void OnNUIApplicationMemoryLow(MemoryStatus status)
972         {
973             NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
974
975             // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
976             e.MemoryStatus = status;
977             applicationMemoryLowEventHandler?.Invoke(this, e);
978         }
979
980         /**
981           * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
982           *  provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
983           */
984         public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
985         {
986             add
987             {
988                 // Restricted to only one listener
989                 if (applicationAppControlEventHandler == null)
990                 {
991                     applicationAppControlEventHandler += value;
992
993                     applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
994                     appControlSignal = this.AppControlSignal();
995                     appControlSignal?.Connect(applicationAppControlEventCallbackDelegate);
996                 }
997             }
998
999             remove
1000             {
1001                 if (applicationAppControlEventHandler != null)
1002                 {
1003                     appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
1004                     appControlSignal?.Dispose();
1005                     appControlSignal = null;
1006                 }
1007
1008                 applicationAppControlEventHandler -= value;
1009             }
1010         }
1011
1012         // Callback for Application AppControlSignal
1013         private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1014         {
1015             if (applicationAppControlEventHandler != null)
1016             {
1017                 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1018                 e.VoidP = voidp;
1019                 e.Application = this;
1020                 applicationAppControlEventHandler.Invoke(this, e);
1021             }
1022         }
1023
1024         protected static Application instance; // singleton
1025
1026         public static Application Instance
1027         {
1028             get
1029             {
1030                 return instance;
1031             }
1032         }
1033
1034         public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1035         {
1036             if (cPtr == global::System.IntPtr.Zero)
1037             {
1038                 return null;
1039             }
1040
1041             Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1042             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1043             return ret;
1044         }
1045
1046         public static Application NewApplication()
1047         {
1048             return NewApplication("", NUIApplication.WindowMode.Opaque);
1049         }
1050
1051         public static Application NewApplication(string stylesheet)
1052         {
1053             return NewApplication(stylesheet, NUIApplication.WindowMode.Opaque);
1054         }
1055
1056         public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode)
1057         {
1058             // register all Views with the type registry, so that can be created / styled via JSON
1059             //ViewRegistryHelper.Initialize(); //moved to Application side.
1060             if (instance)
1061             {
1062                 return instance;
1063             }
1064
1065             Application ret = New(1, stylesheet, windowMode);
1066             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1067
1068             // set the singleton
1069             instance = ret;
1070             return ret;
1071         }
1072
1073         public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1074         {
1075             if (instance)
1076             {
1077                 return instance;
1078             }
1079             Application ret = New(1, stylesheet, windowMode, positionSize);
1080             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1081
1082             // set the singleton
1083             instance = ret;
1084             return ret;
1085         }
1086
1087         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1088         {
1089             if (instance)
1090             {
1091                 return instance;
1092             }
1093             Application ret = New(args, stylesheet, windowMode);
1094             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1095
1096             // set the singleton
1097             instance = ret;
1098             return instance;
1099         }
1100
1101         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1102         {
1103             if (instance)
1104             {
1105                 return instance;
1106             }
1107             Application ret = New(args, stylesheet, windowMode, positionSize);
1108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1109
1110             // set the singleton
1111             instance = ret;
1112             return instance;
1113         }
1114
1115         /// <summary>
1116         /// Ensures that the function passed in is called from the main loop when it is idle.
1117         /// </summary>
1118         /// <param name="func">The function to call</param>
1119         /// <returns>true if added successfully, false otherwise</returns>
1120         public bool AddIdle(System.Delegate func)
1121         {
1122             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1123             System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1124
1125             bool ret = Interop.Application.AddIdle(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1126
1127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1128             return ret;
1129         }
1130
1131         /**
1132         * Outer::outer_method(int)
1133         */
1134         public static Application New()
1135         {
1136             Application ret = new Application(Interop.Application.New(), true);
1137             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1138             return ret;
1139         }
1140
1141         public static Application New(int argc)
1142         {
1143             Application ret = new Application(Interop.Application.New(argc), true);
1144             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1145             return ret;
1146         }
1147
1148         public static Application New(int argc, string stylesheet)
1149         {
1150             Application ret = new Application(Interop.Application.New(argc, stylesheet), true);
1151             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1152             return ret;
1153         }
1154
1155         public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode)
1156         {
1157             Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
1158             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1159             s_current = ret;
1160             return ret;
1161         }
1162
1163         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1164         {
1165             Application ret = null;
1166             int argc = 0;
1167             string argvStr = "";
1168             try
1169             {
1170                 argc = args.Length;
1171                 argvStr = string.Join(" ", args);
1172             }
1173             catch (Exception exception)
1174             {
1175                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, msg : " + exception.Message);
1176                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1177                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1178                 throw;
1179             }
1180
1181             ret = new Application(NDalicPINVOKE.ApplicationNewManual4(argc, argvStr, stylesheet, (int)windowMode), true);
1182             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1183
1184             return ret;
1185         }
1186
1187         public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1188         {
1189             Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1190             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1191             return ret;
1192         }
1193
1194         public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1195         {
1196             Application ret = null;
1197             int argc = 0;
1198             string argvStr = "";
1199             try
1200             {
1201                 argc = args.Length;
1202                 argvStr = string.Join(" ", args);
1203             }
1204             catch (Exception exception)
1205             {
1206                 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, msg : " + exception.Message);
1207                 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1208                 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1209                 throw;
1210             }
1211
1212             ret = new Application(NDalicPINVOKE.ApplicationNewWithWindowSizePosition(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1213             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1214
1215             return ret;
1216         }
1217
1218         public Application() : this(Interop.Application.NewApplication(), true)
1219         {
1220             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1221         }
1222
1223         public Application(Application application) : this(Interop.Application.NewApplication(Application.getCPtr(application)), true)
1224         {
1225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1226         }
1227
1228         public Application Assign(Application application)
1229         {
1230             Application ret = new Application(Interop.Application.Assign(SwigCPtr, Application.getCPtr(application)), false);
1231             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1232             return ret;
1233         }
1234
1235         public void MainLoop()
1236         {
1237             NDalicPINVOKE.ApplicationMainLoop(SwigCPtr);
1238             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1239         }
1240
1241         public void Lower()
1242         {
1243             Interop.Application.Lower(SwigCPtr);
1244             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1245         }
1246
1247         public void Quit()
1248         {
1249             Interop.Application.Quit(SwigCPtr);
1250             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1251         }
1252
1253         internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1254         {
1255             bool ret = Interop.Application.AddIdle(SwigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1256             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1257             return ret;
1258         }
1259
1260         public Window GetWindow()
1261         {
1262             win = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindow(SwigCPtr)) as Window;
1263             if (win == null)
1264             {
1265                 win = new Window(Interop.Application.GetWindow(SwigCPtr), true);
1266             }
1267
1268             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1269             return win;
1270         }
1271
1272         public static string GetResourcePath()
1273         {
1274             string ret = Interop.Application.GetResourcePath();
1275             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1276             return ret;
1277         }
1278
1279         public string GetLanguage()
1280         {
1281             string ret = Interop.Application.GetLanguage(SwigCPtr);
1282             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1283             return ret;
1284         }
1285
1286         public string GetRegion()
1287         {
1288             string ret = Interop.Application.GetRegion(SwigCPtr);
1289             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1290             return ret;
1291         }
1292
1293         [EditorBrowsable(EditorBrowsableState.Never)]
1294         public static List<Window> GetWindowList()
1295         {
1296             uint ListSize = Interop.Application.GetWindowsListSize();
1297             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1298
1299             List<Window> WindowList = new List<Window>();
1300             for (uint i = 0; i < ListSize; ++i)
1301             {
1302                 Window currWin = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindowsFromList(i)) as Window;
1303                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1304                 if (currWin)
1305                 {
1306                     WindowList.Add(currWin);
1307                 }
1308             }
1309             return WindowList;
1310         }
1311
1312         internal ApplicationSignal InitSignal()
1313         {
1314             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationInitSignal(SwigCPtr), false);
1315             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1316             return ret;
1317         }
1318
1319         internal ApplicationSignal TerminateSignal()
1320         {
1321             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTerminateSignal(SwigCPtr), false);
1322             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1323             return ret;
1324         }
1325
1326         internal ApplicationSignal PauseSignal()
1327         {
1328             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationPauseSignal(SwigCPtr), false);
1329             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1330             return ret;
1331         }
1332
1333         internal ApplicationSignal ResumeSignal()
1334         {
1335             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResumeSignal(SwigCPtr), false);
1336             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1337             return ret;
1338         }
1339
1340         internal ApplicationSignal ResetSignal()
1341         {
1342             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResetSignal(SwigCPtr), false);
1343             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1344             return ret;
1345         }
1346
1347         internal ApplicationControlSignal AppControlSignal()
1348         {
1349             ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationAppControlSignal(SwigCPtr), false);
1350             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1351             return ret;
1352         }
1353
1354         internal ApplicationSignal LanguageChangedSignal()
1355         {
1356             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationLanguageChangedSignal(SwigCPtr), false);
1357             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1358             return ret;
1359         }
1360
1361         internal ApplicationSignal RegionChangedSignal()
1362         {
1363             ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationRegionChangedSignal(SwigCPtr), false);
1364             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1365             return ret;
1366         }
1367
1368         internal LowBatterySignalType BatteryLowSignal()
1369         {
1370             LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationLowBatterySignal(SwigCPtr), false);
1371             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1372             return ret;
1373         }
1374
1375         internal LowMemorySignalType MemoryLowSignal()
1376         {
1377             LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationLowMemorySignal(SwigCPtr), false);
1378             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1379             return ret;
1380         }
1381     }
1382 }