Combined Stage and Window class, and removed Stage class
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / Application.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.10
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Dali {
12
13     using System;
14     using System.Runtime.InteropServices;
15
16     /**
17       * @brief Event arguments that passed via NUIApplicationInit signal
18       *
19       */
20     public class NUIApplicationInitEventArgs : EventArgs
21     {
22     private Application _application;
23
24       /**
25         * @brief Application - is the application that is being initialized
26         *
27         */
28     public Application Application
29       {
30         get
31         {
32           return _application;
33         }
34         set
35         {
36           _application = value;
37         }
38       }
39     }
40
41     /**
42       * @brief Event arguments that passed via NUIApplicationTerminate signal
43       *
44       */
45     public class NUIApplicationTerminateEventArgs : EventArgs
46     {
47     private Application _application;
48       /**
49         * @brief Application - is the application that is being Terminated
50         *
51         */
52     public Application Application
53       {
54         get
55         {
56           return _application;
57         }
58         set
59         {
60           _application = value;
61         }
62       }
63     }
64
65     /**
66       * @brief Event arguments that passed via NUIApplicationPause signal
67       *
68       */
69     public class NUIApplicationPauseEventArgs : EventArgs
70     {
71     private Application _application;
72       /**
73         * @brief Application - is the application that is being Paused
74         *
75         */
76     public Application Application
77       {
78         get
79         {
80           return _application;
81         }
82         set
83         {
84           _application = value;
85         }
86       }
87     }
88
89     /**
90       * @brief Event arguments that passed via NUIApplicationResume signal
91       *
92       */
93     public class NUIApplicationResumeEventArgs : EventArgs
94     {
95     private Application _application;
96       /**
97         * @brief Application - is the application that is being Resumed
98         *
99         */
100     public Application Application
101       {
102         get
103         {
104           return _application;
105         }
106         set
107         {
108           _application = value;
109         }
110       }
111     }
112
113     /**
114       * @brief Event arguments that passed via NUIApplicationReset signal
115       *
116       */
117     public class NUIApplicationResetEventArgs : EventArgs
118     {
119     private Application _application;
120       /**
121         * @brief Application - is the application that is being Reset
122         *
123         */
124     public Application Application
125       {
126         get
127         {
128           return _application;
129         }
130         set
131         {
132           _application = value;
133         }
134       }
135     }
136
137     /**
138       * @brief Event arguments that passed via NUIApplicationResize signal
139       *
140       */
141     public class NUIApplicationResizeEventArgs : EventArgs
142     {
143     private Application _application;
144       /**
145         * @brief Application - is the application that is being Resized
146         *
147         */
148     public Application Application
149       {
150         get
151         {
152           return _application;
153         }
154         set
155         {
156           _application = value;
157         }
158       }
159     }
160
161     /**
162       * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
163       *
164       */
165     public class NUIApplicationLanguageChangedEventArgs : EventArgs
166     {
167     private Application _application;
168       /**
169         * @brief Application - is the application that is being affected with Device's language change
170         *
171         */
172     public Application Application
173       {
174         get
175         {
176           return _application;
177         }
178         set
179         {
180           _application = value;
181         }
182       }
183     }
184
185     /**
186       * @brief Event arguments that passed via NUIApplicationRegionChanged signal
187       *
188       */
189     public class NUIApplicationRegionChangedEventArgs : EventArgs
190     {
191     private Application _application;
192       /**
193         * @brief Application - is the application that is being affected with Device's region change
194         *
195         */
196     public Application Application
197       {
198         get
199         {
200           return _application;
201         }
202         set
203         {
204           _application = value;
205         }
206       }
207     }
208
209     /**
210       * @brief Event arguments that passed via NUIApplicationBatteryLow signal
211       *
212       */
213     public class NUIApplicationBatteryLowEventArgs : EventArgs
214     {
215     private Application _application;
216       /**
217         * @brief Application - is the application that is being affected when the battery level of the device is low
218         *
219         */
220     public Application Application
221       {
222         get
223         {
224           return _application;
225         }
226         set
227         {
228           _application = value;
229         }
230       }
231     }
232
233     /**
234       * @brief Event arguments that passed via NUIApplicationMemoryLow signal
235       *
236       */
237     public class NUIApplicationMemoryLowEventArgs : EventArgs
238     {
239     private Application _application;
240       /**
241         * @brief Application - is the application that is being affected when the memory level of the device is low
242         *
243         */
244     public Application Application
245       {
246         get
247         {
248           return _application;
249         }
250         set
251         {
252           _application = value;
253         }
254       }
255     }
256
257     /**
258       * @brief Event arguments that passed via NUIApplicationAppControl  signal
259       *
260       */
261     public class NUIApplicationAppControlEventArgs : EventArgs
262     {
263     private Application _application;
264     private IntPtr _voidp;
265       /**
266         * @brief Application - is the application that is receiving the launch request from another application
267         *
268         */
269     public Application Application
270       {
271         get
272         {
273           return _application;
274         }
275         set
276         {
277           _application = value;
278         }
279       }
280       /**
281         * @brief VoidP - contains the information about why the application is launched
282         *
283         */
284     public IntPtr VoidP
285       {
286         get
287         {
288           return _voidp;
289         }
290         set
291         {
292           _voidp = value;
293         }
294       }
295     }
296
297 public class Application : BaseHandle {
298   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
299
300   internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Application_SWIGUpcast(cPtr), cMemoryOwn) {
301     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
302   }
303
304   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj) {
305     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
306   }
307
308   ~Application() {
309     DisposeQueue.Instance.Add(this);
310   }
311
312   public override void Dispose() {
313     if (!Window.IsInstalled()) {
314       DisposeQueue.Instance.Add(this);
315       return;
316     }
317
318     lock(this) {
319       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
320         if (swigCMemOwn) {
321           swigCMemOwn = false;
322           NDalicPINVOKE.delete_Application(swigCPtr);
323         }
324         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
325       }
326       global::System.GC.SuppressFinalize(this);
327       base.Dispose();
328     }
329   }
330
331
332     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
333     private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
334     private DaliEventHandler<object,NUIApplicationInitEventArgs> _applicationInitEventHandler;
335     private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
336
337
338     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
339     private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
340     private DaliEventHandler<object,NUIApplicationTerminateEventArgs> _applicationTerminateEventHandler;
341     private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
342
343
344     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
345     private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
346     private DaliEventHandler<object,NUIApplicationPauseEventArgs> _applicationPauseEventHandler;
347     private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
348
349     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
350     private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
351     private DaliEventHandler<object,NUIApplicationResumeEventArgs> _applicationResumeEventHandler;
352     private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
353
354     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
355     private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
356     private DaliEventHandler<object,NUIApplicationResetEventArgs> _applicationResetEventHandler;
357     private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
358
359     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
360     private delegate void NUIApplicationResizeEventCallbackDelegate(IntPtr application);
361     private DaliEventHandler<object,NUIApplicationResizeEventArgs> _applicationResizeEventHandler;
362     private NUIApplicationResizeEventCallbackDelegate _applicationResizeEventCallbackDelegate;
363
364     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
365     private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
366     private DaliEventHandler<object,NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
367     private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
368
369
370     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
371     private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
372     private DaliEventHandler<object,NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
373     private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
374
375     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
376     private delegate void NUIApplicationBatteryLowEventCallbackDelegate(IntPtr application);
377     private DaliEventHandler<object,NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
378     private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
379
380     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
381     private delegate void NUIApplicationMemoryLowEventCallbackDelegate(IntPtr application);
382     private DaliEventHandler<object,NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
383     private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
384
385     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
386     private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
387     private DaliEventHandler<object,NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
388     private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
389
390     /**
391       * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
392       * (in the type of NUIApplicationInitEventHandler - DaliEventHandler<object,NUIApplicationInitEventArgs>)
393       *  provided by the user. Initialized signal is emitted when application is initialised
394       */
395     public event DaliEventHandler<object,NUIApplicationInitEventArgs> Initialized
396     {
397       add
398       {
399         lock(this)
400         {
401           // Restricted to only one listener
402           if (_applicationInitEventHandler == null)
403           {
404             _applicationInitEventHandler += value;
405
406             _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
407             this.InitSignal().Connect(_applicationInitEventCallbackDelegate);
408           }
409         }
410       }
411
412       remove
413       {
414         lock(this)
415         {
416           if (_applicationInitEventHandler != null)
417           {
418             this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
419           }
420
421           _applicationInitEventHandler -= value;
422         }
423       }
424     }
425
426     // Callback for Application InitSignal
427     private void OnApplicationInit(IntPtr data)
428     {
429       // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
430       DisposeQueue.Instance.Initialize();
431
432       NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
433
434       // Populate all members of "e" (NUIApplicationInitEventArgs) with real data
435       e.Application = Application.GetApplicationFromPtr(data);
436
437       if (_applicationInitEventHandler != null)
438       {
439         //here we send all data to user event handlers
440         _applicationInitEventHandler(this, e);
441       }
442     }
443
444     /**
445       * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
446       * (in the type of NUIApplicationTerminateEventHandler-DaliEventHandler<object,NUIApplicationTerminateEventArgs>)
447       *  provided by the user. Terminated signal is emitted when application is terminated
448       */
449     public event DaliEventHandler<object,NUIApplicationTerminateEventArgs> Terminated
450     {
451       add
452       {
453         lock(this)
454         {
455           // Restricted to only one listener
456           if (_applicationTerminateEventHandler == null)
457           {
458             _applicationTerminateEventHandler += value;
459
460             _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
461             this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
462           }
463         }
464       }
465
466       remove
467       {
468         lock(this)
469         {
470           if (_applicationTerminateEventHandler != null)
471           {
472             this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
473           }
474
475           _applicationTerminateEventHandler -= value;
476         }
477       }
478     }
479
480     // Callback for Application TerminateSignal
481     private void OnNUIApplicationTerminate(IntPtr data)
482     {
483       NUIApplicationTerminateEventArgs e = new NUIApplicationTerminateEventArgs();
484
485       // Populate all members of "e" (NUIApplicationTerminateEventArgs) with real data
486       e.Application = Application.GetApplicationFromPtr(data);
487
488       if (_applicationTerminateEventHandler != null)
489       {
490         //here we send all data to user event handlers
491         _applicationTerminateEventHandler(this, e);
492       }
493     }
494
495     /**
496       * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
497       * (in the type of NUIApplicationPauseEventHandler-DaliEventHandler<object,NUIApplicationPauseEventArgs>)
498       * provided by the user. Paused signal is emitted when application is paused
499       */
500     public event DaliEventHandler<object,NUIApplicationPauseEventArgs> Paused
501     {
502       add
503       {
504         lock(this)
505         {
506           // Restricted to only one listener
507           if (_applicationPauseEventHandler == null)
508           {
509             _applicationPauseEventHandler += value;
510
511             _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
512             this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
513           }
514         }
515       }
516
517       remove
518       {
519         lock(this)
520         {
521           if (_applicationPauseEventHandler != null)
522           {
523             this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
524           }
525
526           _applicationPauseEventHandler -= value;
527         }
528       }
529     }
530
531     // Callback for Application PauseSignal
532     private void OnNUIApplicationPause(IntPtr data)
533     {
534       NUIApplicationPauseEventArgs e = new NUIApplicationPauseEventArgs();
535
536       // Populate all members of "e" (NUIApplicationPauseEventArgs) with real data
537       e.Application = Application.GetApplicationFromPtr(data);
538
539       if (_applicationPauseEventHandler != null)
540       {
541         //here we send all data to user event handlers
542         _applicationPauseEventHandler(this, e);
543       }
544     }
545
546     /**
547       * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
548       * (in the type of NUIApplicationResumeEventHandler-DaliEventHandler<object,NUIApplicationResumeEventArgs>)
549       *  provided by the user. Resumed signal is emitted when application is resumed
550       */
551     public event DaliEventHandler<object,NUIApplicationResumeEventArgs> Resumed
552     {
553       add
554       {
555         lock(this)
556         {
557           // Restricted to only one listener
558           if (_applicationResumeEventHandler == null)
559           {
560             _applicationResumeEventHandler += value;
561
562             _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
563             this.ResumeSignal().Connect(_applicationResumeEventCallbackDelegate);
564           }
565         }
566       }
567
568       remove
569       {
570         lock(this)
571         {
572           if (_applicationResumeEventHandler != null)
573           {
574             this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
575           }
576
577           _applicationResumeEventHandler -= value;
578         }
579       }
580     }
581
582     // Callback for Application ResumeSignal
583     private void OnNUIApplicationResume(IntPtr data)
584     {
585       NUIApplicationResumeEventArgs e = new NUIApplicationResumeEventArgs();
586
587       // Populate all members of "e" (NUIApplicationResumeEventArgs) with real data
588       e.Application = Application.GetApplicationFromPtr(data);
589
590       if (_applicationResumeEventHandler != null)
591       {
592         //here we send all data to user event handlers
593         _applicationResumeEventHandler(this, e);
594       }
595     }
596
597     /**
598       * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
599       * (in the type of NUIApplicationResetEventHandler-DaliEventHandler<object,NUIApplicationResetEventArgs>)
600       *  provided by the user. Reset signal is emitted when application is reset
601       */
602     public event DaliEventHandler<object,NUIApplicationResetEventArgs> Reset
603     {
604       add
605       {
606         lock(this)
607         {
608           // Restricted to only one listener
609           if (_applicationResetEventHandler == null)
610           {
611             _applicationResetEventHandler += value;
612
613             _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
614             this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
615           }
616         }
617       }
618
619       remove
620       {
621         lock(this)
622         {
623           if (_applicationResetEventHandler != null)
624           {
625             this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
626           }
627
628           _applicationResetEventHandler -= value;
629         }
630       }
631     }
632
633     // Callback for Application ResetSignal
634     private void OnNUIApplicationReset(IntPtr data)
635     {
636       NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
637
638       // Populate all members of "e" (NUIApplicationResetEventArgs) with real data
639       e.Application = Application.GetApplicationFromPtr(data);
640
641       if (_applicationResetEventHandler != null)
642       {
643         //here we send all data to user event handlers
644         _applicationResetEventHandler(this, e);
645       }
646     }
647
648     /**
649       * @brief Event for Resized signal which can be used to subscribe/unsubscribe the event handler
650       * (in the type of NUIApplicationResizeEventHandler-DaliEventHandler<object,NUIApplicationResizeEventArgs>)
651       *  provided by the user. Resized signal is emitted when application is resized
652       */
653     public event DaliEventHandler<object,NUIApplicationResizeEventArgs> Resized
654     {
655       add
656       {
657         lock(this)
658         {
659           // Restricted to only one listener
660           if (_applicationResizeEventHandler == null)
661           {
662             _applicationResizeEventHandler += value;
663
664             _applicationResizeEventCallbackDelegate = new NUIApplicationResizeEventCallbackDelegate(OnNUIApplicationResize);
665             this.ResizeSignal().Connect(_applicationResizeEventCallbackDelegate);
666           }
667         }
668       }
669
670       remove
671       {
672         lock(this)
673         {
674           if (_applicationResizeEventHandler != null)
675           {
676             this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
677           }
678
679           _applicationResizeEventHandler -= value;
680         }
681       }
682     }
683
684     // Callback for Application ResizeSignal
685     private void OnNUIApplicationResize(IntPtr data)
686     {
687       NUIApplicationResizeEventArgs e = new NUIApplicationResizeEventArgs();
688
689       // Populate all members of "e" (NUIApplicationResizeEventArgs) with real data
690       e.Application = Application.GetApplicationFromPtr(data);
691
692       if (_applicationResizeEventHandler != null)
693       {
694         //here we send all data to user event handlers
695         _applicationResizeEventHandler(this, e);
696       }
697     }
698
699     /**
700       * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
701       * (in the type of NUIApplicationLanguageChangedEventHandler-DaliEventHandler<object,NUIApplicationLanguageChangedEventArgs>)
702       *  provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
703       */
704     public event DaliEventHandler<object,NUIApplicationLanguageChangedEventArgs> LanguageChanged
705     {
706       add
707       {
708         lock(this)
709         {
710           // Restricted to only one listener
711           if (_applicationLanguageChangedEventHandler == null)
712           {
713             _applicationLanguageChangedEventHandler += value;
714
715             _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
716             this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
717           }
718         }
719       }
720
721       remove
722       {
723         lock(this)
724         {
725           if (_applicationLanguageChangedEventHandler != null)
726           {
727             this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
728           }
729
730           _applicationLanguageChangedEventHandler -= value;
731         }
732       }
733     }
734
735     // Callback for Application LanguageChangedSignal
736     private void OnNUIApplicationLanguageChanged(IntPtr data)
737     {
738       NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
739
740       // Populate all members of "e" (NUIApplicationLanguageChangedEventArgs) with real data
741       e.Application = Application.GetApplicationFromPtr(data);
742
743       if (_applicationLanguageChangedEventHandler != null)
744       {
745         //here we send all data to user event handlers
746         _applicationLanguageChangedEventHandler(this, e);
747       }
748     }
749
750     /**
751       * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
752       * (in the type of NUIApplicationRegionChangedEventHandler-DaliEventHandler<object,NUIApplicationRegionChangedEventArgs>)
753       *  provided by the user. RegionChanged signal is emitted when the region of the device is changed.
754       */
755     public event DaliEventHandler<object,NUIApplicationRegionChangedEventArgs> RegionChanged
756     {
757       add
758       {
759         lock(this)
760         {
761           // Restricted to only one listener
762           if (_applicationRegionChangedEventHandler == null)
763           {
764             _applicationRegionChangedEventHandler += value;
765
766             _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
767             this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
768           }
769         }
770       }
771
772       remove
773       {
774         lock(this)
775         {
776           if (_applicationRegionChangedEventHandler != null)
777           {
778             this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
779           }
780
781           _applicationRegionChangedEventHandler -= value;
782         }
783       }
784     }
785
786     // Callback for Application RegionChangedSignal
787     private void OnNUIApplicationRegionChanged(IntPtr data)
788     {
789       NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
790
791       // Populate all members of "e" (NUIApplicationRegionChangedEventArgs) with real data
792       e.Application = Application.GetApplicationFromPtr(data);
793
794       if (_applicationRegionChangedEventHandler != null)
795       {
796         //here we send all data to user event handlers
797         _applicationRegionChangedEventHandler(this, e);
798       }
799     }
800
801     /**
802       * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
803       * (in the type of NUIApplicationBatteryLowEventHandler-DaliEventHandler<object,NUIApplicationBatteryLowEventArgs>) 
804       * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
805       */
806     public event DaliEventHandler<object,NUIApplicationBatteryLowEventArgs> BatteryLow
807     {
808       add
809       {
810         lock(this)
811         {
812           // Restricted to only one listener
813           if (_applicationBatteryLowEventHandler == null)
814           {
815             _applicationBatteryLowEventHandler += value;
816
817             _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
818             this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
819           }
820         }
821       }
822
823       remove
824       {
825         lock(this)
826         {
827           if (_applicationBatteryLowEventHandler != null)
828           {
829             this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
830           }
831
832           _applicationBatteryLowEventHandler -= value;
833         }
834       }
835     }
836
837     // Callback for Application BatteryLowSignal
838     private void OnNUIApplicationBatteryLow(IntPtr data)
839     {
840       NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
841
842       // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
843       e.Application = Application.GetApplicationFromPtr(data);
844
845       if (_applicationBatteryLowEventHandler != null)
846       {
847         //here we send all data to user event handlers
848         _applicationBatteryLowEventHandler(this, e);
849       }
850     }
851
852     /**
853       * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
854       * (in the type of NUIApplicationMemoryLowEventHandler-DaliEventHandler<object,NUIApplicationMemoryLowEventArgs>)
855       *  provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
856       */
857     public event DaliEventHandler<object,NUIApplicationMemoryLowEventArgs> MemoryLow
858     {
859       add
860       {
861         lock(this)
862         {
863           // Restricted to only one listener
864           if (_applicationMemoryLowEventHandler == null)
865           {
866             _applicationMemoryLowEventHandler += value;
867
868             _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
869             this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
870           }
871         }
872       }
873
874       remove
875       {
876         lock(this)
877         {
878           if (_applicationMemoryLowEventHandler != null)
879           {
880             this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
881           }
882
883           _applicationMemoryLowEventHandler -= value;
884         }
885       }
886     }
887
888     // Callback for Application MemoryLowSignal
889     private void OnNUIApplicationMemoryLow(IntPtr data)
890     {
891       NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
892
893       // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
894       e.Application = Application.GetApplicationFromPtr(data);
895
896       if (_applicationMemoryLowEventHandler != null)
897       {
898         //here we send all data to user event handlers
899         _applicationMemoryLowEventHandler(this, e);
900       }
901     }
902
903     /**
904       * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
905       * (in the type of NUIApplicationAppControlEventHandler-DaliEventHandler<object,NUIApplicationAppControlEventArgs>)
906       *  provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
907       */
908     public event DaliEventHandler<object,NUIApplicationAppControlEventArgs> AppControl
909     {
910       add
911       {
912         lock(this)
913         {
914           // Restricted to only one listener
915           if (_applicationAppControlEventHandler == null)
916           {
917             _applicationAppControlEventHandler += value;
918
919             _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
920             this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
921           }
922         }
923       }
924
925       remove
926       {
927         lock(this)
928         {
929           if (_applicationAppControlEventHandler != null)
930           {
931             this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
932           }
933
934           _applicationAppControlEventHandler -= value;
935         }
936       }
937     }
938
939     // Callback for Application AppControlSignal
940     private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
941     {
942       NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
943
944       // Populate all members of "e" (NUIApplicationAppControlEventArgs) with real data
945       e.Application = Application.GetApplicationFromPtr(application);
946       e.VoidP = voidp;
947
948       if (_applicationAppControlEventHandler != null)
949       {
950         //here we send all data to user event handlers
951         _applicationAppControlEventHandler(this, e);
952       }
953     }
954
955     private static Application _instance; // singleton
956
957     public delegate void InitDelegate();
958
959     public delegate void TerminateDelegate();
960
961     public delegate void PauseDelegate();
962
963     public delegate void ResumeDelegate();
964
965     public delegate void ResizeDelegate();
966
967     public delegate void AppControlDelegate();
968
969     public delegate void LanguageChangedDelegate();
970
971     public delegate void RegionChangedDelegate();
972
973     public delegate void BatteryLowDelegate();
974
975     public delegate void MemoryLowDelegate();
976
977     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
978     internal delegate void InitDelegateInternal();
979
980     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
981     internal delegate void TerminateDelegateInternal();
982
983     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
984     internal delegate void PauseDelegateInternal();
985
986     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
987     internal delegate void ResumeDelegateInternal();
988
989     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
990     internal delegate void ResizeDelegateInternal();
991
992     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
993     internal delegate void AppControlDelegateInternal();
994
995     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
996     internal delegate void LanguageChangedDelegateInternal();
997
998     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
999     internal delegate void RegionChangedDelegateInternal();
1000
1001     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1002     internal delegate void BatteryLowDelegateInternal();
1003
1004     [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1005     internal delegate void MemoryLowDelegateInternal();
1006
1007     static void Initialize()
1008     {
1009       //        instance.InitDelegate();
1010     }
1011
1012     public static Application Instance
1013     {
1014        get
1015        {
1016             return _instance;
1017        }
1018     }
1019
1020     public static Application GetApplicationFromPtr(global::System.IntPtr cPtr) {
1021       Application ret = new Application(cPtr, false);
1022       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1023       return ret;
1024     }
1025
1026     internal void SetupDelegates() {
1027       InitDelegateInternal initializeCallback = new InitDelegateInternal( Initialize );
1028       System.Console.WriteLine( "InitSignal connection count");
1029
1030       this.InitSignal().Connect( initializeCallback );
1031       //Console.WriteLine( "InitSignal connection count = " + app.InitSignal().GetConnectionCount() );
1032     }
1033
1034     public static Application NewApplication() {
1035      _instance = NewApplication("", Application.WINDOW_MODE.OPAQUE);
1036      return _instance;
1037     }
1038
1039     public static Application NewApplication(string stylesheet) {
1040       _instance = NewApplication(stylesheet, Application.WINDOW_MODE.OPAQUE);
1041       return _instance;
1042     }
1043
1044     public static Application NewApplication(string stylesheet, Application.WINDOW_MODE windowMode) {
1045
1046       // register all Views with the type registry, so that can be created / styled via JSON
1047       ViewRegistryHelper.Initialize();
1048
1049       Application ret = New(1, stylesheet, windowMode);
1050       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1051
1052       // we've got an application now connect the signals
1053       ret.SetupDelegates();
1054       // set the singleton
1055       _instance = ret;
1056       return ret;
1057     }
1058
1059     
1060   
1061   /**
1062   * Outer::outer_method(int)
1063   */
1064   public static Application New() {
1065     Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_0(), true);
1066     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1067     return ret;
1068   }
1069
1070   public static Application New(int argc) {
1071     Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_1(argc), true);
1072     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1073     return ret;
1074   }
1075
1076   public static Application New(int argc, string stylesheet) {
1077     Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_2(argc, stylesheet), true);
1078     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1079     return ret;
1080   }
1081
1082   public static Application New(int argc, string stylesheet, Application.WINDOW_MODE windowMode) {
1083     Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_3(argc, stylesheet, (int)windowMode), true);
1084     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1085     return ret;
1086   }
1087
1088   public Application() : this(NDalicPINVOKE.new_Application__SWIG_0(), true) {
1089     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1090   }
1091
1092   public Application(Application application) : this(NDalicPINVOKE.new_Application__SWIG_1(Application.getCPtr(application)), true) {
1093     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1094   }
1095
1096   public Application Assign(Application application) {
1097     Application ret = new Application(NDalicPINVOKE.Application_Assign(swigCPtr, Application.getCPtr(application)), false);
1098     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1099     return ret;
1100   }
1101
1102   public void MainLoop() {
1103     NDalicPINVOKE.Application_MainLoop__SWIG_0(swigCPtr);
1104     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105   }
1106
1107   public void MainLoop(SWIGTYPE_p_Configuration__ContextLoss configuration) {
1108     NDalicPINVOKE.Application_MainLoop__SWIG_1(swigCPtr, SWIGTYPE_p_Configuration__ContextLoss.getCPtr(configuration));
1109     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1110   }
1111
1112   public void Lower() {
1113     NDalicPINVOKE.Application_Lower(swigCPtr);
1114     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1115   }
1116
1117   public void Quit() {
1118     NDalicPINVOKE.Application_Quit(swigCPtr);
1119     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1120   }
1121
1122   public bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback) {
1123     bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1124     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1125     return ret;
1126   }
1127
1128   public Window GetWindow() {
1129     Window ret = new Window(NDalicPINVOKE.Application_GetWindow(swigCPtr), true);
1130     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1131     return ret;
1132   }
1133
1134   public void ReplaceWindow(Rectangle windowPosition, string name) {
1135     NDalicPINVOKE.Application_ReplaceWindow(swigCPtr, Rectangle.getCPtr(windowPosition), name);
1136     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1137   }
1138
1139   public static string GetResourcePath() {
1140     string ret = NDalicPINVOKE.Application_GetResourcePath();
1141     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1142     return ret;
1143   }
1144
1145   public void SetViewMode(ViewMode viewMode) {
1146     NDalicPINVOKE.Application_SetViewMode(swigCPtr, (int)viewMode);
1147     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1148   }
1149
1150   public ViewMode GetViewMode() {
1151     ViewMode ret = (ViewMode)NDalicPINVOKE.Application_GetViewMode(swigCPtr);
1152     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1153     return ret;
1154   }
1155
1156   public void SetStereoBase(float stereoBase) {
1157     NDalicPINVOKE.Application_SetStereoBase(swigCPtr, stereoBase);
1158     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1159   }
1160
1161   public float GetStereoBase() {
1162     float ret = NDalicPINVOKE.Application_GetStereoBase(swigCPtr);
1163     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1164     return ret;
1165   }
1166
1167   public ApplicationSignal InitSignal() {
1168     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_InitSignal(swigCPtr), false);
1169     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1170     return ret;
1171   }
1172
1173   public ApplicationSignal TerminateSignal() {
1174     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_TerminateSignal(swigCPtr), false);
1175     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1176     return ret;
1177   }
1178
1179   public ApplicationSignal PauseSignal() {
1180     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_PauseSignal(swigCPtr), false);
1181     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1182     return ret;
1183   }
1184
1185   public ApplicationSignal ResumeSignal() {
1186     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResumeSignal(swigCPtr), false);
1187     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1188     return ret;
1189   }
1190
1191   public ApplicationSignal ResetSignal() {
1192     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResetSignal(swigCPtr), false);
1193     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1194     return ret;
1195   }
1196
1197   public ApplicationSignal ResizeSignal() {
1198     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResizeSignal(swigCPtr), false);
1199     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1200     return ret;
1201   }
1202
1203   public ApplicationControlSignal AppControlSignal() {
1204     ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.Application_AppControlSignal(swigCPtr), false);
1205     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1206     return ret;
1207   }
1208
1209   public ApplicationSignal LanguageChangedSignal() {
1210     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_LanguageChangedSignal(swigCPtr), false);
1211     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1212     return ret;
1213   }
1214
1215   public ApplicationSignal RegionChangedSignal() {
1216     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_RegionChangedSignal(swigCPtr), false);
1217     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1218     return ret;
1219   }
1220
1221   public ApplicationSignal BatteryLowSignal() {
1222     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_BatteryLowSignal(swigCPtr), false);
1223     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1224     return ret;
1225   }
1226
1227   public ApplicationSignal MemoryLowSignal() {
1228     ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_MemoryLowSignal(swigCPtr), false);
1229     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1230     return ret;
1231   }
1232
1233   public enum WINDOW_MODE {
1234     OPAQUE = 0,
1235     TRANSPARENT = 1
1236   }
1237
1238 }
1239
1240 }