Home · All Classes · Grouped Classes · Annotated · Functions

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.

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

PhonePowerManager (phone/phonepowermanager.cpp)

To extend Qtopia's 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 Qtopia 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.

This class is part of the Qtopia server and cannot be used by other Qtopia 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 Qtopia 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 © 2008 Nokia Trademarks
Qtopia 4.3.3