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 //tv profile never use default focus indicator, so this is not needed!
676 _ = FocusManager.Instance;
680 Log.Info("NUI", "[NUI] OnApplicationInit: Window Show");
681 Tizen.Tracer.Begin("[NUI] OnApplicationInit: Window Show");
682 // Notify that the window is displayed to the app core.
683 if (NUIApplication.IsPreload)
685 Window.Instance.Show();
689 Log.Info("NUI", "[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
690 Tizen.Tracer.Begin("[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
691 if (applicationInitEventHandler != null)
693 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
694 e.Application = this;
695 applicationInitEventHandler.Invoke(this, e);
701 * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
702 * provided by the user. Terminated signal is emitted when application is terminating
704 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
708 // Restricted to only one listener
709 if (applicationTerminateEventHandler == null)
711 applicationTerminateEventHandler += value;
713 applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
714 terminateSignal = this.TerminateSignal();
715 terminateSignal?.Connect(applicationTerminateEventCallbackDelegate);
721 if (applicationTerminateEventHandler != null)
723 terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
724 terminateSignal?.Dispose();
725 terminateSignal = null;
728 applicationTerminateEventHandler -= value;
732 // Callback for Application TerminateSignal
733 private void OnNUIApplicationTerminate(IntPtr data)
735 if (applicationTerminateEventHandler != null)
737 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
738 e.Application = this;
739 applicationTerminateEventHandler.Invoke(this, e);
742 List<Window> windows = GetWindowList();
743 foreach (Window window in windows)
745 window?.DisconnectNativeSignals();
750 * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
751 * provided by the user. Paused signal is emitted when application is paused
753 public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
757 // Restricted to only one listener
758 if (applicationPauseEventHandler == null)
760 applicationPauseEventHandler += value;
762 applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
763 pauseSignal = this.PauseSignal();
764 pauseSignal?.Connect(applicationPauseEventCallbackDelegate);
770 if (applicationPauseEventHandler != null)
772 pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
773 pauseSignal?.Dispose();
777 applicationPauseEventHandler -= value;
781 // Callback for Application PauseSignal
782 private void OnNUIApplicationPause(IntPtr data)
784 if (applicationPauseEventHandler != null)
786 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
787 e.Application = this;
788 applicationPauseEventHandler.Invoke(this, e);
793 * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
794 * provided by the user. Resumed signal is emitted when application is resumed
796 public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
800 // Restricted to only one listener
801 if (applicationResumeEventHandler == null)
803 applicationResumeEventHandler += value;
805 applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
806 resumeSignal = this.ResumeSignal();
807 resumeSignal?.Connect(applicationResumeEventCallbackDelegate);
813 if (applicationResumeEventHandler != null)
815 resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
816 resumeSignal?.Dispose();
820 applicationResumeEventHandler -= value;
824 // Callback for Application ResumeSignal
825 private void OnNUIApplicationResume(IntPtr data)
827 if (applicationResumeEventHandler != null)
829 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
830 e.Application = this;
831 applicationResumeEventHandler.Invoke(this, e);
836 * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
837 * provided by the user. Reset signal is emitted when application is reset
839 public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
843 // Restricted to only one listener
844 if (applicationResetEventHandler == null)
846 applicationResetEventHandler += value;
848 applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
849 resetSignal = this.ResetSignal();
850 resetSignal?.Connect(applicationResetEventCallbackDelegate);
856 if (applicationResetEventHandler != null)
858 resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
859 resetSignal?.Dispose();
863 applicationResetEventHandler -= value;
867 // Callback for Application ResetSignal
868 private void OnNUIApplicationReset(IntPtr data)
870 if (applicationResetEventHandler != null)
872 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
873 e.Application = this;
874 applicationResetEventHandler.Invoke(this, e);
879 * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
880 * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
882 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
886 // Restricted to only one listener
887 if (applicationLanguageChangedEventHandler == null)
889 applicationLanguageChangedEventHandler += value;
891 applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
892 languageChangedSignal = this.LanguageChangedSignal();
893 languageChangedSignal?.Connect(applicationLanguageChangedEventCallbackDelegate);
899 if (applicationLanguageChangedEventHandler != null)
901 languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
902 languageChangedSignal?.Dispose();
903 languageChangedSignal = null;
906 applicationLanguageChangedEventHandler -= value;
910 // Callback for Application LanguageChangedSignal
911 private void OnNUIApplicationLanguageChanged(IntPtr data)
913 if (applicationLanguageChangedEventHandler != null)
915 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
916 e.Application = this;
917 applicationLanguageChangedEventHandler.Invoke(this, e);
922 * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
923 * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
925 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
929 // Restricted to only one listener
930 if (applicationRegionChangedEventHandler == null)
932 applicationRegionChangedEventHandler += value;
934 applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
935 regionChangedSignal = this.RegionChangedSignal();
936 regionChangedSignal?.Connect(applicationRegionChangedEventCallbackDelegate);
942 if (applicationRegionChangedEventHandler != null)
944 regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
945 regionChangedSignal?.Dispose();
946 regionChangedSignal = null;
949 applicationRegionChangedEventHandler -= value;
953 // Callback for Application RegionChangedSignal
954 private void OnNUIApplicationRegionChanged(IntPtr data)
956 if (applicationRegionChangedEventHandler != null)
958 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
959 e.Application = this;
960 applicationRegionChangedEventHandler.Invoke(this, e);
965 * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
966 * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
968 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
972 // Restricted to only one listener
973 if (applicationBatteryLowEventHandler == null)
975 applicationBatteryLowEventHandler += value;
977 applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
978 batteryLowSignal = this.BatteryLowSignal();
979 batteryLowSignal?.Connect(applicationBatteryLowEventCallbackDelegate);
985 if (applicationBatteryLowEventHandler != null)
987 batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
988 batteryLowSignal?.Dispose();
989 batteryLowSignal = null;
992 applicationBatteryLowEventHandler -= value;
996 // Callback for Application BatteryLowSignal
997 private void OnNUIApplicationBatteryLow(BatteryStatus status)
999 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1001 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1002 e.BatteryStatus = status;
1003 applicationBatteryLowEventHandler?.Invoke(this, e);
1007 * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
1008 * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
1010 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
1014 // Restricted to only one listener
1015 if (applicationMemoryLowEventHandler == null)
1017 applicationMemoryLowEventHandler += value;
1019 applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
1020 memoryLowSignal = this.MemoryLowSignal();
1021 memoryLowSignal?.Connect(applicationMemoryLowEventCallbackDelegate);
1027 if (applicationMemoryLowEventHandler != null)
1029 memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
1030 memoryLowSignal?.Dispose();
1031 memoryLowSignal = null;
1034 applicationMemoryLowEventHandler -= value;
1038 // Callback for Application MemoryLowSignal
1039 private void OnNUIApplicationMemoryLow(MemoryStatus status)
1041 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1043 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1044 e.MemoryStatus = status;
1045 applicationMemoryLowEventHandler?.Invoke(this, e);
1049 * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
1050 * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
1052 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
1056 // Restricted to only one listener
1057 if (applicationAppControlEventHandler == null)
1059 applicationAppControlEventHandler += value;
1061 applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1062 appControlSignal = this.AppControlSignal();
1063 appControlSignal?.Connect(applicationAppControlEventCallbackDelegate);
1069 if (applicationAppControlEventHandler != null)
1071 appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
1072 appControlSignal?.Dispose();
1073 appControlSignal = null;
1076 applicationAppControlEventHandler -= value;
1080 // Callback for Application AppControlSignal
1081 private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1083 if (applicationAppControlEventHandler != null)
1085 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1087 e.Application = this;
1088 applicationAppControlEventHandler.Invoke(this, e);
1093 /// @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
1094 /// provided by the user. Initialized signal is emitted when application is initialized
1096 public event DaliEventHandler<object, NUIApplicationInitEventArgs> TaskInitialized
1100 // Restricted to only one listener
1101 if (applicationTaskInitEventHandler == null)
1103 Tizen.Log.Fatal("NUI", "TaskInitialized Property adding");
1104 applicationTaskInitEventHandler += value;
1105 applicationTaskInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationTaskInit);
1106 taskInitSignal = this.TaskInitSignal();
1107 taskInitSignal?.Connect(applicationTaskInitEventCallbackDelegate);
1113 if (applicationTaskInitEventHandler != null)
1115 taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
1116 taskInitSignal?.Dispose();
1117 taskInitSignal = null;
1120 applicationTaskInitEventHandler -= value;
1124 private void OnApplicationTaskInit(IntPtr data)
1126 if (applicationTaskInitEventHandler != null)
1128 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
1129 e.Application = this;
1130 applicationTaskInitEventHandler.Invoke(this, e);
1136 /// @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
1137 /// provided by the user. Terminated signal is emitted when application is terminating
1139 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> TaskTerminating
1143 // Restricted to only one listener
1144 if (applicationTaskTerminateEventHandler == null)
1146 applicationTaskTerminateEventHandler += value;
1148 applicationTaskTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTaskTerminate);
1149 taskTerminateSignal = this.TaskTerminateSignal();
1150 taskTerminateSignal?.Connect(applicationTaskTerminateEventCallbackDelegate);
1156 if (applicationTaskTerminateEventHandler != null)
1158 taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
1159 taskTerminateSignal?.Dispose();
1160 taskTerminateSignal = null;
1163 applicationTaskTerminateEventHandler -= value;
1167 private void OnNUIApplicationTaskTerminate(IntPtr data)
1169 if (applicationTaskTerminateEventHandler != null)
1171 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
1172 e.Application = this;
1173 applicationTaskTerminateEventHandler.Invoke(this, e);
1178 /// @brief Event for TaskLanguageChanged signal which can be used to subscribe/unsubscribe the event handler
1179 /// provided by the user. TaskLanguageChanged signal is emitted when the region of the device is changed.
1181 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> TaskLanguageChanged
1185 // Restricted to only one listener
1186 if (applicationTaskLanguageChangedEventHandler == null)
1188 applicationTaskLanguageChangedEventHandler += value;
1190 applicationTaskLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationTaskLanguageChanged);
1191 taskLanguageChangedSignal = this.TaskLanguageChangedSignal();
1192 taskLanguageChangedSignal?.Connect(applicationTaskLanguageChangedEventCallbackDelegate);
1198 if (applicationTaskLanguageChangedEventHandler != null)
1200 taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
1201 taskLanguageChangedSignal?.Dispose();
1202 taskLanguageChangedSignal = null;
1205 applicationTaskLanguageChangedEventHandler -= value;
1209 private void OnNUIApplicationTaskLanguageChanged(IntPtr data)
1211 if (applicationTaskLanguageChangedEventHandler != null)
1213 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
1214 e.Application = this;
1215 applicationTaskLanguageChangedEventHandler.Invoke(this, e);
1220 /// @brief Event for TaskRegionChanged signal which can be used to subscribe/unsubscribe the event handler
1221 /// provided by the user. TaskRegionChanged signal is emitted when the region of the device is changed.
1223 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> TaskRegionChanged
1227 // Restricted to only one listener
1228 if (applicationTaskRegionChangedEventHandler == null)
1230 applicationTaskRegionChangedEventHandler += value;
1232 applicationTaskRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationTaskRegionChanged);
1233 taskRegionChangedSignal = this.TaskRegionChangedSignal();
1234 taskRegionChangedSignal?.Connect(applicationTaskRegionChangedEventCallbackDelegate);
1240 if (applicationTaskRegionChangedEventHandler != null)
1242 taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
1243 taskRegionChangedSignal?.Dispose();
1244 taskRegionChangedSignal = null;
1247 applicationTaskRegionChangedEventHandler -= value;
1251 private void OnNUIApplicationTaskRegionChanged(IntPtr data)
1253 if (applicationTaskRegionChangedEventHandler != null)
1255 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
1256 e.Application = this;
1257 applicationTaskRegionChangedEventHandler.Invoke(this, e);
1262 /// @brief Event for TaskBatteryLow signal which can be used to subscribe/unsubscribe the event handler
1263 /// provided by the user. TaskBatteryLow signal is emitted when the battery level of the device is low.
1265 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> TaskBatteryLow
1269 // Restricted to only one listener
1270 if (applicationTaskBatteryLowEventHandler == null)
1272 applicationTaskBatteryLowEventHandler += value;
1274 applicationTaskBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationTaskBatteryLow);
1275 taskBatteryLowSignal = this.TaskBatteryLowSignal();
1276 taskBatteryLowSignal?.Connect(applicationTaskBatteryLowEventCallbackDelegate);
1282 if (applicationTaskBatteryLowEventHandler != null)
1284 taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
1285 taskBatteryLowSignal?.Dispose();
1286 taskBatteryLowSignal = null;
1289 applicationTaskBatteryLowEventHandler -= value;
1293 private void OnNUIApplicationTaskBatteryLow(BatteryStatus status)
1295 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1297 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1298 e.BatteryStatus = status;
1299 applicationTaskBatteryLowEventHandler?.Invoke(this, e);
1303 /// @brief Event for TaskMemoryLow signal which can be used to subscribe/unsubscribe the event handler
1304 /// provided by the user. TaskMemoryLow signal is emitted when the memory level of the device is low.
1306 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> TaskMemoryLow
1310 // Restricted to only one listener
1311 if (applicationTaskMemoryLowEventHandler == null)
1313 applicationTaskMemoryLowEventHandler += value;
1315 applicationTaskMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationTaskMemoryLow);
1316 taskMemoryLowSignal = this.TaskMemoryLowSignal();
1317 taskMemoryLowSignal?.Connect(applicationTaskMemoryLowEventCallbackDelegate);
1323 if (applicationTaskMemoryLowEventHandler != null)
1325 taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
1326 taskMemoryLowSignal?.Dispose();
1327 taskMemoryLowSignal = null;
1330 applicationTaskMemoryLowEventHandler -= value;
1334 private void OnNUIApplicationTaskMemoryLow(MemoryStatus status)
1336 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1338 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1339 e.MemoryStatus = status;
1340 applicationTaskMemoryLowEventHandler?.Invoke(this, e);
1344 /// @brief Event for TaskAppControl signal which can be used to subscribe/unsubscribe the event handler
1345 /// provided by the user. TaskAppControl signal is emitted when another application sends a launch request to the application.
1347 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> TaskAppControl
1351 // Restricted to only one listener
1352 if (applicationTaskAppControlEventHandler == null)
1354 applicationTaskAppControlEventHandler += value;
1356 applicationTaskAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationTaskAppControl);
1357 taskAppControlSignal = this.TaskAppControlSignal();
1358 taskAppControlSignal?.Connect(applicationTaskAppControlEventCallbackDelegate);
1364 if (applicationTaskAppControlEventHandler != null)
1366 taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
1367 taskAppControlSignal?.Dispose();
1368 taskAppControlSignal = null;
1371 applicationTaskAppControlEventHandler -= value;
1375 private void OnNUIApplicationTaskAppControl(IntPtr application, IntPtr voidp)
1377 if (applicationTaskAppControlEventHandler != null)
1379 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1381 e.Application = this;
1382 applicationTaskAppControlEventHandler.Invoke(this, e);
1386 protected static Application instance; // singleton
1388 public static Application Instance
1396 public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1398 if (cPtr == global::System.IntPtr.Zero)
1403 Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1404 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1408 public static Application NewApplication()
1410 return NewApplication("", NUIApplication.WindowMode.Opaque);
1413 public static Application NewApplication(string stylesheet)
1415 return NewApplication(stylesheet, NUIApplication.WindowMode.Opaque);
1418 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode)
1420 // register all Views with the type registry, so that can be created / styled via JSON
1421 //ViewRegistryHelper.Initialize(); //moved to Application side.
1422 if (instance != null)
1427 Application ret = New(1, stylesheet, windowMode);
1428 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1430 // set the singleton
1435 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1437 if (instance != null)
1441 Application ret = New(1, stylesheet, windowMode, positionSize);
1442 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1444 // set the singleton
1449 public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1451 if (instance != null)
1455 Application ret = New(args, stylesheet, windowMode);
1456 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1458 // set the singleton
1463 public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1465 if (instance != null)
1469 Application ret = New(args, stylesheet, windowMode, positionSize);
1470 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1472 // set the singleton
1477 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1479 if (instance != null)
1483 Application ret = New(1, stylesheet, windowMode, type);
1484 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1490 public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1492 if (instance != null)
1496 Application ret = New(args, stylesheet, windowMode, positionSize, useUIThread);
1497 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1504 /// Ensures that the function passed in is called from the main loop when it is idle.
1506 /// <param name="func">The function to call</param>
1507 /// <returns>true if added successfully, false otherwise</returns>
1509 /// It will return false when one of the following conditions is met.
1510 /// 1) the <see cref="Window"/> is hidden.
1511 /// 2) the <see cref="Window"/> is iconified.
1513 public bool AddIdle(System.Delegate func)
1515 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1516 System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1518 bool ret = Interop.Application.AddIdle(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1520 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1525 * Outer::outer_method(int)
1527 public static Application New()
1529 Application ret = new Application(Interop.Application.New(), true);
1530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1534 public static Application New(int argc)
1536 Application ret = new Application(Interop.Application.New(argc), true);
1537 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1541 public static Application New(int argc, string stylesheet)
1543 Application ret = new Application(Interop.Application.New(argc, stylesheet), true);
1544 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1548 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode)
1550 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
1551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1556 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1558 Application ret = null;
1560 string argvStr = "";
1564 argvStr = string.Join(" ", args);
1566 catch (Exception exception)
1568 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1569 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1570 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1574 ret = new Application(NDalicPINVOKE.ApplicationNewManual4(argc, argvStr, stylesheet, (int)windowMode), true);
1575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1580 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1582 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1583 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1587 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1589 Application ret = null;
1591 string argvStr = "";
1595 argvStr = string.Join(" ", args);
1597 catch (Exception exception)
1599 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1600 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1601 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1605 ret = new Application(NDalicPINVOKE.ApplicationNewWithWindowSizePosition(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1606 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1611 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1613 // It will be removed until dali APIs are prepared.
1614 Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
1616 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
1617 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1621 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1623 Application ret = null;
1625 string argvStr = "";
1629 argvStr = string.Join(" ", args);
1631 ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize), useUIThread), true);
1632 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1634 catch (Exception exception)
1636 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1637 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1638 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1645 public Application() : this(Interop.Application.NewApplication(), true)
1647 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1650 public Application(Application application) : this(Interop.Application.NewApplication(Application.getCPtr(application)), true)
1652 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1655 public Application Assign(Application application)
1657 Application ret = new Application(Interop.Application.Assign(SwigCPtr, Application.getCPtr(application)), false);
1658 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1662 public void MainLoop()
1664 NDalicPINVOKE.ApplicationMainLoop(SwigCPtr);
1665 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1670 Interop.Application.Lower(SwigCPtr);
1671 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1676 Interop.Application.Quit(SwigCPtr);
1677 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1680 internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1682 bool ret = Interop.Application.AddIdle(SwigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1683 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1687 public Window GetWindow()
1694 var nativeWindow = Interop.Application.GetWindow(SwigCPtr);
1695 window = Registry.GetManagedBaseHandleFromNativePtr(nativeWindow) as Window;
1698 HandleRef CPtr = new HandleRef(this, nativeWindow);
1699 Interop.BaseHandle.DeleteBaseHandle(CPtr);
1700 CPtr = new HandleRef(null, IntPtr.Zero);
1704 window = new Window(nativeWindow, true);
1707 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1711 public static string GetResourcePath()
1713 string ret = Interop.Application.GetResourcePath();
1714 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1718 public string GetLanguage()
1720 string ret = Interop.Application.GetLanguage(SwigCPtr);
1721 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1725 public string GetRegion()
1727 string ret = Interop.Application.GetRegion(SwigCPtr);
1728 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1732 [EditorBrowsable(EditorBrowsableState.Never)]
1733 public static List<Window> GetWindowList()
1735 uint ListSize = Interop.Application.GetWindowsListSize();
1736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1738 List<Window> WindowList = new List<Window>();
1739 for (uint i = 0; i < ListSize; ++i)
1741 Window currWin = WindowList.GetInstanceSafely<Window>(Interop.Application.GetWindowsFromList(i));
1742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1743 if (currWin != null)
1745 WindowList.Add(currWin);
1751 internal ApplicationSignal InitSignal()
1753 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationInitSignal(SwigCPtr), false);
1754 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1758 internal ApplicationSignal TerminateSignal()
1760 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTerminateSignal(SwigCPtr), false);
1761 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1765 internal ApplicationSignal PauseSignal()
1767 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationPauseSignal(SwigCPtr), false);
1768 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1772 internal ApplicationSignal ResumeSignal()
1774 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResumeSignal(SwigCPtr), false);
1775 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1779 internal ApplicationSignal ResetSignal()
1781 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResetSignal(SwigCPtr), false);
1782 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1786 internal ApplicationControlSignal AppControlSignal()
1788 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationAppControlSignal(SwigCPtr), false);
1789 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1793 internal ApplicationSignal LanguageChangedSignal()
1795 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationLanguageChangedSignal(SwigCPtr), false);
1796 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1800 internal ApplicationSignal RegionChangedSignal()
1802 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationRegionChangedSignal(SwigCPtr), false);
1803 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1807 internal LowBatterySignalType BatteryLowSignal()
1809 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationLowBatterySignal(SwigCPtr), false);
1810 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1814 internal LowMemorySignalType MemoryLowSignal()
1816 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationLowMemorySignal(SwigCPtr), false);
1817 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1822 internal ApplicationSignal TaskInitSignal()
1824 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskInitSignal(SwigCPtr), false);
1825 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1829 internal ApplicationSignal TaskTerminateSignal()
1831 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskTerminateSignal(SwigCPtr), false);
1832 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1836 internal ApplicationControlSignal TaskAppControlSignal()
1838 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationTaskAppControlSignal(SwigCPtr), false);
1839 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1843 internal ApplicationSignal TaskLanguageChangedSignal()
1845 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskLanguageChangedSignal(SwigCPtr), false);
1846 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1850 internal ApplicationSignal TaskRegionChangedSignal()
1852 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskRegionChangedSignal(SwigCPtr), false);
1853 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1857 internal LowBatterySignalType TaskBatteryLowSignal()
1859 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationTaskLowBatterySignal(SwigCPtr), false);
1860 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1864 internal LowMemorySignalType TaskMemoryLowSignal()
1866 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationTaskLowMemorySignal(SwigCPtr), false);
1867 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();