2 * Copyright(c) 2022 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.
18 using System.Collections.Generic;
19 using System.Collections.ObjectModel;
20 using System.ComponentModel;
21 using System.Diagnostics;
22 using System.Runtime.InteropServices;
23 using Tizen.NUI.Binding;
28 * @brief Event arguments that passed via NUIApplicationInit signal
30 internal class NUIApplicationInitEventArgs : EventArgs
32 private Application application;
35 * @brief Application - is the application that is being initialized
37 public Application Application
51 * @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
59 public Application Application
73 * @brief Event arguments that passed via NUIApplicationPause signal
75 internal class NUIApplicationPausedEventArgs : EventArgs
77 private Application application;
79 * @brief Application - is the application that is being Paused
81 public Application Application
95 * @brief Event arguments that passed via NUIApplicationResume signal
97 internal class NUIApplicationResumedEventArgs : EventArgs
99 private Application application;
101 * @brief Application - is the application that is being Resumed
103 public Application Application
117 * @brief Event arguments that passed via NUIApplicationReset signal
119 internal class NUIApplicationResetEventArgs : EventArgs
121 private Application application;
123 * @brief Application - is the application that is being Reset
125 public Application Application
139 * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
141 internal class NUIApplicationLanguageChangedEventArgs : EventArgs
143 private Application application;
145 * @brief Application - is the application that is being affected with Device's language change
147 public Application Application
161 * @brief Event arguments that passed via NUIApplicationRegionChanged signal
163 internal class NUIApplicationRegionChangedEventArgs : EventArgs
165 private Application application;
167 * @brief Application - is the application that is being affected with Device's region change
169 public Application Application
183 * @brief Event arguments that passed via NUIApplicationBatteryLow signal
185 internal class NUIApplicationBatteryLowEventArgs : EventArgs
187 private Application.BatteryStatus status;
189 * @brief Application - is the application that is being affected when the battery level of the device is low
191 public Application.BatteryStatus BatteryStatus
205 * @brief Event arguments that passed via NUIApplicationMemoryLow signal
207 internal class NUIApplicationMemoryLowEventArgs : EventArgs
209 private Application.MemoryStatus status;
211 * @brief Application - is the application that is being affected when the memory level of the device is low
213 public Application.MemoryStatus MemoryStatus
227 * @brief Event arguments that passed via NUIApplicationAppControl signal
229 internal class NUIApplicationAppControlEventArgs : EventArgs
231 private Application application;
232 private IntPtr voidp;
234 * @brief Application - is the application that is receiving the launch request from another application
236 public Application Application
248 * @brief VoidP - contains the information about why the application is launched
264 /// A class to get resources in current application.
266 public sealed class GetResourcesProvider
269 /// Get resources in current application.
271 static public IResourcesProvider Get()
273 return Tizen.NUI.Application.Current;
277 internal class Application : BaseHandle, IResourcesProvider, IElementConfiguration<Application>
279 static Application s_current;
281 ReadOnlyCollection<Element> logicalChildren;
283 [EditorBrowsable(EditorBrowsableState.Never)]
284 public static void SetCurrentApplication(Application value) => Current = value;
286 public static Application Current
288 get { return s_current; }
291 if (s_current == value)
297 internal override ReadOnlyCollection<Element> LogicalChildrenInternal
299 get { return logicalChildren ?? (logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
302 internal IResourceDictionary SystemResources { get; }
304 ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>();
306 ResourceDictionary resources;
307 public bool IsResourcesCreated => resources != null;
309 public delegate void resChangeCb(object sender, ResourcesChangedEventArgs e);
311 internal override void OnResourcesChanged(object sender, ResourcesChangedEventArgs e)
313 base.OnResourcesChanged(sender, e);
316 public ResourceDictionary XamlResources
320 if (resources == null)
322 resources = new ResourceDictionary();
323 int hashCode = resources.GetHashCode();
324 ((IResourceDictionary)resources).ValuesChanged += OnResourcesChanged;
330 if (resources == value)
332 OnPropertyChanging();
334 if (resources != null)
335 ((IResourceDictionary)resources).ValuesChanged -= OnResourcesChanged;
337 OnResourcesChanged(value);
338 if (resources != null)
339 ((IResourceDictionary)resources).ValuesChanged += OnResourcesChanged;
345 protected override void OnParentSet()
347 throw new InvalidOperationException("Setting a Parent on Application is invalid.");
350 [EditorBrowsable(EditorBrowsableState.Never)]
351 public static bool IsApplicationOrNull(Element element)
353 return element == null || element is Application;
356 internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
361 if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0)
363 base.OnParentResourcesChanged(values);
367 var innerKeys = new HashSet<string>();
368 var changedResources = new List<KeyValuePair<string, object>>();
369 foreach (KeyValuePair<string, object> c in XamlResources)
370 innerKeys.Add(c.Key);
371 foreach (KeyValuePair<string, object> value in values)
373 if (innerKeys.Add(value.Key))
374 changedResources.Add(value);
376 if (changedResources.Count != 0)
377 OnResourcesChanged(changedResources);
380 internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
382 SetCurrentApplication(this);
386 protected override void Dispose(DisposeTypes type)
393 //Release your own unmanaged resources here.
394 //You should not access any managed member here except static instance.
395 //because the execution order of Finalizes is non-deterministic.
396 if (applicationInitEventCallbackDelegate != null)
398 initSignal?.Disconnect(applicationInitEventCallbackDelegate);
399 initSignal?.Dispose();
403 if (applicationTerminateEventCallbackDelegate != null)
405 terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
406 terminateSignal?.Dispose();
407 terminateSignal = null;
410 if (applicationPauseEventCallbackDelegate != null)
412 pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
413 pauseSignal?.Dispose();
417 if (applicationResumeEventCallbackDelegate != null)
419 resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
420 resumeSignal?.Dispose();
424 if (applicationResetEventCallbackDelegate != null)
426 resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
427 resetSignal?.Dispose();
431 if (applicationLanguageChangedEventCallbackDelegate != null)
433 languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
434 languageChangedSignal?.Dispose();
435 languageChangedSignal = null;
438 if (applicationRegionChangedEventCallbackDelegate != null)
440 regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
441 regionChangedSignal?.Dispose();
442 regionChangedSignal = null;
445 if (applicationBatteryLowEventCallbackDelegate != null)
447 batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
448 batteryLowSignal?.Dispose();
449 batteryLowSignal = null;
452 if (applicationMemoryLowEventCallbackDelegate != null)
454 memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
455 memoryLowSignal?.Dispose();
456 memoryLowSignal = null;
459 if (applicationAppControlEventCallbackDelegate != null)
461 appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
462 appControlSignal?.Dispose();
463 appControlSignal = null;
467 if (applicationTaskInitEventCallbackDelegate != null)
469 taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
470 taskInitSignal?.Dispose();
471 taskInitSignal = null;
474 if (applicationTaskTerminateEventCallbackDelegate != null)
476 taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
477 taskTerminateSignal?.Dispose();
478 taskTerminateSignal = null;
481 if (applicationTaskLanguageChangedEventCallbackDelegate != null)
483 taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
484 taskLanguageChangedSignal?.Dispose();
485 taskLanguageChangedSignal = null;
488 if (applicationTaskRegionChangedEventCallbackDelegate != null)
490 taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
491 taskRegionChangedSignal?.Dispose();
492 taskRegionChangedSignal = null;
495 if (applicationTaskBatteryLowEventCallbackDelegate != null)
497 taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
498 taskBatteryLowSignal?.Dispose();
499 taskBatteryLowSignal = null;
502 if (applicationTaskMemoryLowEventCallbackDelegate != null)
504 taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
505 taskMemoryLowSignal?.Dispose();
506 taskMemoryLowSignal = null;
509 if (applicationTaskAppControlEventCallbackDelegate != null)
511 taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
512 taskAppControlSignal?.Dispose();
513 taskAppControlSignal = null;
521 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
523 Interop.Application.DeleteApplication(swigCPtr);
526 public enum BatteryStatus
533 public enum MemoryStatus
540 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
541 private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
542 private DaliEventHandler<object, NUIApplicationInitEventArgs> applicationInitEventHandler;
543 private NUIApplicationInitEventCallbackDelegate applicationInitEventCallbackDelegate;
544 private ApplicationSignal initSignal;
546 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
547 private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
548 private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> applicationTerminateEventHandler;
549 private NUIApplicationTerminateEventCallbackDelegate applicationTerminateEventCallbackDelegate;
550 private ApplicationSignal terminateSignal;
552 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
553 private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
554 private DaliEventHandler<object, NUIApplicationPausedEventArgs> applicationPauseEventHandler;
555 private NUIApplicationPauseEventCallbackDelegate applicationPauseEventCallbackDelegate;
556 private ApplicationSignal pauseSignal;
558 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
559 private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
560 private DaliEventHandler<object, NUIApplicationResumedEventArgs> applicationResumeEventHandler;
561 private NUIApplicationResumeEventCallbackDelegate applicationResumeEventCallbackDelegate;
562 private ApplicationSignal resumeSignal;
564 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
565 private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
566 private DaliEventHandler<object, NUIApplicationResetEventArgs> applicationResetEventHandler;
567 private NUIApplicationResetEventCallbackDelegate applicationResetEventCallbackDelegate;
568 private ApplicationSignal resetSignal;
570 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
571 private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
572 private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> applicationLanguageChangedEventHandler;
573 private NUIApplicationLanguageChangedEventCallbackDelegate applicationLanguageChangedEventCallbackDelegate;
574 private ApplicationSignal languageChangedSignal;
577 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
578 private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
579 private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> applicationRegionChangedEventHandler;
580 private NUIApplicationRegionChangedEventCallbackDelegate applicationRegionChangedEventCallbackDelegate;
581 private ApplicationSignal regionChangedSignal;
583 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
584 private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status);
585 private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> applicationBatteryLowEventHandler;
586 private NUIApplicationBatteryLowEventCallbackDelegate applicationBatteryLowEventCallbackDelegate;
587 private LowBatterySignalType batteryLowSignal;
589 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
590 private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status);
591 private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> applicationMemoryLowEventHandler;
592 private NUIApplicationMemoryLowEventCallbackDelegate applicationMemoryLowEventCallbackDelegate;
593 private LowMemorySignalType memoryLowSignal;
595 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
596 private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
597 private DaliEventHandler<object, NUIApplicationAppControlEventArgs> applicationAppControlEventHandler;
598 private NUIApplicationAppControlEventCallbackDelegate applicationAppControlEventCallbackDelegate;
599 private ApplicationControlSignal appControlSignal;
601 private DaliEventHandler<object, NUIApplicationInitEventArgs> applicationTaskInitEventHandler;
602 private NUIApplicationInitEventCallbackDelegate applicationTaskInitEventCallbackDelegate;
603 private ApplicationSignal taskInitSignal;
605 private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> applicationTaskTerminateEventHandler;
606 private NUIApplicationTerminateEventCallbackDelegate applicationTaskTerminateEventCallbackDelegate;
607 private ApplicationSignal taskTerminateSignal;
609 private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> applicationTaskLanguageChangedEventHandler;
610 private NUIApplicationLanguageChangedEventCallbackDelegate applicationTaskLanguageChangedEventCallbackDelegate;
611 private ApplicationSignal taskLanguageChangedSignal;
613 private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> applicationTaskRegionChangedEventHandler;
614 private NUIApplicationRegionChangedEventCallbackDelegate applicationTaskRegionChangedEventCallbackDelegate;
615 private ApplicationSignal taskRegionChangedSignal;
617 private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> applicationTaskBatteryLowEventHandler;
618 private NUIApplicationBatteryLowEventCallbackDelegate applicationTaskBatteryLowEventCallbackDelegate;
619 private LowBatterySignalType taskBatteryLowSignal;
621 private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> applicationTaskMemoryLowEventHandler;
622 private NUIApplicationMemoryLowEventCallbackDelegate applicationTaskMemoryLowEventCallbackDelegate;
623 private LowMemorySignalType taskMemoryLowSignal;
625 private DaliEventHandler<object, NUIApplicationAppControlEventArgs> applicationTaskAppControlEventHandler;
626 private NUIApplicationAppControlEventCallbackDelegate applicationTaskAppControlEventCallbackDelegate;
627 private ApplicationControlSignal taskAppControlSignal;
629 private Window window;
632 * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
633 * provided by the user. Initialized signal is emitted when application is initialized
635 public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
639 // Restricted to only one listener
640 if (applicationInitEventHandler == null)
642 applicationInitEventHandler += value;
643 applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
644 initSignal = this.InitSignal();
645 initSignal?.Connect(applicationInitEventCallbackDelegate);
651 if (applicationInitEventHandler != null)
653 initSignal?.Disconnect(applicationInitEventCallbackDelegate);
654 initSignal?.Dispose();
658 applicationInitEventHandler -= value;
662 // Callback for Application InitSignal
663 private void OnApplicationInit(IntPtr data)
665 Log.Info("NUI", "[NUI] OnApplicationInit: DisposeQueue Initialize");
666 Tizen.Tracer.Begin("[NUI] OnApplicationInit: DisposeQueue Initialize");
667 // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
668 DisposeQueue.Instance.Initialize();
671 Log.Info("NUI", "[NUI] OnApplicationInit: GetWindow");
672 Tizen.Tracer.Begin("[NUI] OnApplicationInit: GetWindow");
673 Window.Instance = GetWindow();
675 _ = FocusManager.Instance;
679 Log.Info("NUI", "[NUI] OnApplicationInit: Window Show");
680 Tizen.Tracer.Begin("[NUI] OnApplicationInit: Window Show");
681 // Notify that the window is displayed to the app core.
682 if (NUIApplication.IsPreload)
684 Window.Instance.Show();
688 Log.Info("NUI", "[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
689 Tizen.Tracer.Begin("[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
690 if (applicationInitEventHandler != null)
692 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
693 e.Application = this;
694 applicationInitEventHandler.Invoke(this, e);
700 * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
701 * provided by the user. Terminated signal is emitted when application is terminating
703 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
707 // Restricted to only one listener
708 if (applicationTerminateEventHandler == null)
710 applicationTerminateEventHandler += value;
712 applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
713 terminateSignal = this.TerminateSignal();
714 terminateSignal?.Connect(applicationTerminateEventCallbackDelegate);
720 if (applicationTerminateEventHandler != null)
722 terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
723 terminateSignal?.Dispose();
724 terminateSignal = null;
727 applicationTerminateEventHandler -= value;
731 // Callback for Application TerminateSignal
732 private void OnNUIApplicationTerminate(IntPtr data)
734 if (applicationTerminateEventHandler != null)
736 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
737 e.Application = this;
738 applicationTerminateEventHandler.Invoke(this, e);
741 List<Window> windows = GetWindowList();
742 foreach (Window window in windows)
744 window?.DisconnectNativeSignals();
749 * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
750 * provided by the user. Paused signal is emitted when application is paused
752 public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
756 // Restricted to only one listener
757 if (applicationPauseEventHandler == null)
759 applicationPauseEventHandler += value;
761 applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
762 pauseSignal = this.PauseSignal();
763 pauseSignal?.Connect(applicationPauseEventCallbackDelegate);
769 if (applicationPauseEventHandler != null)
771 pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
772 pauseSignal?.Dispose();
776 applicationPauseEventHandler -= value;
780 // Callback for Application PauseSignal
781 private void OnNUIApplicationPause(IntPtr data)
783 if (applicationPauseEventHandler != null)
785 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
786 e.Application = this;
787 applicationPauseEventHandler.Invoke(this, e);
792 * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
793 * provided by the user. Resumed signal is emitted when application is resumed
795 public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
799 // Restricted to only one listener
800 if (applicationResumeEventHandler == null)
802 applicationResumeEventHandler += value;
804 applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
805 resumeSignal = this.ResumeSignal();
806 resumeSignal?.Connect(applicationResumeEventCallbackDelegate);
812 if (applicationResumeEventHandler != null)
814 resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
815 resumeSignal?.Dispose();
819 applicationResumeEventHandler -= value;
823 // Callback for Application ResumeSignal
824 private void OnNUIApplicationResume(IntPtr data)
826 if (applicationResumeEventHandler != null)
828 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
829 e.Application = this;
830 applicationResumeEventHandler.Invoke(this, e);
835 * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
836 * provided by the user. Reset signal is emitted when application is reset
838 public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
842 // Restricted to only one listener
843 if (applicationResetEventHandler == null)
845 applicationResetEventHandler += value;
847 applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
848 resetSignal = this.ResetSignal();
849 resetSignal?.Connect(applicationResetEventCallbackDelegate);
855 if (applicationResetEventHandler != null)
857 resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
858 resetSignal?.Dispose();
862 applicationResetEventHandler -= value;
866 // Callback for Application ResetSignal
867 private void OnNUIApplicationReset(IntPtr data)
869 if (applicationResetEventHandler != null)
871 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
872 e.Application = this;
873 applicationResetEventHandler.Invoke(this, e);
878 * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
879 * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
881 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
885 // Restricted to only one listener
886 if (applicationLanguageChangedEventHandler == null)
888 applicationLanguageChangedEventHandler += value;
890 applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
891 languageChangedSignal = this.LanguageChangedSignal();
892 languageChangedSignal?.Connect(applicationLanguageChangedEventCallbackDelegate);
898 if (applicationLanguageChangedEventHandler != null)
900 languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
901 languageChangedSignal?.Dispose();
902 languageChangedSignal = null;
905 applicationLanguageChangedEventHandler -= value;
909 // Callback for Application LanguageChangedSignal
910 private void OnNUIApplicationLanguageChanged(IntPtr data)
912 if (applicationLanguageChangedEventHandler != null)
914 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
915 e.Application = this;
916 applicationLanguageChangedEventHandler.Invoke(this, e);
921 * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
922 * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
924 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
928 // Restricted to only one listener
929 if (applicationRegionChangedEventHandler == null)
931 applicationRegionChangedEventHandler += value;
933 applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
934 regionChangedSignal = this.RegionChangedSignal();
935 regionChangedSignal?.Connect(applicationRegionChangedEventCallbackDelegate);
941 if (applicationRegionChangedEventHandler != null)
943 regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
944 regionChangedSignal?.Dispose();
945 regionChangedSignal = null;
948 applicationRegionChangedEventHandler -= value;
952 // Callback for Application RegionChangedSignal
953 private void OnNUIApplicationRegionChanged(IntPtr data)
955 if (applicationRegionChangedEventHandler != null)
957 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
958 e.Application = this;
959 applicationRegionChangedEventHandler.Invoke(this, e);
964 * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
965 * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
967 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
971 // Restricted to only one listener
972 if (applicationBatteryLowEventHandler == null)
974 applicationBatteryLowEventHandler += value;
976 applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
977 batteryLowSignal = this.BatteryLowSignal();
978 batteryLowSignal?.Connect(applicationBatteryLowEventCallbackDelegate);
984 if (applicationBatteryLowEventHandler != null)
986 batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
987 batteryLowSignal?.Dispose();
988 batteryLowSignal = null;
991 applicationBatteryLowEventHandler -= value;
995 // Callback for Application BatteryLowSignal
996 private void OnNUIApplicationBatteryLow(BatteryStatus status)
998 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1000 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1001 e.BatteryStatus = status;
1002 applicationBatteryLowEventHandler?.Invoke(this, e);
1006 * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
1007 * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
1009 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
1013 // Restricted to only one listener
1014 if (applicationMemoryLowEventHandler == null)
1016 applicationMemoryLowEventHandler += value;
1018 applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
1019 memoryLowSignal = this.MemoryLowSignal();
1020 memoryLowSignal?.Connect(applicationMemoryLowEventCallbackDelegate);
1026 if (applicationMemoryLowEventHandler != null)
1028 memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
1029 memoryLowSignal?.Dispose();
1030 memoryLowSignal = null;
1033 applicationMemoryLowEventHandler -= value;
1037 // Callback for Application MemoryLowSignal
1038 private void OnNUIApplicationMemoryLow(MemoryStatus status)
1040 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1042 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1043 e.MemoryStatus = status;
1044 applicationMemoryLowEventHandler?.Invoke(this, e);
1048 * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
1049 * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
1051 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
1055 // Restricted to only one listener
1056 if (applicationAppControlEventHandler == null)
1058 applicationAppControlEventHandler += value;
1060 applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1061 appControlSignal = this.AppControlSignal();
1062 appControlSignal?.Connect(applicationAppControlEventCallbackDelegate);
1068 if (applicationAppControlEventHandler != null)
1070 appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
1071 appControlSignal?.Dispose();
1072 appControlSignal = null;
1075 applicationAppControlEventHandler -= value;
1079 // Callback for Application AppControlSignal
1080 private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1082 if (applicationAppControlEventHandler != null)
1084 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1086 e.Application = this;
1087 applicationAppControlEventHandler.Invoke(this, e);
1092 /// @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
1093 /// provided by the user. Initialized signal is emitted when application is initialized
1095 public event DaliEventHandler<object, NUIApplicationInitEventArgs> TaskInitialized
1099 // Restricted to only one listener
1100 if (applicationTaskInitEventHandler == null)
1102 Tizen.Log.Fatal("NUI", "TaskInitialized Property adding");
1103 applicationTaskInitEventHandler += value;
1104 applicationTaskInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationTaskInit);
1105 taskInitSignal = this.TaskInitSignal();
1106 taskInitSignal?.Connect(applicationTaskInitEventCallbackDelegate);
1112 if (applicationTaskInitEventHandler != null)
1114 taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
1115 taskInitSignal?.Dispose();
1116 taskInitSignal = null;
1119 applicationTaskInitEventHandler -= value;
1123 private void OnApplicationTaskInit(IntPtr data)
1125 if (applicationTaskInitEventHandler != null)
1127 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
1128 e.Application = this;
1129 applicationTaskInitEventHandler.Invoke(this, e);
1135 /// @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
1136 /// provided by the user. Terminated signal is emitted when application is terminating
1138 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> TaskTerminating
1142 // Restricted to only one listener
1143 if (applicationTaskTerminateEventHandler == null)
1145 applicationTaskTerminateEventHandler += value;
1147 applicationTaskTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTaskTerminate);
1148 taskTerminateSignal = this.TaskTerminateSignal();
1149 taskTerminateSignal?.Connect(applicationTaskTerminateEventCallbackDelegate);
1155 if (applicationTaskTerminateEventHandler != null)
1157 taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
1158 taskTerminateSignal?.Dispose();
1159 taskTerminateSignal = null;
1162 applicationTaskTerminateEventHandler -= value;
1166 private void OnNUIApplicationTaskTerminate(IntPtr data)
1168 if (applicationTaskTerminateEventHandler != null)
1170 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
1171 e.Application = this;
1172 applicationTaskTerminateEventHandler.Invoke(this, e);
1177 /// @brief Event for TaskLanguageChanged signal which can be used to subscribe/unsubscribe the event handler
1178 /// provided by the user. TaskLanguageChanged signal is emitted when the region of the device is changed.
1180 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> TaskLanguageChanged
1184 // Restricted to only one listener
1185 if (applicationTaskLanguageChangedEventHandler == null)
1187 applicationTaskLanguageChangedEventHandler += value;
1189 applicationTaskLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationTaskLanguageChanged);
1190 taskLanguageChangedSignal = this.TaskLanguageChangedSignal();
1191 taskLanguageChangedSignal?.Connect(applicationTaskLanguageChangedEventCallbackDelegate);
1197 if (applicationTaskLanguageChangedEventHandler != null)
1199 taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
1200 taskLanguageChangedSignal?.Dispose();
1201 taskLanguageChangedSignal = null;
1204 applicationTaskLanguageChangedEventHandler -= value;
1208 private void OnNUIApplicationTaskLanguageChanged(IntPtr data)
1210 if (applicationTaskLanguageChangedEventHandler != null)
1212 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
1213 e.Application = this;
1214 applicationTaskLanguageChangedEventHandler.Invoke(this, e);
1219 /// @brief Event for TaskRegionChanged signal which can be used to subscribe/unsubscribe the event handler
1220 /// provided by the user. TaskRegionChanged signal is emitted when the region of the device is changed.
1222 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> TaskRegionChanged
1226 // Restricted to only one listener
1227 if (applicationTaskRegionChangedEventHandler == null)
1229 applicationTaskRegionChangedEventHandler += value;
1231 applicationTaskRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationTaskRegionChanged);
1232 taskRegionChangedSignal = this.TaskRegionChangedSignal();
1233 taskRegionChangedSignal?.Connect(applicationTaskRegionChangedEventCallbackDelegate);
1239 if (applicationTaskRegionChangedEventHandler != null)
1241 taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
1242 taskRegionChangedSignal?.Dispose();
1243 taskRegionChangedSignal = null;
1246 applicationTaskRegionChangedEventHandler -= value;
1250 private void OnNUIApplicationTaskRegionChanged(IntPtr data)
1252 if (applicationTaskRegionChangedEventHandler != null)
1254 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
1255 e.Application = this;
1256 applicationTaskRegionChangedEventHandler.Invoke(this, e);
1261 /// @brief Event for TaskBatteryLow signal which can be used to subscribe/unsubscribe the event handler
1262 /// provided by the user. TaskBatteryLow signal is emitted when the battery level of the device is low.
1264 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> TaskBatteryLow
1268 // Restricted to only one listener
1269 if (applicationTaskBatteryLowEventHandler == null)
1271 applicationTaskBatteryLowEventHandler += value;
1273 applicationTaskBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationTaskBatteryLow);
1274 taskBatteryLowSignal = this.TaskBatteryLowSignal();
1275 taskBatteryLowSignal?.Connect(applicationTaskBatteryLowEventCallbackDelegate);
1281 if (applicationTaskBatteryLowEventHandler != null)
1283 taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
1284 taskBatteryLowSignal?.Dispose();
1285 taskBatteryLowSignal = null;
1288 applicationTaskBatteryLowEventHandler -= value;
1292 private void OnNUIApplicationTaskBatteryLow(BatteryStatus status)
1294 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1296 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1297 e.BatteryStatus = status;
1298 applicationTaskBatteryLowEventHandler?.Invoke(this, e);
1302 /// @brief Event for TaskMemoryLow signal which can be used to subscribe/unsubscribe the event handler
1303 /// provided by the user. TaskMemoryLow signal is emitted when the memory level of the device is low.
1305 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> TaskMemoryLow
1309 // Restricted to only one listener
1310 if (applicationTaskMemoryLowEventHandler == null)
1312 applicationTaskMemoryLowEventHandler += value;
1314 applicationTaskMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationTaskMemoryLow);
1315 taskMemoryLowSignal = this.TaskMemoryLowSignal();
1316 taskMemoryLowSignal?.Connect(applicationTaskMemoryLowEventCallbackDelegate);
1322 if (applicationTaskMemoryLowEventHandler != null)
1324 taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
1325 taskMemoryLowSignal?.Dispose();
1326 taskMemoryLowSignal = null;
1329 applicationTaskMemoryLowEventHandler -= value;
1333 private void OnNUIApplicationTaskMemoryLow(MemoryStatus status)
1335 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1337 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1338 e.MemoryStatus = status;
1339 applicationTaskMemoryLowEventHandler?.Invoke(this, e);
1343 /// @brief Event for TaskAppControl signal which can be used to subscribe/unsubscribe the event handler
1344 /// provided by the user. TaskAppControl signal is emitted when another application sends a launch request to the application.
1346 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> TaskAppControl
1350 // Restricted to only one listener
1351 if (applicationTaskAppControlEventHandler == null)
1353 applicationTaskAppControlEventHandler += value;
1355 applicationTaskAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationTaskAppControl);
1356 taskAppControlSignal = this.TaskAppControlSignal();
1357 taskAppControlSignal?.Connect(applicationTaskAppControlEventCallbackDelegate);
1363 if (applicationTaskAppControlEventHandler != null)
1365 taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
1366 taskAppControlSignal?.Dispose();
1367 taskAppControlSignal = null;
1370 applicationTaskAppControlEventHandler -= value;
1374 private void OnNUIApplicationTaskAppControl(IntPtr application, IntPtr voidp)
1376 if (applicationTaskAppControlEventHandler != null)
1378 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1380 e.Application = this;
1381 applicationTaskAppControlEventHandler.Invoke(this, e);
1385 protected static Application instance; // singleton
1387 public static Application Instance
1395 public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1397 if (cPtr == global::System.IntPtr.Zero)
1402 Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1403 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1407 public static Application NewApplication()
1409 return NewApplication("", NUIApplication.WindowMode.Opaque);
1412 public static Application NewApplication(string stylesheet)
1414 return NewApplication(stylesheet, NUIApplication.WindowMode.Opaque);
1417 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode)
1419 // register all Views with the type registry, so that can be created / styled via JSON
1420 //ViewRegistryHelper.Initialize(); //moved to Application side.
1421 if (instance != null)
1426 Application ret = New(1, stylesheet, windowMode);
1427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1429 // set the singleton
1434 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1436 if (instance != null)
1440 Application ret = New(1, stylesheet, windowMode, positionSize);
1441 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1443 // set the singleton
1448 public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1450 if (instance != null)
1454 Application ret = New(args, stylesheet, windowMode);
1455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1457 // set the singleton
1462 public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1464 if (instance != null)
1468 Application ret = New(args, stylesheet, windowMode, positionSize);
1469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1471 // set the singleton
1476 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1478 if (instance != null)
1482 Application ret = New(1, stylesheet, windowMode, type);
1483 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1489 public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1491 if (instance != null)
1495 Application ret = New(args, stylesheet, windowMode, positionSize, useUIThread);
1496 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1503 /// Ensures that the function passed in is called from the main loop when it is idle.
1505 /// <param name="func">The function to call</param>
1506 /// <returns>true if added successfully, false otherwise</returns>
1508 /// It will return false when one of the following conditions is met.
1509 /// 1) the <see cref="Window"/> is hidden.
1510 /// 2) the <see cref="Window"/> is iconified.
1512 public bool AddIdle(System.Delegate func)
1514 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1515 System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1517 bool ret = Interop.Application.AddIdle(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1524 * Outer::outer_method(int)
1526 public static Application New()
1528 Application ret = new Application(Interop.Application.New(), true);
1529 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1533 public static Application New(int argc)
1535 Application ret = new Application(Interop.Application.New(argc), true);
1536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1540 public static Application New(int argc, string stylesheet)
1542 Application ret = new Application(Interop.Application.New(argc, stylesheet), true);
1543 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1547 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode)
1549 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
1550 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1555 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1557 Application ret = null;
1559 string argvStr = "";
1563 argvStr = string.Join(" ", args);
1565 catch (Exception exception)
1567 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1568 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1569 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1573 ret = new Application(NDalicPINVOKE.ApplicationNewManual4(argc, argvStr, stylesheet, (int)windowMode), true);
1574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1579 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1581 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1582 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1586 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1588 Application ret = null;
1590 string argvStr = "";
1594 argvStr = string.Join(" ", args);
1596 catch (Exception exception)
1598 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1599 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1600 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1604 ret = new Application(NDalicPINVOKE.ApplicationNewWithWindowSizePosition(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1605 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1610 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1612 // It will be removed until dali APIs are prepared.
1613 Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
1615 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
1616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1620 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1622 Application ret = null;
1624 string argvStr = "";
1628 argvStr = string.Join(" ", args);
1630 ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize), useUIThread), true);
1631 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1633 catch (Exception exception)
1635 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1636 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1637 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1644 public Application() : this(Interop.Application.NewApplication(), true)
1646 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1649 public Application(Application application) : this(Interop.Application.NewApplication(Application.getCPtr(application)), true)
1651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1654 public Application Assign(Application application)
1656 Application ret = new Application(Interop.Application.Assign(SwigCPtr, Application.getCPtr(application)), false);
1657 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1661 public void MainLoop()
1663 NDalicPINVOKE.ApplicationMainLoop(SwigCPtr);
1664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1669 Interop.Application.Lower(SwigCPtr);
1670 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1675 Interop.Application.Quit(SwigCPtr);
1676 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1679 internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1681 bool ret = Interop.Application.AddIdle(SwigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1682 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1686 public Window GetWindow()
1693 var nativeWindow = Interop.Application.GetWindow(SwigCPtr);
1694 window = Registry.GetManagedBaseHandleFromNativePtr(nativeWindow) as Window;
1697 HandleRef CPtr = new HandleRef(this, nativeWindow);
1698 Interop.BaseHandle.DeleteBaseHandle(CPtr);
1699 CPtr = new HandleRef(null, IntPtr.Zero);
1703 window = new Window(nativeWindow, true);
1706 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1710 public static string GetResourcePath()
1712 string ret = Interop.Application.GetResourcePath();
1713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1717 public string GetLanguage()
1719 string ret = Interop.Application.GetLanguage(SwigCPtr);
1720 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1724 public string GetRegion()
1726 string ret = Interop.Application.GetRegion(SwigCPtr);
1727 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1731 [EditorBrowsable(EditorBrowsableState.Never)]
1732 public static List<Window> GetWindowList()
1734 uint ListSize = Interop.Application.GetWindowsListSize();
1735 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1737 List<Window> WindowList = new List<Window>();
1738 for (uint i = 0; i < ListSize; ++i)
1740 Window currWin = WindowList.GetInstanceSafely<Window>(Interop.Application.GetWindowsFromList(i));
1741 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1742 if (currWin != null)
1744 WindowList.Add(currWin);
1750 internal ApplicationSignal InitSignal()
1752 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationInitSignal(SwigCPtr), false);
1753 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1757 internal ApplicationSignal TerminateSignal()
1759 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTerminateSignal(SwigCPtr), false);
1760 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1764 internal ApplicationSignal PauseSignal()
1766 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationPauseSignal(SwigCPtr), false);
1767 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1771 internal ApplicationSignal ResumeSignal()
1773 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResumeSignal(SwigCPtr), false);
1774 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1778 internal ApplicationSignal ResetSignal()
1780 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResetSignal(SwigCPtr), false);
1781 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1785 internal ApplicationControlSignal AppControlSignal()
1787 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationAppControlSignal(SwigCPtr), false);
1788 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1792 internal ApplicationSignal LanguageChangedSignal()
1794 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationLanguageChangedSignal(SwigCPtr), false);
1795 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1799 internal ApplicationSignal RegionChangedSignal()
1801 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationRegionChangedSignal(SwigCPtr), false);
1802 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1806 internal LowBatterySignalType BatteryLowSignal()
1808 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationLowBatterySignal(SwigCPtr), false);
1809 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1813 internal LowMemorySignalType MemoryLowSignal()
1815 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationLowMemorySignal(SwigCPtr), false);
1816 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1821 internal ApplicationSignal TaskInitSignal()
1823 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskInitSignal(SwigCPtr), false);
1824 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1828 internal ApplicationSignal TaskTerminateSignal()
1830 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskTerminateSignal(SwigCPtr), false);
1831 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1835 internal ApplicationControlSignal TaskAppControlSignal()
1837 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationTaskAppControlSignal(SwigCPtr), false);
1838 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1842 internal ApplicationSignal TaskLanguageChangedSignal()
1844 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskLanguageChangedSignal(SwigCPtr), false);
1845 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1849 internal ApplicationSignal TaskRegionChangedSignal()
1851 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskRegionChangedSignal(SwigCPtr), false);
1852 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1856 internal LowBatterySignalType TaskBatteryLowSignal()
1858 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationTaskLowBatterySignal(SwigCPtr), false);
1859 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1863 internal LowMemorySignalType TaskMemoryLowSignal()
1865 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationTaskLowMemorySignal(SwigCPtr), false);
1866 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();