e11acf5e4aec9328ae3ca5c40775f8727b40f4ed
[platform/framework/native/appfw.git] / inc / FSysBattery.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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 /**
19  * @if OSPCOMPAT
20  * @file        FSysBattery.h
21  * @brief       This is the header file for the %Battery class.
22  *
23  * This header file contains the declarations of the %Battery class.
24  * @endif
25  */
26
27 #ifndef _FSYS_BATTERY_H_
28 #define _FSYS_BATTERY_H_
29
30 #include <FBaseObject.h>
31 #include <FSysPowerManager.h>
32
33 namespace Tizen { namespace System
34 {
35
36 /**
37  * @if OSPCOMPAT
38  * @if OSPDEPREC
39  * @class       Battery
40  * @brief       <i>[Deprecated]</i> This class provides methods to get information related to the battery charge.
41  *
42  * @since       2.0
43  *
44  * @deprecated  This class is deprecated. Instead of using this class, use the PowerManager class.
45  * @final       This class is not intended for extension.
46  *
47  * The %Battery class provides methods to get the status related to battery levels and
48  * determine whether the battery is currently being charged.
49  * You cannot create an instance of this class directly.
50  *
51  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/system/battery_status.htm">Battery Status</a>.
52  * @endif
53  * @endif
54  */
55 class _OSP_EXPORT_ Battery
56         : public Tizen::Base::Object
57 {
58
59 public:
60         /**
61          * Gets the current charge remaining in the battery as a percentage.
62          *
63          * @deprecated  This method is deprecated. Instead of using this method, use the PowerManager::GetCurrentBatteryLevelInPercentage() method.
64          * @since       2.0
65          *
66          * @return      An error code
67          * @param[out]  level   The percentage of the charge remaining in the battery
68          * @exception   E_SUCCESS       The method is successful.
69          * @exception   E_INVALID_STATE The battery service is not available.
70          * @exception   E_SYSTEM        The method cannot proceed due to a severe system error.
71          * @remarks The resolution of the level is 1% since 2.0. The range of the level is 0(Minimum) to 100(Maximum).
72          */
73         static result GetCurrentLevelInPercentage(int& level);
74
75         /**
76          * Gets the current charging level of the battery.
77          *
78          * @deprecated  This method is deprecated. Instead of using this method, use the PowerManager::GetCurrentBatteryLevel() method.
79          * @since       2.0
80          *
81          * @return      An error code
82          * @param[out]  level           A value from the enumerator BatteryLevel indicating the current charging level
83          * @exception   E_SUCCESS       The method is successful.
84          * @exception   E_INVALID_STATE The battery service is not available.
85          * @exception   E_SYSTEM        The method cannot proceed due to a severe system error.
86          */
87         static result GetCurrentLevel(BatteryLevel& level);
88
89         /**
90          * Checks whether the battery is currently charging.
91          *
92          * @deprecated  This method is deprecated. Instead of using this method, use the PowerManager::IsCharging() method.
93          * @since       2.0
94          *
95          * @return      An error code
96          * @param[out]  charging        Set to @c true if the charging cable is connected to the phone, @n
97          *                              else @c false
98          * @exception   E_SUCCESS       The method is successful.
99          * @exception   E_INVALID_STATE The battery service is not available.
100          * @exception   E_SYSTEM        The method cannot proceed due to a severe system error.
101          */
102         static result IsCharging(bool& charging);
103
104 private:
105         /**
106          * This is the default constructor for this class. This default constructor is intentionally declared as private so that only the platform can create an instance.
107          */
108         Battery(void);
109
110         /**
111          * This is the destructor for this class. 
112          * This destructor overrides Tizen::Base::Object::~Object(). @n
113          */
114         virtual ~Battery(void);
115
116         /**
117          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
118          */
119         Battery(const Battery& value);
120
121         /**
122          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
123          */
124         Battery& operator =(const Battery& value);
125
126 private:
127         friend class _BatteryImpl;
128 }; // Battery
129
130 } } // Tizen::System
131
132 #endif // _FSYS_BATTERY_H_