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 // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
519 DisposeQueue.Instance.Initialize();
521 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
522 // Populate all members of "e" (NUIApplicationInitEventArgs) with real data
523 e.Application = Application.GetApplicationFromPtr(data);
524 if (_applicationInitEventHandler != null)
526 //here we send all data to user event handlers
527 _applicationInitEventHandler(this, e);
532 * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
533 * provided by the user. Terminated signal is emitted when application is terminating
535 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
541 // Restricted to only one listener
542 if (_applicationTerminateEventHandler == null)
544 _applicationTerminateEventHandler += value;
546 _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
547 this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
556 if (_applicationTerminateEventHandler != null)
558 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
561 _applicationTerminateEventHandler -= value;
566 // Callback for Application TerminateSignal
567 private void OnNUIApplicationTerminate(IntPtr data)
569 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
571 // Populate all members of "e" (NUIApplicationTerminateEventArgs) with real data
572 e.Application = Application.GetApplicationFromPtr(data);
574 if (_applicationTerminateEventHandler != null)
576 //here we send all data to user event handlers
577 _applicationTerminateEventHandler(this, e);
582 * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
583 * provided by the user. Paused signal is emitted when application is paused
585 public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
591 // Restricted to only one listener
592 if (_applicationPauseEventHandler == null)
594 _applicationPauseEventHandler += value;
596 _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
597 this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
606 if (_applicationPauseEventHandler != null)
608 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
611 _applicationPauseEventHandler -= value;
616 // Callback for Application PauseSignal
617 private void OnNUIApplicationPause(IntPtr data)
619 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
621 // Populate all members of "e" (NUIApplicationPauseEventArgs) with real data
622 e.Application = Application.GetApplicationFromPtr(data);
624 if (_applicationPauseEventHandler != null)
626 //here we send all data to user event handlers
627 _applicationPauseEventHandler(this, e);
632 * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
633 * provided by the user. Resumed signal is emitted when application is resumed
635 public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
641 // Restricted to only one listener
642 if (_applicationResumeEventHandler == null)
644 _applicationResumeEventHandler += value;
646 _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
647 this.ResumeSignal().Connect(_applicationResumeEventCallbackDelegate);
656 if (_applicationResumeEventHandler != null)
658 this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
661 _applicationResumeEventHandler -= value;
666 // Callback for Application ResumeSignal
667 private void OnNUIApplicationResume(IntPtr data)
669 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
671 // Populate all members of "e" (NUIApplicationResumeEventArgs) with real data
672 e.Application = Application.GetApplicationFromPtr(data);
674 if (_applicationResumeEventHandler != null)
676 //here we send all data to user event handlers
677 _applicationResumeEventHandler(this, e);
682 * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
683 * provided by the user. Reset signal is emitted when application is reset
685 public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
691 // Restricted to only one listener
692 if (_applicationResetEventHandler == null)
694 _applicationResetEventHandler += value;
696 _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
697 this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
706 if (_applicationResetEventHandler != null)
708 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
711 _applicationResetEventHandler -= value;
716 // Callback for Application ResetSignal
717 private void OnNUIApplicationReset(IntPtr data)
719 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
721 // Populate all members of "e" (NUIApplicationResetEventArgs) with real data
722 e.Application = Application.GetApplicationFromPtr(data);
724 if (_applicationResetEventHandler != null)
726 //here we send all data to user event handlers
727 _applicationResetEventHandler(this, e);
732 * @brief Event for Resized signal which can be used to subscribe/unsubscribe the event handler
733 * provided by the user. Resized signal is emitted when application is resized
735 public event DaliEventHandler<object, NUIApplicationResizedEventArgs> Resized
741 // Restricted to only one listener
742 if (_applicationResizeEventHandler == null)
744 _applicationResizeEventHandler += value;
746 _applicationResizeEventCallbackDelegate = new NUIApplicationResizeEventCallbackDelegate(OnNUIApplicationResize);
747 this.ResizeSignal().Connect(_applicationResizeEventCallbackDelegate);
756 if (_applicationResizeEventHandler != null)
758 this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
761 _applicationResizeEventHandler -= value;
766 // Callback for Application ResizeSignal
767 private void OnNUIApplicationResize(IntPtr data)
769 NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs();
771 // Populate all members of "e" (NUIApplicationResizeEventArgs) with real data
772 e.Application = Application.GetApplicationFromPtr(data);
774 if (_applicationResizeEventHandler != null)
776 //here we send all data to user event handlers
777 _applicationResizeEventHandler(this, e);
782 * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
783 * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
785 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
791 // Restricted to only one listener
792 if (_applicationLanguageChangedEventHandler == null)
794 _applicationLanguageChangedEventHandler += value;
796 _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
797 this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
806 if (_applicationLanguageChangedEventHandler != null)
808 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
811 _applicationLanguageChangedEventHandler -= value;
816 // Callback for Application LanguageChangedSignal
817 private void OnNUIApplicationLanguageChanged(IntPtr data)
819 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
821 // Populate all members of "e" (NUIApplicationLanguageChangedEventArgs) with real data
822 e.Application = Application.GetApplicationFromPtr(data);
824 if (_applicationLanguageChangedEventHandler != null)
826 //here we send all data to user event handlers
827 _applicationLanguageChangedEventHandler(this, e);
832 * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
833 * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
835 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
841 // Restricted to only one listener
842 if (_applicationRegionChangedEventHandler == null)
844 _applicationRegionChangedEventHandler += value;
846 _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
847 this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
856 if (_applicationRegionChangedEventHandler != null)
858 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
861 _applicationRegionChangedEventHandler -= value;
866 // Callback for Application RegionChangedSignal
867 private void OnNUIApplicationRegionChanged(IntPtr data)
869 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
871 // Populate all members of "e" (NUIApplicationRegionChangedEventArgs) with real data
872 e.Application = Application.GetApplicationFromPtr(data);
874 if (_applicationRegionChangedEventHandler != null)
876 //here we send all data to user event handlers
877 _applicationRegionChangedEventHandler(this, e);
882 * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
883 * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
885 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
891 // Restricted to only one listener
892 if (_applicationBatteryLowEventHandler == null)
894 _applicationBatteryLowEventHandler += value;
896 _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
897 this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
906 if (_applicationBatteryLowEventHandler != null)
908 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
911 _applicationBatteryLowEventHandler -= value;
916 // Callback for Application BatteryLowSignal
917 private void OnNUIApplicationBatteryLow(BatteryStatus status)
919 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
921 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
922 e.BatteryStatus = status;
924 if (_applicationBatteryLowEventHandler != null)
926 //here we send all data to user event handlers
927 _applicationBatteryLowEventHandler(this, e);
932 * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
933 * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
935 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
941 // Restricted to only one listener
942 if (_applicationMemoryLowEventHandler == null)
944 _applicationMemoryLowEventHandler += value;
946 _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
947 this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
956 if (_applicationMemoryLowEventHandler != null)
958 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
961 _applicationMemoryLowEventHandler -= value;
966 // Callback for Application MemoryLowSignal
967 private void OnNUIApplicationMemoryLow(MemoryStatus status)
969 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
971 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
972 e.MemoryStatus = status;
974 if (_applicationMemoryLowEventHandler != null)
976 //here we send all data to user event handlers
977 _applicationMemoryLowEventHandler(this, e);
982 * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
983 * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
985 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
991 // Restricted to only one listener
992 if (_applicationAppControlEventHandler == null)
994 _applicationAppControlEventHandler += value;
996 _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
997 this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
1006 if (_applicationAppControlEventHandler != null)
1008 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
1011 _applicationAppControlEventHandler -= value;
1016 // Callback for Application AppControlSignal
1017 private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1019 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1021 // Populate all members of "e" (NUIApplicationAppControlEventArgs) with real data
1022 e.Application = Application.GetApplicationFromPtr(application);
1025 if (_applicationAppControlEventHandler != null)
1027 //here we send all data to user event handlers
1028 _applicationAppControlEventHandler(this, e);
1032 private static Application _instance; // singleton
1034 public static Application Instance
1042 public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1044 Application ret = new Application(cPtr, false);
1045 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1049 public static Application NewApplication()
1051 return NewApplication("", Application.WindowMode.Opaque);
1054 public static Application NewApplication(string stylesheet)
1056 return NewApplication(stylesheet, Application.WindowMode.Opaque);
1059 public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
1061 // register all Views with the type registry, so that can be created / styled via JSON
1062 //ViewRegistryHelper.Initialize(); //moved to Application side.
1064 Application ret = New(1, stylesheet, windowMode);
1065 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1067 // set the singleton
1073 public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
1075 Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
1076 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1078 // set the singleton
1084 /// Ensures that the function passed in is called from the main loop when it is idle.
1086 /// <param name="func">The function to call</param>
1087 /// <returns>true if added successfully, false otherwise</returns>
1088 public bool AddIdle(System.Delegate func)
1090 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1091 System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1093 bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1095 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1100 * Outer::outer_method(int)
1102 public static Application New()
1104 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_0(), true);
1105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1109 public static Application New(int argc)
1111 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_1(argc), true);
1112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1116 public static Application New(int argc, string stylesheet)
1118 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_2(argc, stylesheet), true);
1119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1123 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
1125 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_3(argc, stylesheet, (int)windowMode), true);
1126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1130 public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode)
1132 int argc = args.Length;
1133 string argvStr = string.Join(" ", args);
1135 Application ret = new Application(NDalicPINVOKE.Application_New__MANUAL_4(argc, argvStr, stylesheet, (int)windowMode), true);
1136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1140 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1142 Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1147 public Application() : this(NDalicPINVOKE.new_Application__SWIG_0(), true)
1149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1152 public Application(Application application) : this(NDalicPINVOKE.new_Application__SWIG_1(Application.getCPtr(application)), true)
1154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1157 public Application Assign(Application application)
1159 Application ret = new Application(NDalicPINVOKE.Application_Assign(swigCPtr, Application.getCPtr(application)), false);
1160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1164 public void MainLoop()
1166 NDalicPINVOKE.Application_MainLoop__SWIG_0(swigCPtr);
1167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1170 internal void MainLoop(SWIGTYPE_p_Configuration__ContextLoss configuration)
1172 NDalicPINVOKE.Application_MainLoop__SWIG_1(swigCPtr, SWIGTYPE_p_Configuration__ContextLoss.getCPtr(configuration));
1173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1178 NDalicPINVOKE.Application_Lower(swigCPtr);
1179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1184 NDalicPINVOKE.Application_Quit(swigCPtr);
1185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1188 internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1190 bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1195 public Window GetWindow()
1197 Window ret = new Window(NDalicPINVOKE.Application_GetWindow(swigCPtr), true);
1198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1202 public void ReplaceWindow(Rectangle windowPosition, string name)
1204 NDalicPINVOKE.Application_ReplaceWindow(swigCPtr, Rectangle.getCPtr(windowPosition), name);
1205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1208 public static string GetResourcePath()
1210 string ret = NDalicPINVOKE.Application_GetResourcePath();
1211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1215 internal void SetViewMode(ViewMode viewMode)
1217 NDalicPINVOKE.Application_SetViewMode(swigCPtr, (int)viewMode);
1218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1221 internal ViewMode GetViewMode()
1223 ViewMode ret = (ViewMode)NDalicPINVOKE.Application_GetViewMode(swigCPtr);
1224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1228 public void SetStereoBase(float stereoBase)
1230 NDalicPINVOKE.Application_SetStereoBase(swigCPtr, stereoBase);
1231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1234 public float GetStereoBase()
1236 float ret = NDalicPINVOKE.Application_GetStereoBase(swigCPtr);
1237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1241 public string GetLanguage()
1243 string ret = NDalicPINVOKE.Application_GetLanguage(swigCPtr);
1244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1248 public string GetRegion()
1250 string ret = NDalicPINVOKE.Application_GetRegion(swigCPtr);
1251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1256 internal ApplicationSignal InitSignal()
1258 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_InitSignal(swigCPtr), false);
1259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1263 internal ApplicationSignal TerminateSignal()
1265 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_TerminateSignal(swigCPtr), false);
1266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1270 internal ApplicationSignal PauseSignal()
1272 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_PauseSignal(swigCPtr), false);
1273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1277 internal ApplicationSignal ResumeSignal()
1279 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResumeSignal(swigCPtr), false);
1280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1284 internal ApplicationSignal ResetSignal()
1286 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResetSignal(swigCPtr), false);
1287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1291 internal ApplicationSignal ResizeSignal()
1293 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResizeSignal(swigCPtr), false);
1294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1298 internal ApplicationControlSignal AppControlSignal()
1300 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.Application_AppControlSignal(swigCPtr), false);
1301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1305 internal ApplicationSignal LanguageChangedSignal()
1307 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_LanguageChangedSignal(swigCPtr), false);
1308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1312 internal ApplicationSignal RegionChangedSignal()
1314 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_RegionChangedSignal(swigCPtr), false);
1315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1319 internal LowBatterySignalType BatteryLowSignal()
1321 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.Application_LowBatterySignal(swigCPtr), false);
1322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1326 internal LowMemorySignalType MemoryLowSignal()
1328 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.Application_LowMemorySignal(swigCPtr), false);
1329 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1333 /// <since_tizen> 3 </since_tizen>
1334 public enum WindowMode