• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Solid

  • Solid
  • PowerManagement
Classes | Enumerations | Functions
Solid::PowerManagement Namespace Reference

Classes

class  Notifier
 

Enumerations

enum  SleepState { StandbyState = 1, SuspendState = 2, HibernateState = 4, HybridSuspendState = 8 }
 

Functions

SOLID_EXPORT bool appShouldConserveResources ()
 
SOLID_EXPORT int beginSuppressingScreenPowerManagement (const QString &reason=QString())
 
SOLID_EXPORT int beginSuppressingSleep (const QString &reason=QString())
 
SOLID_EXPORT Notifier * notifier ()
 
SOLID_EXPORT void requestSleep (SleepState state, QObject *receiver, const char *member)
 
SOLID_EXPORT bool stopSuppressingScreenPowerManagement (int cookie)
 
SOLID_EXPORT bool stopSuppressingSleep (int cookie)
 
SOLID_EXPORT QSet< SleepState > supportedSleepStates ()
 

Detailed Description

This namespace allows to query the underlying system to obtain information about the hardware available.

It is the single entry point for power management. Applications should use it to control or query the power management features of the system.

Note that it's implemented as a singleton and encapsulates the backend logic.

Author
Kevin Ottens ervin.nosp@m.@kde.nosp@m..org

Enumeration Type Documentation

enum Solid::PowerManagement::SleepState

This enum type defines the different suspend methods.

  • StandbyState: Processes are stopped, some hardware is deactivated (ACPI S1)
  • SuspendState: Most devices are deactivated, only RAM is powered (ACPI S3)
  • HibernateState: State of the machine is saved to disk, and the machine is powered down (ACPI S4)
  • HybridSleepState: The contents of RAM are first copied to non-volatile storage like for regular hibernation, but then, instead of powering down, the computer enters sleep mode
Enumerator
StandbyState 
SuspendState 
HibernateState 
HybridSuspendState 
Since
4.11

Definition at line 54 of file powermanagement.h.

Function Documentation

bool Solid::PowerManagement::appShouldConserveResources ( )

Retrieves a high level indication of how applications should behave according to the power management subsystem.

For example, when on battery power, this method will return true.

Returns
whether apps should conserve power

Definition at line 78 of file powermanagement.cpp.

int Solid::PowerManagement::beginSuppressingScreenPowerManagement ( const QString &  reason = QString())

Tell the power management subsystem to suppress automatic screen power management until further notice.

Parameters
reasonGive a reason for not allowing screen power management, to be used in giving user feedback about why a screen power management event was prevented
Returns
a 'cookie' value representing the suppression request. Used by the power manager to track the application's outstanding suppression requests. Returns -1 if the request was denied.
Since
4.6

Definition at line 137 of file powermanagement.cpp.

int Solid::PowerManagement::beginSuppressingSleep ( const QString &  reason = QString())

Tell the power management subsystem to suppress automatic system sleep until further notice.

Parameters
reasonGive a reason for not allowing sleep, to be used in giving user feedback about why a sleep event was prevented
Returns
a 'cookie' value representing the suppression request. Used by the power manager to track the application's outstanding suppression requests. Returns -1 if the request was denied.

Definition at line 109 of file powermanagement.cpp.

Solid::PowerManagement::Notifier * Solid::PowerManagement::notifier ( )

Definition at line 189 of file powermanagement.cpp.

void Solid::PowerManagement::requestSleep ( SleepState  state,
QObject *  receiver,
const char *  member 
)

Requests that the system go to sleep.

Parameters
statethe sleep state use
receiverthe object to call a slot on once the operation completes
memberthe slot to call

Definition at line 88 of file powermanagement.cpp.

bool Solid::PowerManagement::stopSuppressingScreenPowerManagement ( int  cookie)

Tell the power management that a particular screen power management suppression is no longer needed.

When no more suppressions are active, the system will be free to handle screen power management automatically

Parameters
cookieThe cookie acquired when requesting screen power management suppression
Returns
true if the suppression was stopped, false if an invalid cookie was given
Note
Since 4.8, this function also inhibits screensaver
Since
4.6

Definition at line 168 of file powermanagement.cpp.

bool Solid::PowerManagement::stopSuppressingSleep ( int  cookie)

Tell the power management that a particular sleep suppression is no longer needed.

When no more suppressions are active, the system will be free to sleep automatically

Parameters
cookieThe cookie acquired when requesting sleep suppression
Returns
true if the suppression was stopped, false if an invalid cookie was given

Definition at line 127 of file powermanagement.cpp.

QSet< Solid::PowerManagement::SleepState > Solid::PowerManagement::supportedSleepStates ( )

Retrieves the set of suspend methods supported by the system.

Returns
the suspend methods supported by this system
See also
Solid::PowerManagement::SleepState

Definition at line 83 of file powermanagement.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Solid

Skip menu "Solid"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal