# Namespace Solid.PowerManagement

Module | solid
Namespace | Solid.PowerManagement

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@kde.org>

### classes

### enums

- SleepState { StandbyState, SuspendState, HibernateState }

enum details

### methods

- appShouldConserveResources ( )

  returns bool

  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

- beginSuppressingSleep (reason)

  returns int

  Argument | Type | Default
  --- | --- | ---
  reason | QString | QString()

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

  reason - Give 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.

- notifier ( )

  returns Solid::PowerManagement.Notifier
  Not implemented

- requestSleep (state, receiver, member)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  state | Solid::PowerManagement.SleepState |
  receiver | QObject |
  member | char |

  Requests that the system goes to sleep

  state - the sleep state use

  receiver - the object to call a slot on once the operation completes

  member - the slot to call

- stopSuppressingSleep (cookie)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  cookie | int |

  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

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

- supportedSleepStates ( )

  returns QSet<Solid::PowerManagement::SleepState>

  Retrieves the set of suspend methods supported by the system.

  Returns the suspend methods supported by this system

  See also Solid.PowerManager.SuspendMethod

  See also Solid.PowerManager.SuspendMethods

### enums - detail

- SleepState { StandbyState, SuspendState, HibernateState }

  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)

  | StandbyState | - 1 | - |
  | SuspendState | - 2 | - |
  | HibernateState | - 4 | - |