1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
21 using System.Runtime.InteropServices;
24 * @brief Event arguments that passed via NUIApplicationInit signal
27 internal class NUIApplicationInitEventArgs : EventArgs
29 private Application _application;
32 * @brief Application - is the application that is being initialized
35 public Application Application
49 * @brief Event arguments that passed via NUIApplicationTerminate signal
52 internal class NUIApplicationTerminatingEventArgs : EventArgs
54 private Application _application;
56 * @brief Application - is the application that is being Terminated
59 public Application Application
73 * @brief Event arguments that passed via NUIApplicationPause signal
76 internal class NUIApplicationPausedEventArgs : EventArgs
78 private Application _application;
80 * @brief Application - is the application that is being Paused
83 public Application Application
97 * @brief Event arguments that passed via NUIApplicationResume signal
100 internal class NUIApplicationResumedEventArgs : EventArgs
102 private Application _application;
104 * @brief Application - is the application that is being Resumed
107 public Application Application
115 _application = value;
121 * @brief Event arguments that passed via NUIApplicationReset signal
124 internal class NUIApplicationResetEventArgs : EventArgs
126 private Application _application;
128 * @brief Application - is the application that is being Reset
131 public Application Application
139 _application = value;
145 * @brief Event arguments that passed via NUIApplicationResize signal
148 internal class NUIApplicationResizedEventArgs : EventArgs
150 private Application _application;
152 * @brief Application - is the application that is being Resized
155 public Application Application
163 _application = value;
169 * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
172 internal class NUIApplicationLanguageChangedEventArgs : EventArgs
174 private Application _application;
176 * @brief Application - is the application that is being affected with Device's language change
179 public Application Application
187 _application = value;
193 * @brief Event arguments that passed via NUIApplicationRegionChanged signal
196 internal class NUIApplicationRegionChangedEventArgs : EventArgs
198 private Application _application;
200 * @brief Application - is the application that is being affected with Device's region change
203 public Application Application
211 _application = value;
217 * @brief Event arguments that passed via NUIApplicationBatteryLow signal
220 internal class NUIApplicationBatteryLowEventArgs : EventArgs
222 private Application _application;
224 * @brief Application - is the application that is being affected when the battery level of the device is low
227 public Application Application
235 _application = value;
241 * @brief Event arguments that passed via NUIApplicationMemoryLow signal
244 internal class NUIApplicationMemoryLowEventArgs : EventArgs
246 private Application _application;
248 * @brief Application - is the application that is being affected when the memory level of the device is low
251 public Application Application
259 _application = value;
265 * @brief Event arguments that passed via NUIApplicationAppControl signal
268 internal class NUIApplicationAppControlEventArgs : EventArgs
270 private Application _application;
271 private IntPtr _voidp;
273 * @brief Application - is the application that is receiving the launch request from another application
276 public Application Application
284 _application = value;
288 * @brief VoidP - contains the information about why the application is launched
304 internal class Application : BaseHandle
306 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
308 internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Application_SWIGUpcast(cPtr), cMemoryOwn)
310 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
313 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj)
315 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
318 protected override void Dispose(DisposeTypes type)
325 if (type == DisposeTypes.Explicit)
328 //Release your own managed resources here.
329 //You should release all of your own disposable objects here.
333 //Release your own unmanaged resources here.
334 //You should not access any managed member here except static instance.
335 //because the execution order of Finalizes is non-deterministic.
337 if (_applicationInitEventCallbackDelegate != null)
339 this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
342 if (_applicationTerminateEventCallbackDelegate != null)
344 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
347 if (_applicationPauseEventCallbackDelegate != null)
349 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
352 if (_applicationResumeEventCallbackDelegate != null)
354 this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
357 if (_applicationResetEventCallbackDelegate != null)
359 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
362 if (_applicationResizeEventCallbackDelegate != null)
364 this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
367 if (_applicationLanguageChangedEventCallbackDelegate != null)
369 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
372 if (_applicationRegionChangedEventCallbackDelegate != null)
374 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
377 if (_applicationBatteryLowEventCallbackDelegate != null)
379 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
382 if (_applicationMemoryLowEventCallbackDelegate != null)
384 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
387 if (_applicationAppControlEventCallbackDelegate != null)
389 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
392 if (swigCPtr.Handle != global::System.IntPtr.Zero)
397 NDalicPINVOKE.delete_Application(swigCPtr);
399 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
405 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
406 private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
407 private DaliEventHandler<object, NUIApplicationInitEventArgs> _applicationInitEventHandler;
408 private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
411 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
412 private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
413 private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> _applicationTerminateEventHandler;
414 private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
417 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
418 private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
419 private DaliEventHandler<object, NUIApplicationPausedEventArgs> _applicationPauseEventHandler;
420 private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
422 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
423 private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
424 private DaliEventHandler<object, NUIApplicationResumedEventArgs> _applicationResumeEventHandler;
425 private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
427 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
428 private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
429 private DaliEventHandler<object, NUIApplicationResetEventArgs> _applicationResetEventHandler;
430 private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
432 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
433 private delegate void NUIApplicationResizeEventCallbackDelegate(IntPtr application);
434 private DaliEventHandler<object, NUIApplicationResizedEventArgs> _applicationResizeEventHandler;
435 private NUIApplicationResizeEventCallbackDelegate _applicationResizeEventCallbackDelegate;
437 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
438 private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
439 private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
440 private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
443 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
444 private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
445 private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
446 private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
448 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
449 private delegate void NUIApplicationBatteryLowEventCallbackDelegate(IntPtr application);
450 private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
451 private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
453 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
454 private delegate void NUIApplicationMemoryLowEventCallbackDelegate(IntPtr application);
455 private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
456 private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
458 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
459 private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
460 private DaliEventHandler<object, NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
461 private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
464 * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
465 * (in the type of NUIApplicationInitEventHandler - DaliEventHandler<object,NUIApplicationInitEventArgs>)
466 * provided by the user. Initialized signal is emitted when application is initialised
468 public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
474 // Restricted to only one listener
475 if (_applicationInitEventHandler == null)
477 _applicationInitEventHandler += value;
479 _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
480 this.InitSignal().Connect(_applicationInitEventCallbackDelegate);
489 if (_applicationInitEventHandler != null)
491 this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
494 _applicationInitEventHandler -= value;
499 // Callback for Application InitSignal
500 private void OnApplicationInit(IntPtr data)
502 // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
503 DisposeQueue.Instance.Initialize();
504 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
506 // Populate all members of "e" (NUIApplicationInitEventArgs) with real data
507 e.Application = Application.GetApplicationFromPtr(data);
509 if (_applicationInitEventHandler != null)
511 //here we send all data to user event handlers
512 _applicationInitEventHandler(this, e);
517 * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
518 * (in the type of NUIApplicationTerminateEventHandler-DaliEventHandler<object,NUIApplicationTerminateEventArgs>)
519 * provided by the user. Terminated signal is emitted when application is terminating
521 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
527 // Restricted to only one listener
528 if (_applicationTerminateEventHandler == null)
530 _applicationTerminateEventHandler += value;
532 _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
533 this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
542 if (_applicationTerminateEventHandler != null)
544 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
547 _applicationTerminateEventHandler -= value;
552 // Callback for Application TerminateSignal
553 private void OnNUIApplicationTerminate(IntPtr data)
555 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
557 // Populate all members of "e" (NUIApplicationTerminateEventArgs) with real data
558 e.Application = Application.GetApplicationFromPtr(data);
560 if (_applicationTerminateEventHandler != null)
562 //here we send all data to user event handlers
563 _applicationTerminateEventHandler(this, e);
568 * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
569 * (in the type of NUIApplicationPauseEventHandler-DaliEventHandler<object,NUIApplicationPauseEventArgs>)
570 * provided by the user. Paused signal is emitted when application is paused
572 public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
578 // Restricted to only one listener
579 if (_applicationPauseEventHandler == null)
581 _applicationPauseEventHandler += value;
583 _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
584 this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
593 if (_applicationPauseEventHandler != null)
595 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
598 _applicationPauseEventHandler -= value;
603 // Callback for Application PauseSignal
604 private void OnNUIApplicationPause(IntPtr data)
606 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
608 // Populate all members of "e" (NUIApplicationPauseEventArgs) with real data
609 e.Application = Application.GetApplicationFromPtr(data);
611 if (_applicationPauseEventHandler != null)
613 //here we send all data to user event handlers
614 _applicationPauseEventHandler(this, e);
619 * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
620 * (in the type of NUIApplicationResumeEventHandler-DaliEventHandler<object,NUIApplicationResumeEventArgs>)
621 * provided by the user. Resumed signal is emitted when application is resumed
623 public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
629 // Restricted to only one listener
630 if (_applicationResumeEventHandler == null)
632 _applicationResumeEventHandler += value;
634 _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
635 this.ResumeSignal().Connect(_applicationResumeEventCallbackDelegate);
644 if (_applicationResumeEventHandler != null)
646 this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
649 _applicationResumeEventHandler -= value;
654 // Callback for Application ResumeSignal
655 private void OnNUIApplicationResume(IntPtr data)
657 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
659 // Populate all members of "e" (NUIApplicationResumeEventArgs) with real data
660 e.Application = Application.GetApplicationFromPtr(data);
662 if (_applicationResumeEventHandler != null)
664 //here we send all data to user event handlers
665 _applicationResumeEventHandler(this, e);
670 * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
671 * (in the type of NUIApplicationResetEventHandler-DaliEventHandler<object,NUIApplicationResetEventArgs>)
672 * provided by the user. Reset signal is emitted when application is reset
674 public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
680 // Restricted to only one listener
681 if (_applicationResetEventHandler == null)
683 _applicationResetEventHandler += value;
685 _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
686 this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
695 if (_applicationResetEventHandler != null)
697 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
700 _applicationResetEventHandler -= value;
705 // Callback for Application ResetSignal
706 private void OnNUIApplicationReset(IntPtr data)
708 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
710 // Populate all members of "e" (NUIApplicationResetEventArgs) with real data
711 e.Application = Application.GetApplicationFromPtr(data);
713 if (_applicationResetEventHandler != null)
715 //here we send all data to user event handlers
716 _applicationResetEventHandler(this, e);
721 * @brief Event for Resized signal which can be used to subscribe/unsubscribe the event handler
722 * (in the type of NUIApplicationResizeEventHandler-DaliEventHandler<object,NUIApplicationResizeEventArgs>)
723 * provided by the user. Resized signal is emitted when application is resized
725 public event DaliEventHandler<object, NUIApplicationResizedEventArgs> Resized
731 // Restricted to only one listener
732 if (_applicationResizeEventHandler == null)
734 _applicationResizeEventHandler += value;
736 _applicationResizeEventCallbackDelegate = new NUIApplicationResizeEventCallbackDelegate(OnNUIApplicationResize);
737 this.ResizeSignal().Connect(_applicationResizeEventCallbackDelegate);
746 if (_applicationResizeEventHandler != null)
748 this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
751 _applicationResizeEventHandler -= value;
756 // Callback for Application ResizeSignal
757 private void OnNUIApplicationResize(IntPtr data)
759 NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs();
761 // Populate all members of "e" (NUIApplicationResizeEventArgs) with real data
762 e.Application = Application.GetApplicationFromPtr(data);
764 if (_applicationResizeEventHandler != null)
766 //here we send all data to user event handlers
767 _applicationResizeEventHandler(this, e);
772 * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
773 * (in the type of NUIApplicationLanguageChangedEventHandler-DaliEventHandler<object,NUIApplicationLanguageChangedEventArgs>)
774 * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
776 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
782 // Restricted to only one listener
783 if (_applicationLanguageChangedEventHandler == null)
785 _applicationLanguageChangedEventHandler += value;
787 _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
788 this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
797 if (_applicationLanguageChangedEventHandler != null)
799 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
802 _applicationLanguageChangedEventHandler -= value;
807 // Callback for Application LanguageChangedSignal
808 private void OnNUIApplicationLanguageChanged(IntPtr data)
810 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
812 // Populate all members of "e" (NUIApplicationLanguageChangedEventArgs) with real data
813 e.Application = Application.GetApplicationFromPtr(data);
815 if (_applicationLanguageChangedEventHandler != null)
817 //here we send all data to user event handlers
818 _applicationLanguageChangedEventHandler(this, e);
823 * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
824 * (in the type of NUIApplicationRegionChangedEventHandler-DaliEventHandler<object,NUIApplicationRegionChangedEventArgs>)
825 * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
827 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
833 // Restricted to only one listener
834 if (_applicationRegionChangedEventHandler == null)
836 _applicationRegionChangedEventHandler += value;
838 _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
839 this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
848 if (_applicationRegionChangedEventHandler != null)
850 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
853 _applicationRegionChangedEventHandler -= value;
858 // Callback for Application RegionChangedSignal
859 private void OnNUIApplicationRegionChanged(IntPtr data)
861 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
863 // Populate all members of "e" (NUIApplicationRegionChangedEventArgs) with real data
864 e.Application = Application.GetApplicationFromPtr(data);
866 if (_applicationRegionChangedEventHandler != null)
868 //here we send all data to user event handlers
869 _applicationRegionChangedEventHandler(this, e);
874 * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
875 * (in the type of NUIApplicationBatteryLowEventHandler-DaliEventHandler<object,NUIApplicationBatteryLowEventArgs>)
876 * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
878 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
884 // Restricted to only one listener
885 if (_applicationBatteryLowEventHandler == null)
887 _applicationBatteryLowEventHandler += value;
889 _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
890 this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
899 if (_applicationBatteryLowEventHandler != null)
901 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
904 _applicationBatteryLowEventHandler -= value;
909 // Callback for Application BatteryLowSignal
910 private void OnNUIApplicationBatteryLow(IntPtr data)
912 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
914 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
915 e.Application = Application.GetApplicationFromPtr(data);
917 if (_applicationBatteryLowEventHandler != null)
919 //here we send all data to user event handlers
920 _applicationBatteryLowEventHandler(this, e);
925 * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
926 * (in the type of NUIApplicationMemoryLowEventHandler-DaliEventHandler<object,NUIApplicationMemoryLowEventArgs>)
927 * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
929 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
935 // Restricted to only one listener
936 if (_applicationMemoryLowEventHandler == null)
938 _applicationMemoryLowEventHandler += value;
940 _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
941 this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
950 if (_applicationMemoryLowEventHandler != null)
952 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
955 _applicationMemoryLowEventHandler -= value;
960 // Callback for Application MemoryLowSignal
961 private void OnNUIApplicationMemoryLow(IntPtr data)
963 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
965 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
966 e.Application = Application.GetApplicationFromPtr(data);
968 if (_applicationMemoryLowEventHandler != null)
970 //here we send all data to user event handlers
971 _applicationMemoryLowEventHandler(this, e);
976 * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
977 * (in the type of NUIApplicationAppControlEventHandler-DaliEventHandler<object,NUIApplicationAppControlEventArgs>)
978 * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
980 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
986 // Restricted to only one listener
987 if (_applicationAppControlEventHandler == null)
989 _applicationAppControlEventHandler += value;
991 _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
992 this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
1001 if (_applicationAppControlEventHandler != null)
1003 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
1006 _applicationAppControlEventHandler -= value;
1011 // Callback for Application AppControlSignal
1012 private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1014 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1016 // Populate all members of "e" (NUIApplicationAppControlEventArgs) with real data
1017 e.Application = Application.GetApplicationFromPtr(application);
1020 if (_applicationAppControlEventHandler != null)
1022 //here we send all data to user event handlers
1023 _applicationAppControlEventHandler(this, e);
1027 private static Application _instance; // singleton
1029 public static Application Instance
1037 public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1039 Application ret = new Application(cPtr, false);
1040 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1044 public static Application NewApplication()
1046 return NewApplication("", Application.WindowMode.Opaque);
1049 public static Application NewApplication(string stylesheet)
1051 return NewApplication(stylesheet, Application.WindowMode.Opaque);
1054 public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
1056 // register all Views with the type registry, so that can be created / styled via JSON
1057 //ViewRegistryHelper.Initialize(); //moved to Application side.
1059 Application ret = New(1, stylesheet, windowMode);
1060 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1062 // set the singleton
1068 public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
1070 NUILog.Debug(" NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode) is called! ");
1072 Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
1073 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1075 // set the singleton
1081 /// Ensures that the function passed in is called from the main loop when it is idle.
1083 /// <param name="func">The function to call</param>
1084 /// <returns>true if added successfully, false otherwise</returns>
1085 public bool AddIdle(System.Delegate func)
1087 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1088 System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1090 bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1092 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1097 * Outer::outer_method(int)
1099 public static Application New()
1101 NUILog.Debug("New() is called!");
1103 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_0(), true);
1104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1108 public static Application New(int argc)
1110 NUILog.Debug("New(int argc) is called!");
1112 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_1(argc), true);
1113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1117 public static Application New(int argc, string stylesheet)
1119 NUILog.Debug("New(int argc, string stylesheet) is called!");
1121 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_2(argc, stylesheet), true);
1122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1126 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
1128 NUILog.Debug("New(int argc, string stylesheet, Application.WindowMode windowMode) is called!");
1130 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_3(argc, stylesheet, (int)windowMode), true);
1131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1135 public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode)
1137 NUILog.Debug("New(string[] args) is called!");
1138 int argc = args.Length;
1139 string argvStr = string.Join(" ", args);
1141 Application ret = new Application(NDalicPINVOKE.Application_New__MANUAL_4(argc, argvStr, stylesheet, (int)windowMode), true);
1142 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1146 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1148 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1153 public Application() : this(NDalicPINVOKE.new_Application__SWIG_0(), true)
1155 NUILog.Debug("Application() is called!");
1157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1160 public Application(Application application) : this(NDalicPINVOKE.new_Application__SWIG_1(Application.getCPtr(application)), true)
1162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1165 public Application Assign(Application application)
1167 Application ret = new Application(NDalicPINVOKE.Application_Assign(swigCPtr, Application.getCPtr(application)), false);
1168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1172 public void MainLoop()
1174 NDalicPINVOKE.Application_MainLoop__SWIG_0(swigCPtr);
1175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1178 internal void MainLoop(SWIGTYPE_p_Configuration__ContextLoss configuration)
1180 NDalicPINVOKE.Application_MainLoop__SWIG_1(swigCPtr, SWIGTYPE_p_Configuration__ContextLoss.getCPtr(configuration));
1181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1186 NDalicPINVOKE.Application_Lower(swigCPtr);
1187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1192 NDalicPINVOKE.Application_Quit(swigCPtr);
1193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1196 internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1198 bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1203 public Window GetWindow()
1205 Window ret = new Window(NDalicPINVOKE.Application_GetWindow(swigCPtr), true);
1206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1210 public void ReplaceWindow(Rectangle windowPosition, string name)
1212 NDalicPINVOKE.Application_ReplaceWindow(swigCPtr, Rectangle.getCPtr(windowPosition), name);
1213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1216 public static string GetResourcePath()
1218 string ret = NDalicPINVOKE.Application_GetResourcePath();
1219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1223 internal void SetViewMode(ViewMode viewMode)
1225 NDalicPINVOKE.Application_SetViewMode(swigCPtr, (int)viewMode);
1226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1229 internal ViewMode GetViewMode()
1231 ViewMode ret = (ViewMode)NDalicPINVOKE.Application_GetViewMode(swigCPtr);
1232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1236 public void SetStereoBase(float stereoBase)
1238 NDalicPINVOKE.Application_SetStereoBase(swigCPtr, stereoBase);
1239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1242 public float GetStereoBase()
1244 float ret = NDalicPINVOKE.Application_GetStereoBase(swigCPtr);
1245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1249 internal ApplicationSignal InitSignal()
1251 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_InitSignal(swigCPtr), false);
1252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1256 internal ApplicationSignal TerminateSignal()
1258 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_TerminateSignal(swigCPtr), false);
1259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1263 internal ApplicationSignal PauseSignal()
1265 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_PauseSignal(swigCPtr), false);
1266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1270 internal ApplicationSignal ResumeSignal()
1272 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResumeSignal(swigCPtr), false);
1273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1277 internal ApplicationSignal ResetSignal()
1279 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResetSignal(swigCPtr), false);
1280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1284 internal ApplicationSignal ResizeSignal()
1286 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResizeSignal(swigCPtr), false);
1287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1291 internal ApplicationControlSignal AppControlSignal()
1293 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.Application_AppControlSignal(swigCPtr), false);
1294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1298 internal ApplicationSignal LanguageChangedSignal()
1300 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_LanguageChangedSignal(swigCPtr), false);
1301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1305 internal ApplicationSignal RegionChangedSignal()
1307 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_RegionChangedSignal(swigCPtr), false);
1308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1312 internal ApplicationSignal BatteryLowSignal()
1314 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_BatteryLowSignal(swigCPtr), false);
1315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1319 internal ApplicationSignal MemoryLowSignal()
1321 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_MemoryLowSignal(swigCPtr), false);
1322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1326 public enum WindowMode