[BasicApp] Change license statements
[apps/native/sample/BasicApp.git] / project / inc / BasicApp.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 #ifndef _BASIC_APP_H_
18 #define _BASIC_APP_H_
19
20 #include <FApp.h>
21 #include <FBase.h>
22 #include <FSystem.h>
23
24 //application must inherit from Application class
25 //which provides basic features necessary to define an application.
26
27 class BasicApp
28         : public Tizen::App::Application
29         , public Tizen::System::IScreenEventListener
30 {
31 public:
32         //[HelloWorld] application must have a factory method that creates an instance of itself.
33         static Tizen::App::Application* CreateInstance(void);
34
35 public:
36         BasicApp(void);
37         virtual ~BasicApp(void);
38
39         // Called when the application is initializing.
40         virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
41
42         //Called when the application is terminating.
43         virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
44
45         //Called when the application's frame moves to the top of the screen.
46         virtual void OnForeground(void);
47
48         //Called when this application's frame is moved from top of the screen to the background.
49         virtual void OnBackground(void);
50
51         //Called when the system memory is not sufficient to run the application any further.
52         virtual void OnLowMemory(void);
53
54         // Called when the battery level changes.
55         virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
56
57         // Called when the screen turns on.
58         virtual void OnScreenOn (void);
59
60         // Called when the screen turns off.
61         virtual void OnScreenOff (void);
62 };
63
64 #endif