![]() |

Section Contents
|
MBasicGsmPhoneBatteryAndPower |
Mixin: interface for accessing a phones battery and power information. |
etelbgsm.h
gsmbas.lib
This class defines the protocol for accessing phone battery and power information.
protected: MBasicGsmPhoneBatteryAndPower()
The default C++ constructor is protected, which prevents objects of this class from being constructed. This class is intended only as an abstract base for other classes.
virtual TInt GetBatteryPowerCaps(TBatteryAndPowerCapsFlags& aCaps) const=0;
This function allows clients to determine whether a phone has the ability to retrieve battery and power information.
|
TBatteryAndPowerCapsFlags& aCaps |
On return, contains the phones power information retrieval capabilities. |
|
TInt |
An error code: see System error codes. |
virtual TInt GetBatteryInfo(TBatteryInfo& aBatteryInfo) const=0;
This synchronous function retrieves information about the phones current power supply and charge level.
|
TBatteryInfo& aBatteryInfo |
On return, contains the current status of the phone power supply and battery charge. |
|
TInt |
An error code: see System error codes. |
virtual void GetBatteryInfo(TRequestStatus& aStatus, TBatteryInfo& aBatteryInfo)=0;
This asynchronous function retrieves information about the phones current power supply and charge level.
|
TRequestStatus& aStatus |
A variable that indicates the completion status of the request. |
|
TBatteryInfo& aBatteryInfo |
On request completion, contains the current status of the phone power supply and battery charge. |
virtual void GetBatteryInfoCancel() const=0;
This function cancels an outstanding Get battery information request, placed using the asynchronous variant of the GetBatteryInfo() function.
virtual void BatteryInfoNotification(TRequestStatus& aStatus,TBatteryInfo& aBatteryInfo)=0;
This function requests notification of a change in the phones current power supply or charge level.
|
TRequestStatus& aStatus |
A variable that indicates the completion status of the request. |
|
TBatteryInfo& aBatteryInfo |
On request completion, contains the new power supply and charge level information. |
virtual void BatteryInfoNotificationCancel() const=0;
This function cancels an outstanding notification request to receive battery change information, placed with the BatteryInfoNotification() function.
|
Indicates that battery information is available. |
|
|
Indicates that asynchronous battery change notifications are supported. |
|
The phone is currently powered by a battery. |
|
|
A battery is connected, but the phone is externally powered. |
|
|
No battery is connected. |
|
|
Power fault. |
|
TUint iBatteryInfoCaps |
A bitmask of the TBatteryPowerCaps constants. |
|
TBatteryStatus iStatus |
The power and battery status. |
|
TUint iChargeLevel |
The battery charge level (as a percentage). |
|
|