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 public NUIWidgetApplication() : base(new NUIWidgetCoreBackend())
37 Tizen.Log.Fatal("NUI", "### NUIWidgetApplication called");
41 /// The constructor with stylesheet.
43 public NUIWidgetApplication(string stylesheet) : base(new NUIWidgetCoreBackend(stylesheet))
45 Tizen.Log.Fatal("NUI", "### NUIWidgetApplication(string) called");
49 /// Overrides this method if want to handle behavior.
51 protected override void OnLocaleChanged(LocaleChangedEventArgs e)
53 Log.Fatal("NUI", "OnLocaleChanged() is called!");
54 base.OnLocaleChanged(e);
58 /// Overrides this method if want to handle behavior.
60 protected override void OnLowBattery(LowBatteryEventArgs e)
62 Log.Fatal("NUI", "OnLowBattery() is called!");
67 /// Overrides this method if want to handle behavior.
69 protected override void OnLowMemory(LowMemoryEventArgs e)
71 Log.Fatal("NUI", "OnLowMemory() is called!");
76 /// Overrides this method if want to handle behavior.
78 protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
80 Log.Fatal("NUI", "OnRegionFormatChanged() is called!");
81 base.OnRegionFormatChanged(e);
85 /// Overrides this method if want to handle behavior.
87 protected override void OnTerminate()
89 Log.Fatal("NUI", "OnTerminate() is called!");
94 /// Overrides this method if want to handle behavior.
96 protected virtual void OnPreCreate()
98 Log.Fatal("NUI", "OnPreCreate() is called!");
102 /// Overrides this method if want to handle behavior.
104 protected override void OnCreate()
106 // This is also required to create DisposeQueue on main thread.
107 DisposeQueue disposeQ = DisposeQueue.Instance;
108 disposeQ.Initialize();
109 Log.Fatal("NUI","OnCreate() is called!");
114 /// Run NUIWidgetApplication.
116 /// <param name="args">Arguments from commandline.</param>
117 public override void Run(string[] args)
119 Backend.AddEventHandler(EventType.PreCreated, OnPreCreate);
124 /// Exit NUIWidgetApplication.
126 public override void Exit()
128 Tizen.Log.Fatal("NUI", "### NUIWidgetApplication Exit called");
132 internal WidgetApplication ApplicationHandle
136 return ((NUIWidgetCoreBackend)this.Backend).WidgetApplicationHandle;
141 /// Get the window instance.
147 //return Window.Instance;
148 return ApplicationHandle.GetWindow();