Tizen 2.1 base
[sdk/ide/native-sample.git] / samples / native / partner / cpp / Sample / Tizen C++ / UiVisualElement / UiVisualElement / project / inc / UiVisualElement.h
1 //
2 // Tizen C++ SDK
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.tizenopensource.org/license
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 #ifndef _UI_VISUAL_ELEMENT_H_
18 #define _UI_VISUAL_ELEMENT_H_
19
20 #include <FApp.h>
21 #include <FBase.h>
22 #include <FSystem.h>
23 #include <FUi.h>
24
25 /**
26  * [UiVisualElement] UiApp must inherit from UiApp class
27  * which provides basic features necessary to define an UiApp.
28  */
29 class UiVisualElement
30         : public Osp::App::UiApp
31         , public Osp::System::IScreenEventListener
32 {
33 public:
34         /**
35          * [Test] UiApp must have a factory method that creates an instance of itself.
36          */
37         static Osp::App::UiApp* CreateInstance(void);
38
39 public:
40         UiVisualElement(void);
41         ~UiVisualElement(void);
42
43 public:
44         // Called when the UiApp is initializing.
45         bool OnAppInitializing(Osp::App::AppRegistry& appRegistry);
46
47         // Called when the UiApp initializing is finished. 
48         bool OnAppInitialized(void); 
49
50         // Called when the UiApp is requested to terminate. 
51         bool OnAppWillTerminate(void); 
52
53         // Called when the UiApp is terminating.
54         bool OnAppTerminating(Osp::App::AppRegistry& appRegistry, bool forcedTermination = false);
55
56         // Called when the UiApp's frame moves to the top of the screen.
57         void OnForeground(void);
58
59         // Called when this UiApp's frame is moved from top of the screen to the background.
60         void OnBackground(void);
61
62         // Called when the system memory is not sufficient to run the UiApp any further.
63         void OnLowMemory(void);
64
65         // Called when the battery level changes.
66         void OnBatteryLevelChanged(Osp::System::BatteryLevel batteryLevel);
67
68         // Called when the screen turns on.
69         void OnScreenOn (void);
70
71         // Called when the screen turns off.
72         void OnScreenOff (void);
73 };
74
75 #endif // _UI_VISUAL_ELEMENT_H_