2 * Copyright (c) 2016 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.
19 using Tizen.Applications;
20 using Tizen.Applications.CoreBackend;
27 /// Represents an application that have UI screen. The NUIWidgetApplication class has a default stage.
29 public class NUIWidgetApplication : CoreApplication
33 /// The default constructor.
35 /// <since_tizen> 4 </since_tizen>
36 public NUIWidgetApplication() : base(new NUIWidgetCoreBackend())
38 Tizen.Log.Fatal("NUI", "### NUIWidgetApplication called");
42 /// The constructor with stylesheet.
44 /// <since_tizen> 4 </since_tizen>
45 public NUIWidgetApplication(string stylesheet) : base(new NUIWidgetCoreBackend(stylesheet))
47 Tizen.Log.Fatal("NUI", "### NUIWidgetApplication(string) called");
51 /// Overrides this method if want to handle behavior.
53 protected override void OnLocaleChanged(LocaleChangedEventArgs e)
55 Log.Fatal("NUI", "OnLocaleChanged() is called!");
56 base.OnLocaleChanged(e);
60 /// Overrides this method if want to handle behavior.
62 protected override void OnLowBattery(LowBatteryEventArgs e)
64 Log.Fatal("NUI", "OnLowBattery() is called!");
69 /// Overrides this method if want to handle behavior.
71 protected override void OnLowMemory(LowMemoryEventArgs e)
73 Log.Fatal("NUI", "OnLowMemory() is called!");
78 /// Overrides this method if want to handle behavior.
80 protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
82 Log.Fatal("NUI", "OnRegionFormatChanged() is called!");
83 base.OnRegionFormatChanged(e);
87 /// Overrides this method if want to handle behavior.
89 protected override void OnTerminate()
91 Log.Fatal("NUI", "OnTerminate() is called!");
96 /// Overrides this method if want to handle behavior.
98 protected virtual void OnPreCreate()
100 Log.Fatal("NUI", "OnPreCreate() is called!");
104 /// Overrides this method if want to handle behavior.
106 protected override void OnCreate()
108 // This is also required to create DisposeQueue on main thread.
109 DisposeQueue disposeQ = DisposeQueue.Instance;
110 disposeQ.Initialize();
111 Log.Fatal("NUI","OnCreate() is called!");
116 /// Run NUIWidgetApplication.
118 /// <param name="args">Arguments from commandline.</param>
119 /// <since_tizen> 4 </since_tizen>
120 public override void Run(string[] args)
122 Backend.AddEventHandler(EventType.PreCreated, OnPreCreate);
127 /// Exit NUIWidgetApplication.
129 /// <since_tizen> 4 </since_tizen>
130 public override void Exit()
132 Tizen.Log.Fatal("NUI", "### NUIWidgetApplication Exit called");
136 internal WidgetApplication ApplicationHandle
140 return ((NUIWidgetCoreBackend)this.Backend).WidgetApplicationHandle;
145 /// Get the window instance.
147 /// <since_tizen> 4 </since_tizen>
152 //return Window.Instance;
153 return ApplicationHandle.GetWindow();