Home · All Classes · Grouped Classes · Annotated · Functions

QPowerStatus Class Reference

The QPowerStatus class represents a snapshot of the systems power status at a given time. More...

    #include <QPowerStatus>

Public Types

Public Functions

Related Non-Members


Detailed Description

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.


Member Type Documentation

enum QPowerStatus::ACStatus

The current state of AC power. AC power is usually equivalent to an "unlimited" wall provided source.

ConstantValueDescription
QPowerStatus::Offline0The device is running on battery
QPowerStatus::Online1The device is powered by an external power source
QPowerStatus::Backup2The device is running on backup power
QPowerStatus::Unknown3Status is unknown

enum QPowerStatus::BatteryStatus

The current battery state.

ConstantValueDescription
QPowerStatus::High0x01The battery is fully charged
QPowerStatus::Low0x02The battery level is low
QPowerStatus::VeryLow0x04The battery level is very low
QPowerStatus::Critical0x08The battery level is critical
QPowerStatus::Charging0x10The battery is being charged
QPowerStatus::NotPresent0x20The status of the battery is unknown


Member Function Documentation

QPowerStatus::QPowerStatus ()

Constructs a QPowerStatus object with default values. The default for each value is:

ValueDefault
QPowerStatus::acStatus()QPowerStatus::Offline
QPowerStatus::batteryStatus()QPowerStatus::NotPresent
QPowerStatus::backupBatteryStatus()QPowerStatus::NotPresent
QPowerStatus::batteryPercentAccurate()false
QPowerStatus::batteryPercentRemaining()-1
QPowerStatus::batteryTimeRemaining()-1

QPowerStatus::QPowerStatus ( const QPowerStatus & other )

Constructs a copy of other.

ACStatus QPowerStatus::acStatus () const

Returns the AC status of the device.

BatteryStatus QPowerStatus::backupBatteryStatus () const

Returns the status of the backup device battery, or QPowerStatus::NotPresent if the device has no backup battery.

bool QPowerStatus::batteryPercentAccurate () const

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.

int QPowerStatus::batteryPercentRemaining () const

Returns the remaining battery life (percentage of charge), or -1 if no information is available.

BatteryStatus QPowerStatus::batteryStatus () const

Returns the status of the primary device battery, or QPowerStatus::NotPresent if the device has no primary battery.

int QPowerStatus::batteryTimeRemaining () const

Returns the remaining battery life in seconds, or -1 if no information is available.

bool QPowerStatus::operator!= ( const QPowerStatus & ps )

Returns true if this power status is not equal to ps, otherwise returns false.


Related Non-Members

void qpe_setBrightness ( int bright )

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().

int 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