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