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