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 /// <param name="styleSheet">The styleSheet url.</param>
45 /// <since_tizen> 4 </since_tizen>
46 public NUIWidgetApplication(string styleSheet) : base(new NUIWidgetCoreBackend(styleSheet))
48 Tizen.Log.Fatal("NUI", "### NUIWidgetApplication(string) called");
52 /// Overrides this method if want to handle behavior.
54 protected override void OnLocaleChanged(LocaleChangedEventArgs e)
56 Log.Fatal("NUI", "OnLocaleChanged() is called!");
57 base.OnLocaleChanged(e);
61 /// Overrides this method if want to handle behavior.
63 protected override void OnLowBattery(LowBatteryEventArgs e)
65 Log.Fatal("NUI", "OnLowBattery() is called!");
70 /// Overrides this method if want to handle behavior.
72 protected override void OnLowMemory(LowMemoryEventArgs e)
74 Log.Fatal("NUI", "OnLowMemory() is called!");
79 /// Overrides this method if want to handle behavior.
81 protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
83 Log.Fatal("NUI", "OnRegionFormatChanged() is called!");
84 base.OnRegionFormatChanged(e);
88 /// Overrides this method if want to handle behavior.
90 protected override void OnTerminate()
92 Log.Fatal("NUI", "OnTerminate() is called!");
97 /// Overrides this method if want to handle behavior.
99 protected virtual void OnPreCreate()
101 Log.Fatal("NUI", "OnPreCreate() is called!");
105 /// Overrides this method if want to handle behavior.
107 protected override void OnCreate()
109 // This is also required to create DisposeQueue on main thread.
110 DisposeQueue disposeQ = DisposeQueue.Instance;
111 disposeQ.Initialize();
112 Log.Fatal("NUI","OnCreate() is called!");
117 /// Run NUIWidgetApplication.
119 /// <param name="args">Arguments from commandline.</param>
120 /// <since_tizen> 4 </since_tizen>
121 public override void Run(string[] args)
123 Backend.AddEventHandler(EventType.PreCreated, OnPreCreate);
128 /// Exit NUIWidgetApplication.
130 /// <since_tizen> 4 </since_tizen>
131 public override void Exit()
133 Tizen.Log.Fatal("NUI", "### NUIWidgetApplication Exit called");
137 internal WidgetApplication ApplicationHandle
141 return ((NUIWidgetCoreBackend)this.Backend).WidgetApplicationHandle;
146 /// Get the window instance.
148 /// <since_tizen> 4 </since_tizen>
153 //return Window.Instance;
154 return ApplicationHandle.GetWindow();