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;
23 //This version should be updated and synced for every Dali native release
24 internal static class Version
26 public const int ver1 = 1;
27 public const int ver2 = 2;
28 public const int ver3 = 46;
29 public const int nuiVer1 = 0;
30 public const int nuiVer2 = 2;
31 public const int nuiVer3 = 46;
32 public const string nuiRelease = "";
36 * @brief Event arguments that passed via NUIApplicationInit signal
39 internal class NUIApplicationInitEventArgs : EventArgs
41 private Application _application;
44 * @brief Application - is the application that is being initialized
47 public Application Application
61 * @brief Event arguments that passed via NUIApplicationTerminate signal
64 internal class NUIApplicationTerminatingEventArgs : EventArgs
66 private Application _application;
68 * @brief Application - is the application that is being Terminated
71 public Application Application
85 * @brief Event arguments that passed via NUIApplicationPause signal
88 internal class NUIApplicationPausedEventArgs : EventArgs
90 private Application _application;
92 * @brief Application - is the application that is being Paused
95 public Application Application
103 _application = value;
109 * @brief Event arguments that passed via NUIApplicationResume signal
112 internal class NUIApplicationResumedEventArgs : EventArgs
114 private Application _application;
116 * @brief Application - is the application that is being Resumed
119 public Application Application
127 _application = value;
133 * @brief Event arguments that passed via NUIApplicationReset signal
136 internal class NUIApplicationResetEventArgs : EventArgs
138 private Application _application;
140 * @brief Application - is the application that is being Reset
143 public Application Application
151 _application = value;
157 * @brief Event arguments that passed via NUIApplicationResize signal
160 internal class NUIApplicationResizedEventArgs : EventArgs
162 private Application _application;
164 * @brief Application - is the application that is being Resized
167 public Application Application
175 _application = value;
181 * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
184 internal class NUIApplicationLanguageChangedEventArgs : EventArgs
186 private Application _application;
188 * @brief Application - is the application that is being affected with Device's language change
191 public Application Application
199 _application = value;
205 * @brief Event arguments that passed via NUIApplicationRegionChanged signal
208 internal class NUIApplicationRegionChangedEventArgs : EventArgs
210 private Application _application;
212 * @brief Application - is the application that is being affected with Device's region change
215 public Application Application
223 _application = value;
229 * @brief Event arguments that passed via NUIApplicationBatteryLow signal
232 internal class NUIApplicationBatteryLowEventArgs : EventArgs
234 private Application _application;
236 * @brief Application - is the application that is being affected when the battery level of the device is low
239 public Application Application
247 _application = value;
253 * @brief Event arguments that passed via NUIApplicationMemoryLow signal
256 internal class NUIApplicationMemoryLowEventArgs : EventArgs
258 private Application _application;
260 * @brief Application - is the application that is being affected when the memory level of the device is low
263 public Application Application
271 _application = value;
277 * @brief Event arguments that passed via NUIApplicationAppControl signal
280 internal class NUIApplicationAppControlEventArgs : EventArgs
282 private Application _application;
283 private IntPtr _voidp;
285 * @brief Application - is the application that is receiving the launch request from another application
288 public Application Application
296 _application = value;
300 * @brief VoidP - contains the information about why the application is launched
316 internal class Application : BaseHandle
318 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
320 internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Application_SWIGUpcast(cPtr), cMemoryOwn)
322 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
325 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj)
327 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
330 protected override void Dispose(DisposeTypes type)
337 if (type == DisposeTypes.Explicit)
340 //Release your own managed resources here.
341 //You should release all of your own disposable objects here.
345 //Release your own unmanaged resources here.
346 //You should not access any managed member here except static instance.
347 //because the execution order of Finalizes is non-deterministic.
349 if (swigCPtr.Handle != global::System.IntPtr.Zero)
354 NDalicPINVOKE.delete_Application(swigCPtr);
356 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
362 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
363 private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
364 private DaliEventHandler<object, NUIApplicationInitEventArgs> _applicationInitEventHandler;
365 private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
368 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
369 private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
370 private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> _applicationTerminateEventHandler;
371 private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
374 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
375 private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
376 private DaliEventHandler<object, NUIApplicationPausedEventArgs> _applicationPauseEventHandler;
377 private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
379 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
380 private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
381 private DaliEventHandler<object, NUIApplicationResumedEventArgs> _applicationResumeEventHandler;
382 private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
384 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
385 private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
386 private DaliEventHandler<object, NUIApplicationResetEventArgs> _applicationResetEventHandler;
387 private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
389 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
390 private delegate void NUIApplicationResizeEventCallbackDelegate(IntPtr application);
391 private DaliEventHandler<object, NUIApplicationResizedEventArgs> _applicationResizeEventHandler;
392 private NUIApplicationResizeEventCallbackDelegate _applicationResizeEventCallbackDelegate;
394 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
395 private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
396 private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
397 private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
400 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
401 private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
402 private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
403 private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
405 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
406 private delegate void NUIApplicationBatteryLowEventCallbackDelegate(IntPtr application);
407 private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
408 private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
410 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
411 private delegate void NUIApplicationMemoryLowEventCallbackDelegate(IntPtr application);
412 private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
413 private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
415 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
416 private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
417 private DaliEventHandler<object, NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
418 private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
421 * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
422 * (in the type of NUIApplicationInitEventHandler - DaliEventHandler<object,NUIApplicationInitEventArgs>)
423 * provided by the user. Initialized signal is emitted when application is initialised
425 public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
431 // Restricted to only one listener
432 if (_applicationInitEventHandler == null)
434 _applicationInitEventHandler += value;
436 _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
437 this.InitSignal().Connect(_applicationInitEventCallbackDelegate);
446 if (_applicationInitEventHandler != null)
448 this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
451 _applicationInitEventHandler -= value;
456 // Callback for Application InitSignal
457 private void OnApplicationInit(IntPtr data)
459 // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
460 DisposeQueue.Instance.Initialize();
461 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
463 // Populate all members of "e" (NUIApplicationInitEventArgs) with real data
464 e.Application = Application.GetApplicationFromPtr(data);
466 if (_applicationInitEventHandler != null)
468 //here we send all data to user event handlers
469 _applicationInitEventHandler(this, e);
474 * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
475 * (in the type of NUIApplicationTerminateEventHandler-DaliEventHandler<object,NUIApplicationTerminateEventArgs>)
476 * provided by the user. Terminated signal is emitted when application is terminating
478 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
484 // Restricted to only one listener
485 if (_applicationTerminateEventHandler == null)
487 _applicationTerminateEventHandler += value;
489 _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
490 this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
499 if (_applicationTerminateEventHandler != null)
501 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
504 _applicationTerminateEventHandler -= value;
509 // Callback for Application TerminateSignal
510 private void OnNUIApplicationTerminate(IntPtr data)
512 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
514 // Populate all members of "e" (NUIApplicationTerminateEventArgs) with real data
515 e.Application = Application.GetApplicationFromPtr(data);
517 if (_applicationTerminateEventHandler != null)
519 //here we send all data to user event handlers
520 _applicationTerminateEventHandler(this, e);
525 * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
526 * (in the type of NUIApplicationPauseEventHandler-DaliEventHandler<object,NUIApplicationPauseEventArgs>)
527 * provided by the user. Paused signal is emitted when application is paused
529 public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
535 // Restricted to only one listener
536 if (_applicationPauseEventHandler == null)
538 _applicationPauseEventHandler += value;
540 _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
541 this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
550 if (_applicationPauseEventHandler != null)
552 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
555 _applicationPauseEventHandler -= value;
560 // Callback for Application PauseSignal
561 private void OnNUIApplicationPause(IntPtr data)
563 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
565 // Populate all members of "e" (NUIApplicationPauseEventArgs) with real data
566 e.Application = Application.GetApplicationFromPtr(data);
568 if (_applicationPauseEventHandler != null)
570 //here we send all data to user event handlers
571 _applicationPauseEventHandler(this, e);
576 * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
577 * (in the type of NUIApplicationResumeEventHandler-DaliEventHandler<object,NUIApplicationResumeEventArgs>)
578 * provided by the user. Resumed signal is emitted when application is resumed
580 public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
586 // Restricted to only one listener
587 if (_applicationResumeEventHandler == null)
589 _applicationResumeEventHandler += value;
591 _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
592 this.ResumeSignal().Connect(_applicationResumeEventCallbackDelegate);
601 if (_applicationResumeEventHandler != null)
603 this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
606 _applicationResumeEventHandler -= value;
611 // Callback for Application ResumeSignal
612 private void OnNUIApplicationResume(IntPtr data)
614 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
616 // Populate all members of "e" (NUIApplicationResumeEventArgs) with real data
617 e.Application = Application.GetApplicationFromPtr(data);
619 if (_applicationResumeEventHandler != null)
621 //here we send all data to user event handlers
622 _applicationResumeEventHandler(this, e);
627 * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
628 * (in the type of NUIApplicationResetEventHandler-DaliEventHandler<object,NUIApplicationResetEventArgs>)
629 * provided by the user. Reset signal is emitted when application is reset
631 public event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
637 // Restricted to only one listener
638 if (_applicationResetEventHandler == null)
640 _applicationResetEventHandler += value;
642 _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
643 this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
652 if (_applicationResetEventHandler != null)
654 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
657 _applicationResetEventHandler -= value;
662 // Callback for Application ResetSignal
663 private void OnNUIApplicationReset(IntPtr data)
665 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
667 // Populate all members of "e" (NUIApplicationResetEventArgs) with real data
668 e.Application = Application.GetApplicationFromPtr(data);
670 if (_applicationResetEventHandler != null)
672 //here we send all data to user event handlers
673 _applicationResetEventHandler(this, e);
678 * @brief Event for Resized signal which can be used to subscribe/unsubscribe the event handler
679 * (in the type of NUIApplicationResizeEventHandler-DaliEventHandler<object,NUIApplicationResizeEventArgs>)
680 * provided by the user. Resized signal is emitted when application is resized
682 public event DaliEventHandler<object, NUIApplicationResizedEventArgs> Resized
688 // Restricted to only one listener
689 if (_applicationResizeEventHandler == null)
691 _applicationResizeEventHandler += value;
693 _applicationResizeEventCallbackDelegate = new NUIApplicationResizeEventCallbackDelegate(OnNUIApplicationResize);
694 this.ResizeSignal().Connect(_applicationResizeEventCallbackDelegate);
703 if (_applicationResizeEventHandler != null)
705 this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
708 _applicationResizeEventHandler -= value;
713 // Callback for Application ResizeSignal
714 private void OnNUIApplicationResize(IntPtr data)
716 NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs();
718 // Populate all members of "e" (NUIApplicationResizeEventArgs) with real data
719 e.Application = Application.GetApplicationFromPtr(data);
721 if (_applicationResizeEventHandler != null)
723 //here we send all data to user event handlers
724 _applicationResizeEventHandler(this, e);
729 * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
730 * (in the type of NUIApplicationLanguageChangedEventHandler-DaliEventHandler<object,NUIApplicationLanguageChangedEventArgs>)
731 * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
733 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
739 // Restricted to only one listener
740 if (_applicationLanguageChangedEventHandler == null)
742 _applicationLanguageChangedEventHandler += value;
744 _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
745 this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
754 if (_applicationLanguageChangedEventHandler != null)
756 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
759 _applicationLanguageChangedEventHandler -= value;
764 // Callback for Application LanguageChangedSignal
765 private void OnNUIApplicationLanguageChanged(IntPtr data)
767 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
769 // Populate all members of "e" (NUIApplicationLanguageChangedEventArgs) with real data
770 e.Application = Application.GetApplicationFromPtr(data);
772 if (_applicationLanguageChangedEventHandler != null)
774 //here we send all data to user event handlers
775 _applicationLanguageChangedEventHandler(this, e);
780 * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
781 * (in the type of NUIApplicationRegionChangedEventHandler-DaliEventHandler<object,NUIApplicationRegionChangedEventArgs>)
782 * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
784 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
790 // Restricted to only one listener
791 if (_applicationRegionChangedEventHandler == null)
793 _applicationRegionChangedEventHandler += value;
795 _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
796 this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
805 if (_applicationRegionChangedEventHandler != null)
807 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
810 _applicationRegionChangedEventHandler -= value;
815 // Callback for Application RegionChangedSignal
816 private void OnNUIApplicationRegionChanged(IntPtr data)
818 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
820 // Populate all members of "e" (NUIApplicationRegionChangedEventArgs) with real data
821 e.Application = Application.GetApplicationFromPtr(data);
823 if (_applicationRegionChangedEventHandler != null)
825 //here we send all data to user event handlers
826 _applicationRegionChangedEventHandler(this, e);
831 * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
832 * (in the type of NUIApplicationBatteryLowEventHandler-DaliEventHandler<object,NUIApplicationBatteryLowEventArgs>)
833 * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
835 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
841 // Restricted to only one listener
842 if (_applicationBatteryLowEventHandler == null)
844 _applicationBatteryLowEventHandler += value;
846 _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
847 this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
856 if (_applicationBatteryLowEventHandler != null)
858 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
861 _applicationBatteryLowEventHandler -= value;
866 // Callback for Application BatteryLowSignal
867 private void OnNUIApplicationBatteryLow(IntPtr data)
869 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
871 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
872 e.Application = Application.GetApplicationFromPtr(data);
874 if (_applicationBatteryLowEventHandler != null)
876 //here we send all data to user event handlers
877 _applicationBatteryLowEventHandler(this, e);
882 * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
883 * (in the type of NUIApplicationMemoryLowEventHandler-DaliEventHandler<object,NUIApplicationMemoryLowEventArgs>)
884 * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
886 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
892 // Restricted to only one listener
893 if (_applicationMemoryLowEventHandler == null)
895 _applicationMemoryLowEventHandler += value;
897 _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
898 this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
907 if (_applicationMemoryLowEventHandler != null)
909 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
912 _applicationMemoryLowEventHandler -= value;
917 // Callback for Application MemoryLowSignal
918 private void OnNUIApplicationMemoryLow(IntPtr data)
920 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
922 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
923 e.Application = Application.GetApplicationFromPtr(data);
925 if (_applicationMemoryLowEventHandler != null)
927 //here we send all data to user event handlers
928 _applicationMemoryLowEventHandler(this, e);
933 * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
934 * (in the type of NUIApplicationAppControlEventHandler-DaliEventHandler<object,NUIApplicationAppControlEventArgs>)
935 * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
937 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
943 // Restricted to only one listener
944 if (_applicationAppControlEventHandler == null)
946 _applicationAppControlEventHandler += value;
948 _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
949 this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
958 if (_applicationAppControlEventHandler != null)
960 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
963 _applicationAppControlEventHandler -= value;
968 // Callback for Application AppControlSignal
969 private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
971 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
973 // Populate all members of "e" (NUIApplicationAppControlEventArgs) with real data
974 e.Application = Application.GetApplicationFromPtr(application);
977 if (_applicationAppControlEventHandler != null)
979 //here we send all data to user event handlers
980 _applicationAppControlEventHandler(this, e);
984 private static Application _instance; // singleton
986 public delegate void InitDelegate();
988 public delegate void TerminateDelegate();
990 public delegate void PauseDelegate();
992 public delegate void ResumeDelegate();
994 public delegate void ResizeDelegate();
996 public delegate void AppControlDelegate();
998 public delegate void LanguageChangedDelegate();
1000 public delegate void RegionChangedDelegate();
1002 public delegate void BatteryLowDelegate();
1004 public delegate void MemoryLowDelegate();
1006 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1007 internal delegate void InitDelegateInternal();
1009 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1010 internal delegate void TerminateDelegateInternal();
1012 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1013 internal delegate void PauseDelegateInternal();
1015 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1016 internal delegate void ResumeDelegateInternal();
1018 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1019 internal delegate void ResizeDelegateInternal();
1021 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1022 internal delegate void AppControlDelegateInternal();
1024 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1025 internal delegate void LanguageChangedDelegateInternal();
1027 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1028 internal delegate void RegionChangedDelegateInternal();
1030 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1031 internal delegate void BatteryLowDelegateInternal();
1033 [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
1034 internal delegate void MemoryLowDelegateInternal();
1036 static void Initialization()
1038 // instance.InitDelegate();
1041 public static Application Instance
1049 public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1051 Application ret = new Application(cPtr, false);
1052 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1056 internal void SetupDelegates()
1058 InitDelegateInternal initializeCallback = new InitDelegateInternal(Initialization);
1060 NUILog.Debug("InitSignal connection count");
1062 this.InitSignal().Connect(initializeCallback);
1064 NUILog.Debug("InitSignal connection count = " + InitSignal().GetConnectionCount());
1067 public static Application NewApplication()
1069 _instance = NewApplication("", Application.WindowMode.Opaque);
1073 public static Application NewApplication(string stylesheet)
1075 _instance = NewApplication(stylesheet, Application.WindowMode.Opaque);
1079 public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
1088 if (NDalicManualPINVOKE.NativeVersionCheck(ref ver1, ref ver2, ref ver3))
1090 if (ver1 != Version.ver1 || ver2 != Version.ver2 || ver3 != Version.ver3)
1092 //throw new System.InvalidOperationException("Dali native version mismatch error! nui=" + Version.ver1 + "." + Version.ver2 + "." + Version.ver3 + " but dali=" + ver1 + "." + ver2 + "." + ver3);
1093 NUILog.Error("Dali native version mismatch error! nui=" + Version.nuiVer1 + "." + Version.nuiVer2 + "." + Version.nuiVer3 + Version.nuiRelease + " but native dali=" + ver1 + "." + ver2 + "." + ver3);
1098 //throw new System.InvalidOperationException("Dali native version mismatch error! nui=" + Version.ver1 + "." + Version.ver2 + "." + Version.ver3 + " but dali=" + ver1 + "." + ver2 + "." + ver3);
1099 NUILog.Error("Dali native version mismatch error! nui=" + Version.nuiVer1 + "." + Version.nuiVer2 + "." + Version.nuiVer3 + Version.nuiRelease + " but native dali=" + ver1 + "." + ver2 + "." + ver3);
1102 catch (Exception exc)
1104 //throw new System.InvalidOperationException("Dali native version is very old! nui=" + Version.ver1 + "." + Version.ver2 + "." + Version.ver3);
1105 NUILog.Error("Dali native version is very old! nui=" + Version.nuiVer1 + "." + Version.nuiVer2 + "." + Version.nuiVer3 + Version.nuiRelease);
1106 NUILog.Error("exception occured! =" + exc.Message);
1108 NUILog.Debug(" Dali native version=" + ver1 + "." + ver2 + "." + ver3 + " NUI version=" + Version.nuiVer1 + "." + Version.nuiVer2 + "." + Version.nuiVer3 + Version.nuiRelease);
1110 NUILog.Debug(" NewApplication(string stylesheet, Application.WindowMode windowMode) is called! ");
1112 // register all Views with the type registry, so that can be created / styled via JSON
1113 //ViewRegistryHelper.Initialize(); //moved to Application side.
1115 Application ret = New(1, stylesheet, windowMode);
1116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118 // we've got an application now connect the signals
1119 ret.SetupDelegates();
1120 // set the singleton
1125 //Removed from v0.2.33
1126 /*public bool AddIdle(System.Delegate func)
1128 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
1129 System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1131 bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1140 * Outer::outer_method(int)
1142 public static Application New()
1144 NUILog.Debug("New() is called!");
1146 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_0(), true);
1147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1151 public static Application New(int argc)
1153 NUILog.Debug("New(int argc) is called!");
1155 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_1(argc), true);
1156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1160 public static Application New(int argc, string stylesheet)
1162 NUILog.Debug("New(int argc, string stylesheet) is called!");
1164 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_2(argc, stylesheet), true);
1165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1169 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
1171 NUILog.Debug("New(int argc, string stylesheet, Application.WindowMode windowMode) is called!");
1173 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_3(argc, stylesheet, (int)windowMode), true);
1174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1178 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1180 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1185 public Application() : this(NDalicPINVOKE.new_Application__SWIG_0(), true)
1187 NUILog.Debug("Application() is called!");
1189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1192 public Application(Application application) : this(NDalicPINVOKE.new_Application__SWIG_1(Application.getCPtr(application)), true)
1194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1197 public Application Assign(Application application)
1199 Application ret = new Application(NDalicPINVOKE.Application_Assign(swigCPtr, Application.getCPtr(application)), false);
1200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1204 public void MainLoop()
1206 NDalicPINVOKE.Application_MainLoop__SWIG_0(swigCPtr);
1207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1210 internal void MainLoop(SWIGTYPE_p_Configuration__ContextLoss configuration)
1212 NDalicPINVOKE.Application_MainLoop__SWIG_1(swigCPtr, SWIGTYPE_p_Configuration__ContextLoss.getCPtr(configuration));
1213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1218 NDalicPINVOKE.Application_Lower(swigCPtr);
1219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1224 NDalicPINVOKE.Application_Quit(swigCPtr);
1225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1228 internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1230 bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1235 public Window GetWindow()
1237 Window ret = new Window(NDalicPINVOKE.Application_GetWindow(swigCPtr), true);
1238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1242 public void ReplaceWindow(Rectangle windowPosition, string name)
1244 NDalicPINVOKE.Application_ReplaceWindow(swigCPtr, Rectangle.getCPtr(windowPosition), name);
1245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1248 public static string GetResourcePath()
1250 string ret = NDalicPINVOKE.Application_GetResourcePath();
1251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1255 internal void SetViewMode(ViewMode viewMode)
1257 NDalicPINVOKE.Application_SetViewMode(swigCPtr, (int)viewMode);
1258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1261 internal ViewMode GetViewMode()
1263 ViewMode ret = (ViewMode)NDalicPINVOKE.Application_GetViewMode(swigCPtr);
1264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1268 public void SetStereoBase(float stereoBase)
1270 NDalicPINVOKE.Application_SetStereoBase(swigCPtr, stereoBase);
1271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1274 public float GetStereoBase()
1276 float ret = NDalicPINVOKE.Application_GetStereoBase(swigCPtr);
1277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1281 internal ApplicationSignal InitSignal()
1283 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_InitSignal(swigCPtr), false);
1284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1288 internal ApplicationSignal TerminateSignal()
1290 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_TerminateSignal(swigCPtr), false);
1291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1295 internal ApplicationSignal PauseSignal()
1297 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_PauseSignal(swigCPtr), false);
1298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1302 internal ApplicationSignal ResumeSignal()
1304 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResumeSignal(swigCPtr), false);
1305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1309 internal ApplicationSignal ResetSignal()
1311 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResetSignal(swigCPtr), false);
1312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1316 internal ApplicationSignal ResizeSignal()
1318 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResizeSignal(swigCPtr), false);
1319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1323 internal ApplicationControlSignal AppControlSignal()
1325 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.Application_AppControlSignal(swigCPtr), false);
1326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1330 internal ApplicationSignal LanguageChangedSignal()
1332 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_LanguageChangedSignal(swigCPtr), false);
1333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1337 internal ApplicationSignal RegionChangedSignal()
1339 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_RegionChangedSignal(swigCPtr), false);
1340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1344 internal ApplicationSignal BatteryLowSignal()
1346 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_BatteryLowSignal(swigCPtr), false);
1347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1351 internal ApplicationSignal MemoryLowSignal()
1353 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_MemoryLowSignal(swigCPtr), false);
1354 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1358 public enum WindowMode