Add code versioning for "SettingInfo TC"
[platform/framework/native/appfw.git] / src / system / inc / FSys_PowerManagerImpl.h
1 //
2 // Copyright (c) 2012 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  * @file                FSys_PowerManagerImpl.h
19  * @brief               This is the header file for the _PowerManagerImpl class.
20  */
21
22
23 #ifndef _FSYS_INTERNAL_POWERMANAGER_IMPL_H_
24 #define _FSYS_INTERNAL_POWERMANAGER_IMPL_H_
25
26 #include <FOspConfig.h>
27 #include <FBaseObject.h>
28 #include <FSysPowerManager.h>
29 #include <FSys_IPowerManagerEventListener.h>
30
31 namespace Tizen { namespace System
32 {
33
34 class IScreenEventListener;
35 class IChargingEventListener;
36 class IBatteryEventListener;
37
38 /**
39  * @class               _PowerManagerImpl
40  * @brief               This class provides methods for power management.
41  *
42  */
43 class _OSP_EXPORT_ _PowerManagerImpl
44         : public Tizen::Base::Object
45 {
46
47 public:
48         static int      GetScreenBrightness(void);
49         static bool     GetScreenState(void);
50         static result   InitBatteryEvent(void);
51         static bool     IsScreenOn(void);
52         static result   KeepCpuAwake(bool enable);
53         static result   KeepScreenOnState(bool keepOn, bool dimming = true);
54         static result   OnBackground(void);
55         static result   OnForeground(void);
56         static result   RestoreScreenBrightness(void);
57         static result   SetScreenBrightness(int brightness);
58         static result   SetBatteryEventListener(IBatteryEventListener* pListener);
59
60         static void     SetChargingEventListener(IChargingEventListener& listener);
61         static result   AddChargingEventListener(IChargingEventListener& listener, bool isSet = false);
62         static result   RemoveChargingEventListener(IChargingEventListener& listener);
63
64         static void     SetScreenEventListener(IScreenEventListener& listener);
65         static result   AddScreenEventListener(IScreenEventListener& listener, bool isSet = false);
66         static result   RemoveScreenEventListener(IScreenEventListener& listener);
67         static result   TurnScreenOff(void);
68         static result   TurnScreenOn(void);
69
70         static result   AddBootEventListener(IBootEventListener& listener);
71         static result   RemoveBootEventListener(IBootEventListener& listener);
72
73         static result   PowerControl(int deviceId, int level);
74         static bool     IsActive(void);
75
76         static int GetCurrentBatteryLevelInPercentage(void);
77         static BatteryLevel GetCurrentBatteryLevel(void);
78         static bool IsCharging(void);
79
80         static result Add_IPowerManagerEventListener(_IPowerManagerEventListener* listener);
81         static result Remove_IPowerManagerEventListener(_IPowerManagerEventListener* listener);
82
83         static _PowerManagerImpl* GetInstance(PowerManager& powerManager);
84         static const _PowerManagerImpl* GetInstance(const PowerManager& powerManager);
85         
86
87 private:
88         
89         _PowerManagerImpl(void);
90         virtual ~_PowerManagerImpl(void);
91
92         static void     Init();
93         static void     Term();
94
95         static bool     _InitPowerManager;
96 };
97
98 } }
99
100 #endif //_FSYS_INTERNAL_POWERMANAGER_IMPL_H_