| Home · All Classes · Grouped Classes · Annotated · Functions |
The QPowerStatus class represents a snapshot of the systems power status at a given time. More...
#include <QPowerStatus>
The QPowerStatus class represents a snapshot of the systems power status at a given time.
The QPowerStatus class is a value class. The latest power information can be obtained by calling QPowerStatusManager::readStatus().
For example,
QPowerStatus status = QPowerStatusManager::readStatus();
if(status.acStatus() == QPowerStatus::Offline)
qWarning() << "The device is not plugged into AC power!";
Note: Use of the QPowerStatus class is discouraged. Its API and functionality has been improved in future versions of Qtopia.
See also QPowerStatusManager.
The current state of AC power. AC power is usually equivalent to an "unlimited" wall provided source.
| Constant | Value | Description |
|---|---|---|
| QPowerStatus::Offline | 0 | The device is running on battery |
| QPowerStatus::Online | 1 | The device is powered by an external power source |
| QPowerStatus::Backup | 2 | The device is running on backup power |
| QPowerStatus::Unknown | 3 | Status is unknown |
The current battery state.
| Constant | Value | Description |
|---|---|---|
| QPowerStatus::High | 0x01 | The battery is fully charged |
| QPowerStatus::Low | 0x02 | The battery level is low |
| QPowerStatus::VeryLow | 0x04 | The battery level is very low |
| QPowerStatus::Critical | 0x08 | The battery level is critical |
| QPowerStatus::Charging | 0x10 | The battery is being charged |
| QPowerStatus::NotPresent | 0x20 | The status of the battery is unknown |
Constructs a QPowerStatus object with default values. The default for each value is:
Constructs a copy of other.
Returns the AC status of the device.
Returns the status of the backup device battery, or QPowerStatus::NotPresent if the device has no backup battery.
Some battery sources cannot accuractely provide capacity information. This method returns true if the value returned by batteryPercentRemaining() reflects the true value of remaining battery.
Returns the remaining battery life (percentage of charge), or -1 if no information is available.
Returns the status of the primary device battery, or QPowerStatus::NotPresent if the device has no primary battery.
Returns the remaining battery life in seconds, or -1 if no information is available.
Returns true if this power status is not equal to ps, otherwise returns false.
Sets the brightness of the device's LCD backlight/frontlight to bright.
bright represents the LCD backlight/frontlight brightness as an integer between 0 and 255. A value of 0 means that the LCD display should be turned off. Values between 1 and 255 are interpreted as varying brightness levels with 1 representing the dimmest level and 255 the brightest.
This function must be implemented in the custom-<platform-spec>.cpp file by the system integrator, see Hardware Configuration for details. It may be necessary for the implementation of this function to convert bright to a device specific brightness level, as returned by qpe_sysBrightnessSteps().
See also qpe_sysBrightnessSteps().
Returns the number of graduations supported by the device's LCD backlight/frontlight.
This function must be implemented in the custom-<platform-spec>.cpp file by the system integrator, see Hardware Configuration for details.
See also qpe_setBrightness().
| Copyright © 2007 Trolltech | Trademarks | Qtopia 4.2.5 |