2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 using System.Runtime.InteropServices;
25 * @brief Event arguments that passed via NUIApplicationInit signal
28 internal class NUIApplicationInitEventArgs : EventArgs
30 private Application _application;
33 * @brief Application - is the application that is being initialized
36 public Application Application
50 * @brief Event arguments that passed via NUIApplicationTerminate signal
53 internal class NUIApplicationTerminatingEventArgs : EventArgs
55 private Application _application;
57 * @brief Application - is the application that is being Terminated
60 public Application Application
74 * @brief Event arguments that passed via NUIApplicationPause signal
77 internal class NUIApplicationPausedEventArgs : EventArgs
79 private Application _application;
81 * @brief Application - is the application that is being Paused
84 public Application Application
98 * @brief Event arguments that passed via NUIApplicationResume signal
101 internal class NUIApplicationResumedEventArgs : EventArgs
103 private Application _application;
105 * @brief Application - is the application that is being Resumed
108 public Application Application
116 _application = value;
122 * @brief Event arguments that passed via NUIApplicationReset signal
125 internal class NUIApplicationResetEventArgs : EventArgs
127 private Application _application;
129 * @brief Application - is the application that is being Reset
132 public Application Application
140 _application = value;
146 * @brief Event arguments that passed via NUIApplicationResize signal
149 internal class NUIApplicationResizedEventArgs : EventArgs
151 private Application _application;
153 * @brief Application - is the application that is being Resized
156 public Application Application
164 _application = value;
170 * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
173 internal class NUIApplicationLanguageChangedEventArgs : EventArgs
175 private Application _application;
177 * @brief Application - is the application that is being affected with Device's language change
180 public Application Application
188 _application = value;
194 * @brief Event arguments that passed via NUIApplicationRegionChanged signal
197 internal class NUIApplicationRegionChangedEventArgs : EventArgs
199 private Application _application;
201 * @brief Application - is the application that is being affected with Device's region change
204 public Application Application
212 _application = value;
218 * @brief Event arguments that passed via NUIApplicationBatteryLow signal
221 internal class NUIApplicationBatteryLowEventArgs : EventArgs
223 private Application.BatteryStatus _status;
225 * @brief Application - is the application that is being affected when the battery level of the device is low
228 public Application.BatteryStatus BatteryStatus
242 * @brief Event arguments that passed via NUIApplicationMemoryLow signal
245 internal class NUIApplicationMemoryLowEventArgs : EventArgs
247 private Application.MemoryStatus _status;
249 * @brief Application - is the application that is being affected when the memory level of the device is low
252 public Application.MemoryStatus MemoryStatus
266 * @brief Event arguments that passed via NUIApplicationAppControl signal
269 internal class NUIApplicationAppControlEventArgs : EventArgs
271 private Application _application;
272 private IntPtr _voidp;
274 * @brief Application - is the application that is receiving the launch request from another application
277 public Application Application
285 _application = value;
289 * @brief VoidP - contains the information about why the application is launched
305 internal class Application : BaseHandle
307 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
309 internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Application_SWIGUpcast(cPtr), cMemoryOwn)
311 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
314 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj)
316 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
319 protected override void Dispose(DisposeTypes type)
326 if (type == DisposeTypes.Explicit)
329 //Release your own managed resources here.
330 //You should release all of your own disposable objects here.
334 //Release your own unmanaged resources here.
335 //You should not access any managed member here except static instance.
336 //because the execution order of Finalizes is non-deterministic.
338 if (_applicationInitEventCallbackDelegate != null)
340 this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
343 if (_applicationTerminateEventCallbackDelegate != null)
345 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
348 if (_applicationPauseEventCallbackDelegate != null)
350 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
353 if (_applicationResumeEventCallbackDelegate != null)
355 this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
358 if (_applicationResetEventCallbackDelegate != null)
360 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
363 if (_applicationResizeEventCallbackDelegate != null)
365 this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
368 if (_applicationLanguageChangedEventCallbackDelegate != null)
370 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
373 if (_applicationRegionChangedEventCallbackDelegate != null)
375 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
378 if (_applicationBatteryLowEventCallbackDelegate != null)
380 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
383 if (_applicationMemoryLowEventCallbackDelegate != null)
385 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
388 if (_applicationAppControlEventCallbackDelegate != null)
390 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
393 if (swigCPtr.Handle != global::System.IntPtr.Zero)
398 NDalicPINVOKE.delete_Application(swigCPtr);
400 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
406 /// <since_tizen> 4 </since_tizen>
407 public enum BatteryStatus
414 /// <since_tizen> 4 </since_tizen>
415 public enum MemoryStatus
422 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
423 private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
424 private DaliEventHandler<object, NUIApplicationInitEventArgs> _applicationInitEventHandler;
425 private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
428 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
429 private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
430 private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> _applicationTerminateEventHandler;
431 private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
434 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
435 private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
436 private DaliEventHandler<object, NUIApplicationPausedEventArgs> _applicationPauseEventHandler;
437 private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
439 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
440 private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
441 private DaliEventHandler<object, NUIApplicationResumedEventArgs> _applicationResumeEventHandler;
442 private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
444 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
445 private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
446 private DaliEventHandler<object, NUIApplicationResetEventArgs> _applicationResetEventHandler;
447 private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
449 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
450 private delegate void NUIApplicationResizeEventCallbackDelegate(IntPtr application);
451 private DaliEventHandler<object, NUIApplicationResizedEventArgs> _applicationResizeEventHandler;
452 private NUIApplicationResizeEventCallbackDelegate _applicationResizeEventCallbackDelegate;
454 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
455 private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
456 private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
457 private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
460 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
461 private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
462 private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
463 private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
465 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
466 private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status);
467 private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
468 private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
470 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
471 private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status);
472 private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
473 private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
475 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
476 private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
477 private DaliEventHandler<object, NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
478 private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
481 * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
482 * provided by the user. Initialized signal is emitted when application is initialised
484 public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
490 // Restricted to only one listener
491 if (_applicationInitEventHandler == null)
493 _applicationInitEventHandler += value;
495 _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
496 this.InitSignal().Connect(_applicationInitEventCallbackDelegate);
505 if (_applicationInitEventHandler != null)
507 this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
510 _applicationInitEventHandler -= value;
515 // Callback for Application InitSignal
516 private void OnApplicationInit(IntPtr data)
518 if (Version.DaliVersionMatchWithNUI() == false)
520 Tizen.Log.Fatal("NUI", "Dali and NUI are version mismatched!");
523 // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
524 DisposeQueue.Instance.Initialize();
526 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
527 // Populate all members of "e" (NUIApplicationInitEventArgs) with real data
528 e.Application = Application.GetApplicationFromPtr(data);
529 if (_applicationInitEventHandler != null)
531 //here we send all data to user event handlers
532 _applicationInitEventHandler(this, e);
537 * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
538 * provided by the user. Terminated signal is emitted when application is terminating
540 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
546 // Restricted to only one listener
547 if (_applicationTerminateEventHandler == null)
549 _applicationTerminateEventHandler += value;
551 _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
552 this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
561 if (_applicationTerminateEventHandler != null)
563 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
566 _applicationTerminateEventHandler -= value;
571 // Callback for Application TerminateSignal
572 private void OnNUIApplicationTerminate(IntPtr data)
574 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
576 // Populate all members of "e" (NUIApplicationTerminateEventArgs) with real data
577 e.Application = Application.GetApplicationFromPtr(data);
579 if (_applicationTerminateEventHandler != null)
581 //here we send all data to user event handlers
582 _applicationTerminateEventHandler(this, e);
587 * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
588 * provided by the user. Paused signal is emitted when application is paused
590 public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
596 // Restricted to only one listener
597 if (_applicationPauseEventHandler == null)
599 _applicationPauseEventHandler += value;
601 _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
602 this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
611 if (_applicationPauseEventHandler != null)
613 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
616 _applicationPauseEventHandler -= value;
621 // Callback for Application PauseSignal
622 private void OnNUIApplicationPause(IntPtr data)
624 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
626 // Populate all members of "e" (NUIApplicationPauseEventArgs) with real data
627 e.Application = Application.GetApplicationFromPtr(data);
629 if (_applicationPauseEventHandler != null)
631 //here we send all data to user event handlers
632 _applicationPauseEventHandler(this, e);
637 * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
638 * provided by the user. Resumed signal is emitted when application is resumed
640 public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
646 // Restricted to only one listener
647 if (_applicationResumeEventHandler == null)
649 _applicationResumeEventHandler += value;
651 _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
652 this.ResumeSignal().Connect(_applicationResumeEventCallbackDelegate);
661 if (_applicationResumeEventHandler != null)
663 this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
666 _applicationResumeEventHandler -= value;
671 // Callback for Application ResumeSignal
672 private void OnNUIApplicationResume(IntPtr data)
674 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
676 // Populate all members of "e" (NUIApplicationResumeEventArgs) with real data
677 e.Application = Application.GetApplicationFromPtr(data);
679 if (_applicationResumeEventHandler != null)
681 //here we send all data to user event handlers
682 _applicationResumeEventHandler(this, e);
687 * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
688 * provided by the user. Reset signal is emitted when application is reset
690 public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
696 // Restricted to only one listener
697 if (_applicationResetEventHandler == null)
699 _applicationResetEventHandler += value;
701 _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
702 this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
711 if (_applicationResetEventHandler != null)
713 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
716 _applicationResetEventHandler -= value;
721 // Callback for Application ResetSignal
722 private void OnNUIApplicationReset(IntPtr data)
724 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
726 // Populate all members of "e" (NUIApplicationResetEventArgs) with real data
727 e.Application = Application.GetApplicationFromPtr(data);
729 if (_applicationResetEventHandler != null)
731 //here we send all data to user event handlers
732 _applicationResetEventHandler(this, e);
737 * @brief Event for Resized signal which can be used to subscribe/unsubscribe the event handler
738 * provided by the user. Resized signal is emitted when application is resized
740 public event DaliEventHandler<object, NUIApplicationResizedEventArgs> Resized
746 // Restricted to only one listener
747 if (_applicationResizeEventHandler == null)
749 _applicationResizeEventHandler += value;
751 _applicationResizeEventCallbackDelegate = new NUIApplicationResizeEventCallbackDelegate(OnNUIApplicationResize);
752 this.ResizeSignal().Connect(_applicationResizeEventCallbackDelegate);
761 if (_applicationResizeEventHandler != null)
763 this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
766 _applicationResizeEventHandler -= value;
771 // Callback for Application ResizeSignal
772 private void OnNUIApplicationResize(IntPtr data)
774 NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs();
776 // Populate all members of "e" (NUIApplicationResizeEventArgs) with real data
777 e.Application = Application.GetApplicationFromPtr(data);
779 if (_applicationResizeEventHandler != null)
781 //here we send all data to user event handlers
782 _applicationResizeEventHandler(this, e);
787 * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
788 * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
790 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
796 // Restricted to only one listener
797 if (_applicationLanguageChangedEventHandler == null)
799 _applicationLanguageChangedEventHandler += value;
801 _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
802 this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
811 if (_applicationLanguageChangedEventHandler != null)
813 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
816 _applicationLanguageChangedEventHandler -= value;
821 // Callback for Application LanguageChangedSignal
822 private void OnNUIApplicationLanguageChanged(IntPtr data)
824 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
826 // Populate all members of "e" (NUIApplicationLanguageChangedEventArgs) with real data
827 e.Application = Application.GetApplicationFromPtr(data);
829 if (_applicationLanguageChangedEventHandler != null)
831 //here we send all data to user event handlers
832 _applicationLanguageChangedEventHandler(this, e);
837 * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
838 * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
840 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
846 // Restricted to only one listener
847 if (_applicationRegionChangedEventHandler == null)
849 _applicationRegionChangedEventHandler += value;
851 _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
852 this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
861 if (_applicationRegionChangedEventHandler != null)
863 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
866 _applicationRegionChangedEventHandler -= value;
871 // Callback for Application RegionChangedSignal
872 private void OnNUIApplicationRegionChanged(IntPtr data)
874 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
876 // Populate all members of "e" (NUIApplicationRegionChangedEventArgs) with real data
877 e.Application = Application.GetApplicationFromPtr(data);
879 if (_applicationRegionChangedEventHandler != null)
881 //here we send all data to user event handlers
882 _applicationRegionChangedEventHandler(this, e);
887 * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
888 * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
890 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
896 // Restricted to only one listener
897 if (_applicationBatteryLowEventHandler == null)
899 _applicationBatteryLowEventHandler += value;
901 _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
902 this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
911 if (_applicationBatteryLowEventHandler != null)
913 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
916 _applicationBatteryLowEventHandler -= value;
921 // Callback for Application BatteryLowSignal
922 private void OnNUIApplicationBatteryLow(BatteryStatus status)
924 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
926 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
927 e.BatteryStatus = status;
929 if (_applicationBatteryLowEventHandler != null)
931 //here we send all data to user event handlers
932 _applicationBatteryLowEventHandler(this, e);
937 * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
938 * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
940 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
946 // Restricted to only one listener
947 if (_applicationMemoryLowEventHandler == null)
949 _applicationMemoryLowEventHandler += value;
951 _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
952 this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
961 if (_applicationMemoryLowEventHandler != null)
963 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
966 _applicationMemoryLowEventHandler -= value;
971 // Callback for Application MemoryLowSignal
972 private void OnNUIApplicationMemoryLow(MemoryStatus status)
974 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
976 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
977 e.MemoryStatus = status;
979 if (_applicationMemoryLowEventHandler != null)
981 //here we send all data to user event handlers
982 _applicationMemoryLowEventHandler(this, e);
987 * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
988 * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
990 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
996 // Restricted to only one listener
997 if (_applicationAppControlEventHandler == null)
999 _applicationAppControlEventHandler += value;
1001 _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1002 this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
1011 if (_applicationAppControlEventHandler != null)
1013 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
1016 _applicationAppControlEventHandler -= value;
1021 // Callback for Application AppControlSignal
1022 private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1024 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1026 // Populate all members of "e" (NUIApplicationAppControlEventArgs) with real data
1027 e.Application = Application.GetApplicationFromPtr(application);
1030 if (_applicationAppControlEventHandler != null)
1032 //here we send all data to user event handlers
1033 _applicationAppControlEventHandler(this, e);
1037 private static Application _instance; // singleton
1039 public static Application Instance
1047 public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1049 Application ret = new Application(cPtr, false);
1050 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1054 public static Application NewApplication()
1056 return NewApplication("", Application.WindowMode.Opaque);
1059 public static Application NewApplication(string stylesheet)
1061 return NewApplication(stylesheet, Application.WindowMode.Opaque);
1064 public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
1066 // register all Views with the type registry, so that can be created / styled via JSON
1067 //ViewRegistryHelper.Initialize(); //moved to Application side.
1069 Application ret = New(1, stylesheet, windowMode);
1070 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1072 // set the singleton
1078 public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
1080 Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
1081 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1083 // set the singleton
1089 /// Ensures that the function passed in is called from the main loop when it is idle.
1091 /// <param name="func">The function to call</param>
1092 /// <returns>true if added successfully, false otherwise</returns>
1093 public bool AddIdle(System.Delegate func)
1095 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1096 System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1098 bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105 * Outer::outer_method(int)
1107 public static Application New()
1109 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_0(), true);
1110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1114 public static Application New(int argc)
1116 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_1(argc), true);
1117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1121 public static Application New(int argc, string stylesheet)
1123 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_2(argc, stylesheet), true);
1124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1128 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
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 int argc = args.Length;
1138 string argvStr = string.Join(" ", args);
1140 Application ret = new Application(NDalicPINVOKE.Application_New__MANUAL_4(argc, argvStr, stylesheet, (int)windowMode), true);
1141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1145 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1147 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1152 public Application() : this(NDalicPINVOKE.new_Application__SWIG_0(), true)
1154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1157 public Application(Application application) : this(NDalicPINVOKE.new_Application__SWIG_1(Application.getCPtr(application)), true)
1159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1162 public Application Assign(Application application)
1164 Application ret = new Application(NDalicPINVOKE.Application_Assign(swigCPtr, Application.getCPtr(application)), false);
1165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1169 public void MainLoop()
1171 NDalicPINVOKE.Application_MainLoop__SWIG_0(swigCPtr);
1172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1175 internal void MainLoop(SWIGTYPE_p_Configuration__ContextLoss configuration)
1177 NDalicPINVOKE.Application_MainLoop__SWIG_1(swigCPtr, SWIGTYPE_p_Configuration__ContextLoss.getCPtr(configuration));
1178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1183 NDalicPINVOKE.Application_Lower(swigCPtr);
1184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1189 NDalicPINVOKE.Application_Quit(swigCPtr);
1190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1193 internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1195 bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1200 public Window GetWindow()
1202 Window ret = new Window(NDalicPINVOKE.Application_GetWindow(swigCPtr), true);
1203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1207 public void ReplaceWindow(Rectangle windowPosition, string name)
1209 NDalicPINVOKE.Application_ReplaceWindow(swigCPtr, Rectangle.getCPtr(windowPosition), name);
1210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1213 public static string GetResourcePath()
1215 string ret = NDalicPINVOKE.Application_GetResourcePath();
1216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1220 internal void SetViewMode(ViewMode viewMode)
1222 NDalicPINVOKE.Application_SetViewMode(swigCPtr, (int)viewMode);
1223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1226 internal ViewMode GetViewMode()
1228 ViewMode ret = (ViewMode)NDalicPINVOKE.Application_GetViewMode(swigCPtr);
1229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1233 public void SetStereoBase(float stereoBase)
1235 NDalicPINVOKE.Application_SetStereoBase(swigCPtr, stereoBase);
1236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1239 public float GetStereoBase()
1241 float ret = NDalicPINVOKE.Application_GetStereoBase(swigCPtr);
1242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1246 public string GetLanguage()
1248 string ret = NDalicPINVOKE.Application_GetLanguage(swigCPtr);
1249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1253 public string GetRegion()
1255 string ret = NDalicPINVOKE.Application_GetRegion(swigCPtr);
1256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1261 internal ApplicationSignal InitSignal()
1263 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_InitSignal(swigCPtr), false);
1264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1268 internal ApplicationSignal TerminateSignal()
1270 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_TerminateSignal(swigCPtr), false);
1271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1275 internal ApplicationSignal PauseSignal()
1277 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_PauseSignal(swigCPtr), false);
1278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1282 internal ApplicationSignal ResumeSignal()
1284 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResumeSignal(swigCPtr), false);
1285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1289 internal ApplicationSignal ResetSignal()
1291 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResetSignal(swigCPtr), false);
1292 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1296 internal ApplicationSignal ResizeSignal()
1298 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResizeSignal(swigCPtr), false);
1299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1303 internal ApplicationControlSignal AppControlSignal()
1305 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.Application_AppControlSignal(swigCPtr), false);
1306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1310 internal ApplicationSignal LanguageChangedSignal()
1312 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_LanguageChangedSignal(swigCPtr), false);
1313 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1317 internal ApplicationSignal RegionChangedSignal()
1319 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_RegionChangedSignal(swigCPtr), false);
1320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1324 internal LowBatterySignalType BatteryLowSignal()
1326 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.Application_LowBatterySignal(swigCPtr), false);
1327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1331 internal LowMemorySignalType MemoryLowSignal()
1333 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.Application_LowMemorySignal(swigCPtr), false);
1334 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1338 /// <since_tizen> 3 </since_tizen>
1339 public enum WindowMode