Tizen 2.0 Release
[samples/native/SystemApp.git] / project / inc / PowerPanel.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
18 #ifndef _POWER_PANEL_H_
19 #define _POWER_PANEL_H_
20
21 #include <FApp.h>
22 #include <FUi.h>
23 #include <FBase.h>
24 #include <FSystem.h>
25
26 class PowerPanel
27         : public Tizen::Ui::Controls::Panel
28         , public Tizen::Ui::IActionEventListener
29         , public Tizen::Ui::Scenes::ISceneEventListener
30         , public Tizen::System::IChargingEventListener
31         , public Tizen::System::IBatteryEventListener
32 {
33 public:
34                 PowerPanel(void);
35                 virtual ~PowerPanel(void);
36                 bool Initialize(void);
37
38                 virtual result OnInitializing(void);
39                 virtual result OnTerminating(void);
40                 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
41
42                 // IChargingEventListener
43             virtual void OnChargingStateChanged(bool charging);
44
45             // IBatteryEventListener
46             virtual void OnBatteryLevelChangedInPercentage(int percentage);
47
48                 // ISceneEventListener
49                 virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
50                                                                            const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
51                 virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
52                                                                                 const Tizen::Ui::Scenes::SceneId& nextSceneId);
53
54 private:
55                 Tizen::Ui::Controls::Button* __pButtonKeepScreenOn;
56                 Tizen::Ui::Controls::Button* __pButtonKeepScreenOff;
57                 Tizen::Ui::Controls::Button* __pButtonBrightness;
58                 Tizen::Ui::Controls::Button* __pButtonRestoreBrightness;
59                 Tizen::Ui::Controls::Slider* __pSliderBrightness;
60                 Tizen::Ui::Controls::Label* __pLabelBrightness;
61                 Tizen::Ui::Controls::Label* __pLabelChargingValue;
62                 Tizen::Ui::Controls::Label* __pLabelBatteryLevelValue;
63                 Tizen::Ui::Controls::Label* __pLabelBatteryStateValue;
64                 int __appBrightness;
65 };
66
67
68
69 #endif /* _POWER_PANEL_H_ */