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 // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
666 DisposeQueue.Instance.Initialize();
667 Window.Instance = GetWindow();
668 _ = FocusManager.Instance;
670 // Notify that the window is displayed to the app core.
671 if (NUIApplication.IsPreload)
673 Window.Instance.Show();
676 if (applicationInitEventHandler != null)
678 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
679 e.Application = this;
680 applicationInitEventHandler.Invoke(this, e);
686 * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
687 * provided by the user. Terminated signal is emitted when application is terminating
689 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
693 // Restricted to only one listener
694 if (applicationTerminateEventHandler == null)
696 applicationTerminateEventHandler += value;
698 applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
699 terminateSignal = this.TerminateSignal();
700 terminateSignal?.Connect(applicationTerminateEventCallbackDelegate);
706 if (applicationTerminateEventHandler != null)
708 terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
709 terminateSignal?.Dispose();
710 terminateSignal = null;
713 applicationTerminateEventHandler -= value;
717 // Callback for Application TerminateSignal
718 private void OnNUIApplicationTerminate(IntPtr data)
720 if (applicationTerminateEventHandler != null)
722 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
723 e.Application = this;
724 applicationTerminateEventHandler.Invoke(this, e);
727 List<Window> windows = GetWindowList();
728 foreach (Window window in windows)
730 window?.DisconnectNativeSignals();
735 * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
736 * provided by the user. Paused signal is emitted when application is paused
738 public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
742 // Restricted to only one listener
743 if (applicationPauseEventHandler == null)
745 applicationPauseEventHandler += value;
747 applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
748 pauseSignal = this.PauseSignal();
749 pauseSignal?.Connect(applicationPauseEventCallbackDelegate);
755 if (applicationPauseEventHandler != null)
757 pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
758 pauseSignal?.Dispose();
762 applicationPauseEventHandler -= value;
766 // Callback for Application PauseSignal
767 private void OnNUIApplicationPause(IntPtr data)
769 if (applicationPauseEventHandler != null)
771 NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
772 e.Application = this;
773 applicationPauseEventHandler.Invoke(this, e);
778 * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
779 * provided by the user. Resumed signal is emitted when application is resumed
781 public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
785 // Restricted to only one listener
786 if (applicationResumeEventHandler == null)
788 applicationResumeEventHandler += value;
790 applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
791 resumeSignal = this.ResumeSignal();
792 resumeSignal?.Connect(applicationResumeEventCallbackDelegate);
798 if (applicationResumeEventHandler != null)
800 resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
801 resumeSignal?.Dispose();
805 applicationResumeEventHandler -= value;
809 // Callback for Application ResumeSignal
810 private void OnNUIApplicationResume(IntPtr data)
812 if (applicationResumeEventHandler != null)
814 NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
815 e.Application = this;
816 applicationResumeEventHandler.Invoke(this, e);
821 * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
822 * provided by the user. Reset signal is emitted when application is reset
824 public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
828 // Restricted to only one listener
829 if (applicationResetEventHandler == null)
831 applicationResetEventHandler += value;
833 applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
834 resetSignal = this.ResetSignal();
835 resetSignal?.Connect(applicationResetEventCallbackDelegate);
841 if (applicationResetEventHandler != null)
843 resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
844 resetSignal?.Dispose();
848 applicationResetEventHandler -= value;
852 // Callback for Application ResetSignal
853 private void OnNUIApplicationReset(IntPtr data)
855 if (applicationResetEventHandler != null)
857 NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
858 e.Application = this;
859 applicationResetEventHandler.Invoke(this, e);
864 * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
865 * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
867 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
871 // Restricted to only one listener
872 if (applicationLanguageChangedEventHandler == null)
874 applicationLanguageChangedEventHandler += value;
876 applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
877 languageChangedSignal = this.LanguageChangedSignal();
878 languageChangedSignal?.Connect(applicationLanguageChangedEventCallbackDelegate);
884 if (applicationLanguageChangedEventHandler != null)
886 languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
887 languageChangedSignal?.Dispose();
888 languageChangedSignal = null;
891 applicationLanguageChangedEventHandler -= value;
895 // Callback for Application LanguageChangedSignal
896 private void OnNUIApplicationLanguageChanged(IntPtr data)
898 if (applicationLanguageChangedEventHandler != null)
900 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
901 e.Application = this;
902 applicationLanguageChangedEventHandler.Invoke(this, e);
907 * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
908 * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
910 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
914 // Restricted to only one listener
915 if (applicationRegionChangedEventHandler == null)
917 applicationRegionChangedEventHandler += value;
919 applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
920 regionChangedSignal = this.RegionChangedSignal();
921 regionChangedSignal?.Connect(applicationRegionChangedEventCallbackDelegate);
927 if (applicationRegionChangedEventHandler != null)
929 regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
930 regionChangedSignal?.Dispose();
931 regionChangedSignal = null;
934 applicationRegionChangedEventHandler -= value;
938 // Callback for Application RegionChangedSignal
939 private void OnNUIApplicationRegionChanged(IntPtr data)
941 if (applicationRegionChangedEventHandler != null)
943 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
944 e.Application = this;
945 applicationRegionChangedEventHandler.Invoke(this, e);
950 * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
951 * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
953 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
957 // Restricted to only one listener
958 if (applicationBatteryLowEventHandler == null)
960 applicationBatteryLowEventHandler += value;
962 applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
963 batteryLowSignal = this.BatteryLowSignal();
964 batteryLowSignal?.Connect(applicationBatteryLowEventCallbackDelegate);
970 if (applicationBatteryLowEventHandler != null)
972 batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
973 batteryLowSignal?.Dispose();
974 batteryLowSignal = null;
977 applicationBatteryLowEventHandler -= value;
981 // Callback for Application BatteryLowSignal
982 private void OnNUIApplicationBatteryLow(BatteryStatus status)
984 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
986 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
987 e.BatteryStatus = status;
988 applicationBatteryLowEventHandler?.Invoke(this, e);
992 * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
993 * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
995 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
999 // Restricted to only one listener
1000 if (applicationMemoryLowEventHandler == null)
1002 applicationMemoryLowEventHandler += value;
1004 applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
1005 memoryLowSignal = this.MemoryLowSignal();
1006 memoryLowSignal?.Connect(applicationMemoryLowEventCallbackDelegate);
1012 if (applicationMemoryLowEventHandler != null)
1014 memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
1015 memoryLowSignal?.Dispose();
1016 memoryLowSignal = null;
1019 applicationMemoryLowEventHandler -= value;
1023 // Callback for Application MemoryLowSignal
1024 private void OnNUIApplicationMemoryLow(MemoryStatus status)
1026 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1028 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1029 e.MemoryStatus = status;
1030 applicationMemoryLowEventHandler?.Invoke(this, e);
1034 * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
1035 * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
1037 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
1041 // Restricted to only one listener
1042 if (applicationAppControlEventHandler == null)
1044 applicationAppControlEventHandler += value;
1046 applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
1047 appControlSignal = this.AppControlSignal();
1048 appControlSignal?.Connect(applicationAppControlEventCallbackDelegate);
1054 if (applicationAppControlEventHandler != null)
1056 appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
1057 appControlSignal?.Dispose();
1058 appControlSignal = null;
1061 applicationAppControlEventHandler -= value;
1065 // Callback for Application AppControlSignal
1066 private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
1068 if (applicationAppControlEventHandler != null)
1070 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1072 e.Application = this;
1073 applicationAppControlEventHandler.Invoke(this, e);
1078 /// @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
1079 /// provided by the user. Initialized signal is emitted when application is initialized
1081 public event DaliEventHandler<object, NUIApplicationInitEventArgs> TaskInitialized
1085 // Restricted to only one listener
1086 if (applicationTaskInitEventHandler == null)
1088 Tizen.Log.Fatal("NUI", "TaskInitialized Property adding");
1089 applicationTaskInitEventHandler += value;
1090 applicationTaskInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationTaskInit);
1091 taskInitSignal = this.TaskInitSignal();
1092 taskInitSignal?.Connect(applicationTaskInitEventCallbackDelegate);
1098 if (applicationTaskInitEventHandler != null)
1100 taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
1101 taskInitSignal?.Dispose();
1102 taskInitSignal = null;
1105 applicationTaskInitEventHandler -= value;
1109 private void OnApplicationTaskInit(IntPtr data)
1111 if (applicationTaskInitEventHandler != null)
1113 NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
1114 e.Application = this;
1115 applicationTaskInitEventHandler.Invoke(this, e);
1121 /// @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
1122 /// provided by the user. Terminated signal is emitted when application is terminating
1124 public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> TaskTerminating
1128 // Restricted to only one listener
1129 if (applicationTaskTerminateEventHandler == null)
1131 applicationTaskTerminateEventHandler += value;
1133 applicationTaskTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTaskTerminate);
1134 taskTerminateSignal = this.TaskTerminateSignal();
1135 taskTerminateSignal?.Connect(applicationTaskTerminateEventCallbackDelegate);
1141 if (applicationTaskTerminateEventHandler != null)
1143 taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
1144 taskTerminateSignal?.Dispose();
1145 taskTerminateSignal = null;
1148 applicationTaskTerminateEventHandler -= value;
1152 private void OnNUIApplicationTaskTerminate(IntPtr data)
1154 if (applicationTaskTerminateEventHandler != null)
1156 NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
1157 e.Application = this;
1158 applicationTaskTerminateEventHandler.Invoke(this, e);
1163 /// @brief Event for TaskLanguageChanged signal which can be used to subscribe/unsubscribe the event handler
1164 /// provided by the user. TaskLanguageChanged signal is emitted when the region of the device is changed.
1166 public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> TaskLanguageChanged
1170 // Restricted to only one listener
1171 if (applicationTaskLanguageChangedEventHandler == null)
1173 applicationTaskLanguageChangedEventHandler += value;
1175 applicationTaskLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationTaskLanguageChanged);
1176 taskLanguageChangedSignal = this.TaskLanguageChangedSignal();
1177 taskLanguageChangedSignal?.Connect(applicationTaskLanguageChangedEventCallbackDelegate);
1183 if (applicationTaskLanguageChangedEventHandler != null)
1185 taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
1186 taskLanguageChangedSignal?.Dispose();
1187 taskLanguageChangedSignal = null;
1190 applicationTaskLanguageChangedEventHandler -= value;
1194 private void OnNUIApplicationTaskLanguageChanged(IntPtr data)
1196 if (applicationTaskLanguageChangedEventHandler != null)
1198 NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
1199 e.Application = this;
1200 applicationTaskLanguageChangedEventHandler.Invoke(this, e);
1205 /// @brief Event for TaskRegionChanged signal which can be used to subscribe/unsubscribe the event handler
1206 /// provided by the user. TaskRegionChanged signal is emitted when the region of the device is changed.
1208 public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> TaskRegionChanged
1212 // Restricted to only one listener
1213 if (applicationTaskRegionChangedEventHandler == null)
1215 applicationTaskRegionChangedEventHandler += value;
1217 applicationTaskRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationTaskRegionChanged);
1218 taskRegionChangedSignal = this.TaskRegionChangedSignal();
1219 taskRegionChangedSignal?.Connect(applicationTaskRegionChangedEventCallbackDelegate);
1225 if (applicationTaskRegionChangedEventHandler != null)
1227 taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
1228 taskRegionChangedSignal?.Dispose();
1229 taskRegionChangedSignal = null;
1232 applicationTaskRegionChangedEventHandler -= value;
1236 private void OnNUIApplicationTaskRegionChanged(IntPtr data)
1238 if (applicationTaskRegionChangedEventHandler != null)
1240 NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
1241 e.Application = this;
1242 applicationTaskRegionChangedEventHandler.Invoke(this, e);
1247 /// @brief Event for TaskBatteryLow signal which can be used to subscribe/unsubscribe the event handler
1248 /// provided by the user. TaskBatteryLow signal is emitted when the battery level of the device is low.
1250 public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> TaskBatteryLow
1254 // Restricted to only one listener
1255 if (applicationTaskBatteryLowEventHandler == null)
1257 applicationTaskBatteryLowEventHandler += value;
1259 applicationTaskBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationTaskBatteryLow);
1260 taskBatteryLowSignal = this.TaskBatteryLowSignal();
1261 taskBatteryLowSignal?.Connect(applicationTaskBatteryLowEventCallbackDelegate);
1267 if (applicationTaskBatteryLowEventHandler != null)
1269 taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
1270 taskBatteryLowSignal?.Dispose();
1271 taskBatteryLowSignal = null;
1274 applicationTaskBatteryLowEventHandler -= value;
1278 private void OnNUIApplicationTaskBatteryLow(BatteryStatus status)
1280 NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
1282 // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
1283 e.BatteryStatus = status;
1284 applicationTaskBatteryLowEventHandler?.Invoke(this, e);
1288 /// @brief Event for TaskMemoryLow signal which can be used to subscribe/unsubscribe the event handler
1289 /// provided by the user. TaskMemoryLow signal is emitted when the memory level of the device is low.
1291 public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> TaskMemoryLow
1295 // Restricted to only one listener
1296 if (applicationTaskMemoryLowEventHandler == null)
1298 applicationTaskMemoryLowEventHandler += value;
1300 applicationTaskMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationTaskMemoryLow);
1301 taskMemoryLowSignal = this.TaskMemoryLowSignal();
1302 taskMemoryLowSignal?.Connect(applicationTaskMemoryLowEventCallbackDelegate);
1308 if (applicationTaskMemoryLowEventHandler != null)
1310 taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
1311 taskMemoryLowSignal?.Dispose();
1312 taskMemoryLowSignal = null;
1315 applicationTaskMemoryLowEventHandler -= value;
1319 private void OnNUIApplicationTaskMemoryLow(MemoryStatus status)
1321 NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
1323 // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
1324 e.MemoryStatus = status;
1325 applicationTaskMemoryLowEventHandler?.Invoke(this, e);
1329 /// @brief Event for TaskAppControl signal which can be used to subscribe/unsubscribe the event handler
1330 /// provided by the user. TaskAppControl signal is emitted when another application sends a launch request to the application.
1332 public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> TaskAppControl
1336 // Restricted to only one listener
1337 if (applicationTaskAppControlEventHandler == null)
1339 applicationTaskAppControlEventHandler += value;
1341 applicationTaskAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationTaskAppControl);
1342 taskAppControlSignal = this.TaskAppControlSignal();
1343 taskAppControlSignal?.Connect(applicationTaskAppControlEventCallbackDelegate);
1349 if (applicationTaskAppControlEventHandler != null)
1351 taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
1352 taskAppControlSignal?.Dispose();
1353 taskAppControlSignal = null;
1356 applicationTaskAppControlEventHandler -= value;
1360 private void OnNUIApplicationTaskAppControl(IntPtr application, IntPtr voidp)
1362 if (applicationTaskAppControlEventHandler != null)
1364 NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
1366 e.Application = this;
1367 applicationTaskAppControlEventHandler.Invoke(this, e);
1371 protected static Application instance; // singleton
1373 public static Application Instance
1381 public static Application GetApplicationFromPtr(global::System.IntPtr cPtr)
1383 if (cPtr == global::System.IntPtr.Zero)
1388 Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
1389 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1393 public static Application NewApplication()
1395 return NewApplication("", NUIApplication.WindowMode.Opaque);
1398 public static Application NewApplication(string stylesheet)
1400 return NewApplication(stylesheet, NUIApplication.WindowMode.Opaque);
1403 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode)
1405 // register all Views with the type registry, so that can be created / styled via JSON
1406 //ViewRegistryHelper.Initialize(); //moved to Application side.
1407 if (instance != null)
1412 Application ret = New(1, stylesheet, windowMode);
1413 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1415 // set the singleton
1420 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1422 if (instance != null)
1426 Application ret = New(1, stylesheet, windowMode, positionSize);
1427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1429 // set the singleton
1434 public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1436 if (instance != null)
1440 Application ret = New(args, stylesheet, windowMode);
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, Rectangle positionSize)
1450 if (instance != null)
1454 Application ret = New(args, stylesheet, windowMode, positionSize);
1455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1457 // set the singleton
1462 public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1464 if (instance != null)
1468 Application ret = New(1, stylesheet, windowMode, type);
1469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1475 public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1477 if (instance != null)
1481 Application ret = New(args, stylesheet, windowMode, positionSize, useUIThread);
1482 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1489 /// Ensures that the function passed in is called from the main loop when it is idle.
1491 /// <param name="func">The function to call</param>
1492 /// <returns>true if added successfully, false otherwise</returns>
1494 /// It will return false when one of the following conditions is met.
1495 /// 1) the <see cref="Window"/> is hidden.
1496 /// 2) the <see cref="Window"/> is iconified.
1498 public bool AddIdle(System.Delegate func)
1500 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
1501 System.IntPtr ip2 = Interop.Application.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
1503 bool ret = Interop.Application.AddIdle(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
1505 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1510 * Outer::outer_method(int)
1512 public static Application New()
1514 Application ret = new Application(Interop.Application.New(), true);
1515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1519 public static Application New(int argc)
1521 Application ret = new Application(Interop.Application.New(argc), true);
1522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1526 public static Application New(int argc, string stylesheet)
1528 Application ret = new Application(Interop.Application.New(argc, stylesheet), true);
1529 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1533 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode)
1535 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
1536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1541 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
1543 Application ret = null;
1545 string argvStr = "";
1549 argvStr = string.Join(" ", args);
1551 catch (Exception exception)
1553 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1554 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1555 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1559 ret = new Application(NDalicPINVOKE.ApplicationNewManual4(argc, argvStr, stylesheet, (int)windowMode), true);
1560 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1565 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1567 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1568 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1572 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
1574 Application ret = null;
1576 string argvStr = "";
1580 argvStr = string.Join(" ", args);
1582 catch (Exception exception)
1584 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1585 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1586 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1590 ret = new Application(NDalicPINVOKE.ApplicationNewWithWindowSizePosition(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
1591 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1596 public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
1598 // It will be removed until dali APIs are prepared.
1599 Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
1601 Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
1602 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1606 public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
1608 Application ret = null;
1610 string argvStr = "";
1614 argvStr = string.Join(" ", args);
1616 ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize), useUIThread), true);
1617 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1619 catch (Exception exception)
1621 Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
1622 Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
1623 Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
1630 public Application() : this(Interop.Application.NewApplication(), true)
1632 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1635 public Application(Application application) : this(Interop.Application.NewApplication(Application.getCPtr(application)), true)
1637 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1640 public Application Assign(Application application)
1642 Application ret = new Application(Interop.Application.Assign(SwigCPtr, Application.getCPtr(application)), false);
1643 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1647 public void MainLoop()
1649 NDalicPINVOKE.ApplicationMainLoop(SwigCPtr);
1650 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1655 Interop.Application.Lower(SwigCPtr);
1656 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1661 Interop.Application.Quit(SwigCPtr);
1662 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1665 internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback)
1667 bool ret = Interop.Application.AddIdle(SwigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
1668 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1672 public Window GetWindow()
1679 var nativeWindow = Interop.Application.GetWindow(SwigCPtr);
1680 window = Registry.GetManagedBaseHandleFromNativePtr(nativeWindow) as Window;
1683 HandleRef CPtr = new HandleRef(this, nativeWindow);
1684 Interop.BaseHandle.DeleteBaseHandle(CPtr);
1685 CPtr = new HandleRef(null, IntPtr.Zero);
1689 window = new Window(nativeWindow, true);
1692 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1696 public static string GetResourcePath()
1698 string ret = Interop.Application.GetResourcePath();
1699 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1703 public string GetLanguage()
1705 string ret = Interop.Application.GetLanguage(SwigCPtr);
1706 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1710 public string GetRegion()
1712 string ret = Interop.Application.GetRegion(SwigCPtr);
1713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1717 [EditorBrowsable(EditorBrowsableState.Never)]
1718 public static List<Window> GetWindowList()
1720 uint ListSize = Interop.Application.GetWindowsListSize();
1721 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1723 List<Window> WindowList = new List<Window>();
1724 for (uint i = 0; i < ListSize; ++i)
1726 Window currWin = WindowList.GetInstanceSafely<Window>(Interop.Application.GetWindowsFromList(i));
1727 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1728 if (currWin != null)
1730 WindowList.Add(currWin);
1736 internal ApplicationSignal InitSignal()
1738 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationInitSignal(SwigCPtr), false);
1739 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1743 internal ApplicationSignal TerminateSignal()
1745 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTerminateSignal(SwigCPtr), false);
1746 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1750 internal ApplicationSignal PauseSignal()
1752 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationPauseSignal(SwigCPtr), false);
1753 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1757 internal ApplicationSignal ResumeSignal()
1759 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResumeSignal(SwigCPtr), false);
1760 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1764 internal ApplicationSignal ResetSignal()
1766 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationResetSignal(SwigCPtr), false);
1767 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1771 internal ApplicationControlSignal AppControlSignal()
1773 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationAppControlSignal(SwigCPtr), false);
1774 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1778 internal ApplicationSignal LanguageChangedSignal()
1780 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationLanguageChangedSignal(SwigCPtr), false);
1781 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1785 internal ApplicationSignal RegionChangedSignal()
1787 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationRegionChangedSignal(SwigCPtr), false);
1788 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1792 internal LowBatterySignalType BatteryLowSignal()
1794 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationLowBatterySignal(SwigCPtr), false);
1795 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1799 internal LowMemorySignalType MemoryLowSignal()
1801 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationLowMemorySignal(SwigCPtr), false);
1802 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1807 internal ApplicationSignal TaskInitSignal()
1809 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskInitSignal(SwigCPtr), false);
1810 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1814 internal ApplicationSignal TaskTerminateSignal()
1816 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskTerminateSignal(SwigCPtr), false);
1817 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1821 internal ApplicationControlSignal TaskAppControlSignal()
1823 ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationTaskAppControlSignal(SwigCPtr), false);
1824 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1828 internal ApplicationSignal TaskLanguageChangedSignal()
1830 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskLanguageChangedSignal(SwigCPtr), false);
1831 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1835 internal ApplicationSignal TaskRegionChangedSignal()
1837 ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskRegionChangedSignal(SwigCPtr), false);
1838 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1842 internal LowBatterySignalType TaskBatteryLowSignal()
1844 LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationTaskLowBatterySignal(SwigCPtr), false);
1845 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1849 internal LowMemorySignalType TaskMemoryLowSignal()
1851 LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationTaskLowMemorySignal(SwigCPtr), false);
1852 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();