Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QtopiaPowerManager Class Reference

The QtopiaPowerManager class implements default device power management behaviour. More...

    #include <QtopiaPowerManager>

Inherits QObject and QWSScreenSaver.

Inherited by PhonePowerManager.

Public Functions

Static Public Members

Protected Functions

Additional Inherited Members

Detailed Description

The QtopiaPowerManager class implements default device power management behaviour.

Qt Extended provides an implementation for a phone device. These implementations support the following three timeouts and actions.

PhonePowerManager (phone/phonepowermanager.cpp)

To extend the default behaviour it is necessary to subclass either PhonePowerManager or QtopiaPowerManager. A minimal subclass of QtopiaPowerManager has to reimplement the following functions:

Applications can interact with the Qt Extended power management via the QtopiaPowerManagerService. For more details on how to utilize services see the Services documentation.

This class provides functionality to temporarily restrict power management. It might be necessary to surpress the diming of the backlight e.g., when the mediaplayer is showing a video or to prevent the suspension of the device when the user is playing music. The QtopiaPowerConstraintManager ensures that application cannot request restriction beyond their own life time.

ValueSpace pathDescription
/Hardware/ScreenSaver/CurrentLevelReturns current level of the screen saver. A value of zero means that the system is up and running and no power management option has been activated yet. This state is active while the user interacts with the device. The mapping of the remaining levels depends on this classes subclass that is in use (e.g. see PhonePowerManager).
/Hardware/ScreenSaver/Timeout/DimContains the number of seconds until the displays dims.
/Hardware/ScreenSaver/Timeout/LightOffContains the number of seconds until the display turns off. This timeout starts once the Dim state has been reached.
/Hardware/ScreenSaver/Timeout/SuspendContains the number of seconds until the system suspends. This timeout starts once the Lightoff state has been reached.
/Hardware/ScreenSaver/State/DimEnabledReturns true if display dimming is enabled; other false.
/Hardware/ScreenSaver/State/LightOffEnabledReturns true if turning the display of is part of the power management process; other false.
/Hardware/ScreenSaver/State/SuspendEnabledReturns true if the system will suspend; otherwise false.

This class is part of the Qt Extended server and cannot be used by other Qt Extended applications.

See also setIntervals(), save(), PhonePowerManager, QtopiaPowerManagerService, and QtopiaPowerConstraintManager.

Member Function Documentation

QtopiaPowerManager::QtopiaPowerManager ()

Constructs a QtopiaPowerManager instance.

void QtopiaPowerManager::forceSuspend ()   [virtual protected]

This function is called when the QtopiaPowerConstraintManager::forceSuspend() signal is emitted. The default implementation suspends the system using the Suspend service. Custom implementations may want to re-implement this method if suspending can be prevented so as to avoid processing the SystemSuspendHandler tasks.

void QtopiaPowerManager::restore ()   [virtual]

Restores the state of the device when power saving is active. This usually happens when the user interacts with the device.

Reimplemented from QWSScreenSaver.

bool QtopiaPowerManager::save ( int level )   [pure virtual]

This function is called by Qt Extended when a timeout has occurred and dynamically maps level onto a power saving action.

This function needs to be reimplemented by subclasses.

Reimplemented from QWSScreenSaver.

void QtopiaPowerManager::setActive ( bool on )   [static]

Activates or deactivates the power manager given the flag on. When activated, power management is enabled. When deactivated, power management is completely disabled.

void QtopiaPowerManager::setDefaultIntervals ()

Resets the intervals to the default configuration for the power manager. The default values are defined in configuration files and can be edited by the user using the Power Management application.

void QtopiaPowerManager::setIntervals ( int * v, int size )   [virtual]

This function sets the internal timeouts for the power manager. It expects an array v containing the timeout values and size being the number of entries in v. This allows any arbitrary number of power saving levels.

This function needs to be reimplemented by subclasses. However any overriding function should call QtopiaPowerManager::setIntervals() as part of its implementation.

Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3