Merge "[Telephony] Added sample app code."
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / NUIWidgetApplication.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using Tizen.Applications;
21 using Tizen.Applications.CoreBackend;
22 using Tizen.NUI;
23
24 namespace Tizen.NUI
25 {
26
27     /// <summary>
28     /// Represents an application that have UI screen. The NUIWidgetApplication class has a default stage.
29     /// </summary>
30     [Obsolete("Please do not use! this will be deprecated")]
31     [EditorBrowsable(EditorBrowsableState.Never)]
32     public class NUIWidgetApplication : CoreApplication
33     {
34
35         /// <summary>
36         /// The default constructor.
37         /// </summary>
38         /// <since_tizen> 4 </since_tizen>
39         public NUIWidgetApplication() : base(new NUIWidgetCoreBackend())
40         {
41             Tizen.Log.Fatal("NUI", "### NUIWidgetApplication called");
42         }
43
44         /// <summary>
45         /// The constructor with stylesheet.
46         /// </summary>
47         /// <param name="styleSheet">The styleSheet url.</param>
48         /// <since_tizen> 4 </since_tizen>
49         public NUIWidgetApplication(string styleSheet) : base(new NUIWidgetCoreBackend(styleSheet))
50         {
51             Tizen.Log.Fatal("NUI", "### NUIWidgetApplication(string) called");
52         }
53
54         /// <summary>
55         /// Overrides this method if want to handle behavior.
56         /// </summary>
57         protected override void OnLocaleChanged(LocaleChangedEventArgs e)
58         {
59             Log.Fatal("NUI", "OnLocaleChanged() is called!");
60             base.OnLocaleChanged(e);
61         }
62
63         /// <summary>
64         /// Overrides this method if want to handle behavior.
65         /// </summary>
66         protected override void OnLowBattery(LowBatteryEventArgs e)
67         {
68             Log.Fatal("NUI", "OnLowBattery() is called!");
69             base.OnLowBattery(e);
70         }
71
72         /// <summary>
73         /// Overrides this method if want to handle behavior.
74         /// </summary>
75         protected override void OnLowMemory(LowMemoryEventArgs e)
76         {
77             Log.Fatal("NUI", "OnLowMemory() is called!");
78             base.OnLowMemory(e);
79         }
80
81         /// <summary>
82         /// Overrides this method if want to handle behavior.
83         /// </summary>
84         protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
85         {
86             Log.Fatal("NUI", "OnRegionFormatChanged() is called!");
87             base.OnRegionFormatChanged(e);
88         }
89
90         /// <summary>
91         /// Overrides this method if want to handle behavior.
92         /// </summary>
93         protected override void OnTerminate()
94         {
95             Log.Fatal("NUI", "OnTerminate() is called!");
96             base.OnTerminate();
97         }
98
99         /// <summary>
100         /// Overrides this method if want to handle behavior.
101         /// </summary>
102         protected virtual void OnPreCreate()
103         {
104             Log.Fatal("NUI", "OnPreCreate() is called!");
105         }
106
107         /// <summary>
108         /// Overrides this method if want to handle behavior.
109         /// </summary>
110         protected override void OnCreate()
111         {
112             // This is also required to create DisposeQueue on main thread.
113             DisposeQueue disposeQ = DisposeQueue.Instance;
114             disposeQ.Initialize();
115             Log.Fatal("NUI","OnCreate() is called!");
116             base.OnCreate();
117         }
118
119         /// <summary>
120         /// Run NUIWidgetApplication.
121         /// </summary>
122         /// <param name="args">Arguments from commandline.</param>
123         /// <since_tizen> 4 </since_tizen>
124         public override void Run(string[] args)
125         {
126             Backend.AddEventHandler(EventType.PreCreated, OnPreCreate);
127             base.Run(args);
128         }
129
130         /// <summary>
131         /// Exit NUIWidgetApplication.
132         /// </summary>
133         /// <since_tizen> 4 </since_tizen>
134         public override void Exit()
135         {
136             Tizen.Log.Fatal("NUI", "### NUIWidgetApplication Exit called");
137             base.Exit();
138         }
139
140         internal WidgetApplication ApplicationHandle
141         {
142             get
143             {
144                 return ((NUIWidgetCoreBackend)this.Backend).WidgetApplicationHandle;
145             }
146         }
147     }
148 }