2 * Copyright(c) 2018 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.Collections.Generic;
23 using System.Collections.ObjectModel;
24 using System.ComponentModel;
25 using System.Runtime.InteropServices;
26 using System.Threading;
27 using System.Threading.Tasks;
30 * @brief Event arguments that passed via NUIApplicationInit signal
33 internal class NUIApplicationInitEventArgs : EventArgs
35 private Application _application;
38 * @brief Application - is the application that is being initialized
41 public Application Application
55 * @brief Event arguments that passed via NUIApplicationTerminate signal
58 internal class NUIApplicationTerminatingEventArgs : EventArgs
60 private Application _application;
62 * @brief Application - is the application that is being Terminated
65 public Application Application
79 * @brief Event arguments that passed via NUIApplicationPause signal
82 internal class NUIApplicationPausedEventArgs : EventArgs
84 private Application _application;
86 * @brief Application - is the application that is being Paused
89 public Application Application
103 * @brief Event arguments that passed via NUIApplicationResume signal
106 internal class NUIApplicationResumedEventArgs : EventArgs
108 private Application _application;
110 * @brief Application - is the application that is being Resumed
113 public Application Application
121 _application = value;
127 * @brief Event arguments that passed via NUIApplicationReset signal
130 internal class NUIApplicationResetEventArgs : EventArgs
132 private Application _application;
134 * @brief Application - is the application that is being Reset
137 public Application Application
145 _application = value;
151 * @brief Event arguments that passed via NUIApplicationResize signal
154 internal class NUIApplicationResizedEventArgs : EventArgs
156 private Application _application;
158 * @brief Application - is the application that is being Resized
161 public Application Application
169 _application = value;
175 * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
178 internal class NUIApplicationLanguageChangedEventArgs : EventArgs
180 private Application _application;
182 * @brief Application - is the application that is being affected with Device's language change
185 public Application Application
193 _application = value;
199 * @brief Event arguments that passed via NUIApplicationRegionChanged signal
202 internal class NUIApplicationRegionChangedEventArgs : EventArgs
204 private Application _application;
206 * @brief Application - is the application that is being affected with Device's region change
209 public Application Application
217 _application = value;
223 * @brief Event arguments that passed via NUIApplicationBatteryLow signal
226 internal class NUIApplicationBatteryLowEventArgs : EventArgs
228 private Application.BatteryStatus _status;
230 * @brief Application - is the application that is being affected when the battery level of the device is low
233 public Application.BatteryStatus BatteryStatus
247 * @brief Event arguments that passed via NUIApplicationMemoryLow signal
250 internal class NUIApplicationMemoryLowEventArgs : EventArgs
252 private Application.MemoryStatus _status;
254 * @brief Application - is the application that is being affected when the memory level of the device is low
257 public Application.MemoryStatus MemoryStatus
271 * @brief Event arguments that passed via NUIApplicationAppControl signal
274 internal class NUIApplicationAppControlEventArgs : EventArgs
276 private Application _application;
277 private IntPtr _voidp;
279 * @brief Application - is the application that is receiving the launch request from another application
282 public Application Application
290 _application = value;
294 * @brief VoidP - contains the information about why the application is launched
310 internal class Application : BaseHandle
312 static SemaphoreSlim SaveSemaphore = new SemaphoreSlim(1, 1);
314 [EditorBrowsable(EditorBrowsableState.Never)]
315 public int PanGestureId { get; set; }
317 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
319 internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Application_SWIGUpcast(cPtr), cMemoryOwn)
321 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
324 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj)
326 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
329 protected override void Dispose(DisposeTypes type)
336 if (type == DisposeTypes.Explicit)
339 //Release your own managed resources here.
340 //You should release all of your own disposable objects here.
344 //Release your own unmanaged resources here.
345 //You should not access any managed member here except static instance.
346 //because the execution order of Finalizes is non-deterministic.
348 if (_applicationInitEventCallbackDelegate != null)
350 this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
353 if (_applicationTerminateEventCallbackDelegate != null)
355 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
358 if (_applicationPauseEventCallbackDelegate != null)
360 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
363 if (_applicationResumeEventCallbackDelegate != null)
365 this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
368 if (_applicationResetEventCallbackDelegate != null)
370 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
373 if (_applicationResizeEventCallbackDelegate != null)
375 this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
378 if (_applicationLanguageChangedEventCallbackDelegate != null)
380 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
383 if (_applicationRegionChangedEventCallbackDelegate != null)
385 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
388 if (_applicationBatteryLowEventCallbackDelegate != null)
390 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
393 if (_applicationMemoryLowEventCallbackDelegate != null)
395 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
398 if (_applicationAppControlEventCallbackDelegate != null)
400 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
403 if (swigCPtr.Handle != global::System.IntPtr.Zero)
408 Interop.Application.delete_Application(swigCPtr);
410 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
416 /// <since_tizen> 4 </since_tizen>
417 public enum BatteryStatus
424 /// <since_tizen> 4 </since_tizen>
425 public enum MemoryStatus
432 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
433 private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
434 private DaliEventHandler<object, NUIApplicationInitEventArgs> _applicationInitEventHandler;
435 private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
438 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
439 private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
440 private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> _applicationTerminateEventHandler;
441 private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
444 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
445 private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
446 private DaliEventHandler<object, NUIApplicationPausedEventArgs> _applicationPauseEventHandler;
447 private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
449 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
450 private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
451 private DaliEventHandler<object, NUIApplicationResumedEventArgs> _applicationResumeEventHandler;
452 private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
454 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
455 private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
456 private DaliEventHandler<object, NUIApplicationResetEventArgs> _applicationResetEventHandler;
457 private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
459 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
460 private delegate void NUIApplicationResizeEventCallbackDelegate(IntPtr application);
461 private DaliEventHandler<object, NUIApplicationResizedEventArgs> _applicationResizeEventHandler;
462 private NUIApplicationResizeEventCallbackDelegate _applicationResizeEventCallbackDelegate;
464 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
465 private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
466 private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
467 private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
470 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
471 private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
472 private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
473 private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
475 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
476 private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status);
477 private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
478 private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
480 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
481 private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status);
482 private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
483 private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
485 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
486 private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
487 private DaliEventHandler<object, NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
488 private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
491 * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
492 * provided by the user. Initialized signal is emitted when application is initialised
494 public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
500 // Restricted to only one listener
501 if (_applicationInitEventHandler == null)
503 _applicationInitEventHandler += value;
505 _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
506 this.InitSignal().Connect(_applicationInitEventCallbackDelegate);
515 if (_applicationInitEventHandler != null)
517 this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
520 _applicationInitEventHandler -= value;
525 // Callback for Application InitSignal
526 private void OnApplicationInit(IntPtr data)
528 // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
529 DisposeQueue.Instance.Initialize();
531 if (_applicationInitEventHandler != null)
533 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
534 e.Application = this;
535 _applicationInitEventHandler.Invoke(this, e);
541 * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
542 * provided by the user. Terminated signal is emitted when application is terminating
544 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
550 // Restricted to only one listener
551 if (_applicationTerminateEventHandler == null)
553 _applicationTerminateEventHandler += value;
555 _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
556 this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
565 if (_applicationTerminateEventHandler != null)
567 this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
570 _applicationTerminateEventHandler -= value;
575 // Callback for Application TerminateSignal
576 private void OnNUIApplicationTerminate(IntPtr data)
578 if (_applicationTerminateEventHandler != null)
580 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
581 e.Application = this;
582 _applicationTerminateEventHandler.Invoke(this, e);
586 Window.Instance.DisconnectNativeSignals();
591 * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
592 * provided by the user. Paused signal is emitted when application is paused
594 public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
600 // Restricted to only one listener
601 if (_applicationPauseEventHandler == null)
603 _applicationPauseEventHandler += value;
605 _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
606 this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
615 if (_applicationPauseEventHandler != null)
617 this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
620 _applicationPauseEventHandler -= value;
625 // Callback for Application PauseSignal
626 private void OnNUIApplicationPause(IntPtr data)
628 if (_applicationPauseEventHandler != null)
630 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
631 e.Application = this;
632 _applicationPauseEventHandler.Invoke(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 if (_applicationResumeEventHandler != null)
676 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
677 e.Application = this;
678 _applicationResumeEventHandler.Invoke(this, e);
683 * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
684 * provided by the user. Reset signal is emitted when application is reset
686 public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
692 // Restricted to only one listener
693 if (_applicationResetEventHandler == null)
695 _applicationResetEventHandler += value;
697 _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
698 this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
707 if (_applicationResetEventHandler != null)
709 this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
712 _applicationResetEventHandler -= value;
717 // Callback for Application ResetSignal
718 private void OnNUIApplicationReset(IntPtr data)
720 if (_applicationResetEventHandler != null)
722 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
723 e.Application = this;
724 _applicationResetEventHandler.Invoke(this, e);
729 * @brief Event for Resized signal which can be used to subscribe/unsubscribe the event handler
730 * provided by the user. Resized signal is emitted when application is resized
732 public event DaliEventHandler<object, NUIApplicationResizedEventArgs> Resized
738 // Restricted to only one listener
739 if (_applicationResizeEventHandler == null)
741 _applicationResizeEventHandler += value;
743 _applicationResizeEventCallbackDelegate = new NUIApplicationResizeEventCallbackDelegate(OnNUIApplicationResize);
744 this.ResizeSignal().Connect(_applicationResizeEventCallbackDelegate);
753 if (_applicationResizeEventHandler != null)
755 this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
758 _applicationResizeEventHandler -= value;
763 // Callback for Application ResizeSignal
764 private void OnNUIApplicationResize(IntPtr data)
766 if (_applicationResizeEventHandler != null)
768 NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs();
769 e.Application = this;
770 _applicationResizeEventHandler.Invoke(this, e);
775 * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
776 * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
778 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
784 // Restricted to only one listener
785 if (_applicationLanguageChangedEventHandler == null)
787 _applicationLanguageChangedEventHandler += value;
789 _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
790 this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
799 if (_applicationLanguageChangedEventHandler != null)
801 this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
804 _applicationLanguageChangedEventHandler -= value;
809 // Callback for Application LanguageChangedSignal
810 private void OnNUIApplicationLanguageChanged(IntPtr data)
812 if (_applicationLanguageChangedEventHandler != null)
814 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
815 e.Application = this;
816 _applicationLanguageChangedEventHandler.Invoke(this, e);
821 * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
822 * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
824 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
830 // Restricted to only one listener
831 if (_applicationRegionChangedEventHandler == null)
833 _applicationRegionChangedEventHandler += value;
835 _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
836 this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
845 if (_applicationRegionChangedEventHandler != null)
847 this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
850 _applicationRegionChangedEventHandler -= value;
855 // Callback for Application RegionChangedSignal
856 private void OnNUIApplicationRegionChanged(IntPtr data)
858 if (_applicationRegionChangedEventHandler != null)
860 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
861 e.Application = this;
862 _applicationRegionChangedEventHandler.Invoke(this, e);
867 * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
868 * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
870 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
876 // Restricted to only one listener
877 if (_applicationBatteryLowEventHandler == null)
879 _applicationBatteryLowEventHandler += value;
881 _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
882 this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
891 if (_applicationBatteryLowEventHandler != null)
893 this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
896 _applicationBatteryLowEventHandler -= value;
901 // Callback for Application BatteryLowSignal
902 private void OnNUIApplicationBatteryLow(BatteryStatus status)
906 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
908 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
909 e.BatteryStatus = status;
910 _applicationBatteryLowEventHandler?.Invoke(this, e);
915 * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
916 * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
918 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
924 // Restricted to only one listener
925 if (_applicationMemoryLowEventHandler == null)
927 _applicationMemoryLowEventHandler += value;
929 _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
930 this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
939 if (_applicationMemoryLowEventHandler != null)
941 this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
944 _applicationMemoryLowEventHandler -= value;
949 // Callback for Application MemoryLowSignal
950 private void OnNUIApplicationMemoryLow(MemoryStatus status)
954 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
956 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
957 e.MemoryStatus = status;
958 _applicationMemoryLowEventHandler?.Invoke(this, e);
963 * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
964 * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
966 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
972 // Restricted to only one listener
973 if (_applicationAppControlEventHandler == null)
975 _applicationAppControlEventHandler += value;
977 _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
978 this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
987 if (_applicationAppControlEventHandler != null)
989 this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
992 _applicationAppControlEventHandler -= value;
997 // Callback for Application AppControlSignal
998 private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1000 if (_applicationAppControlEventHandler != null)
1002 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1004 e.Application = this;
1005 _applicationAppControlEventHandler.Invoke(this, e);
1009 private static Application _instance; // singleton
1011 public static Application Instance
1019 public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1021 if (cPtr == global::System.IntPtr.Zero)
1026 Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1027 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1031 public static Application NewApplication()
1033 return NewApplication("", Application.WindowMode.Opaque);
1036 public static Application NewApplication(string stylesheet)
1038 return NewApplication(stylesheet, Application.WindowMode.Opaque);
1041 public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
1043 // register all Views with the type registry, so that can be created / styled via JSON
1044 //ViewRegistryHelper.Initialize(); //moved to Application side.
1046 Application ret = New(1, stylesheet, windowMode);
1047 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1049 // set the singleton
1055 public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
1057 Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
1058 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1060 // set the singleton
1066 /// Ensures that the function passed in is called from the main loop when it is idle.
1068 /// <param name="func">The function to call</param>
1069 /// <returns>true if added successfully, false otherwise</returns>
1070 public bool AddIdle(System.Delegate func)
1072 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1073 System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1075 bool ret = Interop.Application.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1077 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1082 * Outer::outer_method(int)
1084 public static Application New()
1086 Application ret = new Application(Interop.Application.Application_New__SWIG_0(), true);
1087 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1091 public static Application New(int argc)
1093 Application ret = new Application(Interop.Application.Application_New__SWIG_1(argc), true);
1094 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1098 public static Application New(int argc, string stylesheet)
1100 Application ret = new Application(Interop.Application.Application_New__SWIG_2(argc, stylesheet), true);
1101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
1107 Application ret = new Application(Interop.Application.Application_New__SWIG_3(argc, stylesheet, (int)windowMode), true);
1108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1112 public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode)
1114 int argc = args.Length;
1115 string argvStr = string.Join(" ", args);
1117 Application ret = new Application(NDalicPINVOKE.Application_New__MANUAL_4(argc, argvStr, stylesheet, (int)windowMode), true);
1119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1124 public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
1126 Application ret = new Application(Interop.Application.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1131 public Application() : this(Interop.Application.new_Application__SWIG_0(), true)
1133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1136 public Application(Application application) : this(Interop.Application.new_Application__SWIG_1(Application.getCPtr(application)), true)
1138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1141 public Application Assign(Application application)
1143 Application ret = new Application(Interop.Application.Application_Assign(swigCPtr, Application.getCPtr(application)), false);
1144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1148 public void MainLoop()
1150 NDalicPINVOKE.Application_MainLoop__SWIG_0(swigCPtr);
1151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1154 internal void MainLoop(SWIGTYPE_p_Configuration__ContextLoss configuration)
1156 Interop.Application.Application_MainLoop__SWIG_1(swigCPtr, SWIGTYPE_p_Configuration__ContextLoss.getCPtr(configuration));
1157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1162 Interop.Application.Application_Lower(swigCPtr);
1163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1168 Interop.Application.Application_Quit(swigCPtr);
1169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1172 internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1174 bool ret = Interop.Application.Application_AddIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1179 public Window GetWindow()
1181 Window ret = new Window(Interop.Application.Application_GetWindow(swigCPtr), true);
1182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1186 public void ReplaceWindow(Rectangle windowPosition, string name)
1188 Interop.Application.Application_ReplaceWindow(swigCPtr, Rectangle.getCPtr(windowPosition), name);
1189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1192 public static string GetResourcePath()
1194 string ret = Interop.Application.Application_GetResourcePath();
1195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1199 public string GetLanguage()
1201 string ret = Interop.Application.Application_GetLanguage(swigCPtr);
1202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1206 public string GetRegion()
1208 string ret = Interop.Application.Application_GetRegion(swigCPtr);
1209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1214 internal ApplicationSignal InitSignal()
1216 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_InitSignal(swigCPtr), false);
1217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1221 internal ApplicationSignal TerminateSignal()
1223 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_TerminateSignal(swigCPtr), false);
1224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1228 internal ApplicationSignal PauseSignal()
1230 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_PauseSignal(swigCPtr), false);
1231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1235 internal ApplicationSignal ResumeSignal()
1237 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResumeSignal(swigCPtr), false);
1238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1242 internal ApplicationSignal ResetSignal()
1244 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResetSignal(swigCPtr), false);
1245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1249 internal ApplicationSignal ResizeSignal()
1251 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_ResizeSignal(swigCPtr), false);
1252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1256 internal ApplicationControlSignal AppControlSignal()
1258 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.Application_AppControlSignal(swigCPtr), false);
1259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1263 internal ApplicationSignal LanguageChangedSignal()
1265 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_LanguageChangedSignal(swigCPtr), false);
1266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1270 internal ApplicationSignal RegionChangedSignal()
1272 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_RegionChangedSignal(swigCPtr), false);
1273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1277 internal LowBatterySignalType BatteryLowSignal()
1279 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.Application_LowBatterySignal(swigCPtr), false);
1280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1284 internal LowMemorySignalType MemoryLowSignal()
1286 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.Application_LowMemorySignal(swigCPtr), false);
1287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1291 /// <since_tizen> 3 </since_tizen>
1292 public enum WindowMode