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