• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libsolidcontrol

Solid::Control::PowerManager

Solid::Control::PowerManager Namespace Reference


Detailed Description

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

It's the unique 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

class  Notifier

Typedefs

typedef QHash< QString,
BrightnessControlType > 
BrightnessControlsList

Enumerations

enum  AcAdapterState { UnknownAcAdapterState, Plugged, Unplugged }
enum  BatteryState {
  NoBatteryState, Normal, Warning, Low,
  Critical
}
enum  BrightnessControlType { UnknownBrightnessControl = 0, Screen = 1, Keyboard = 2 }
enum  ButtonType {
  UnknownButtonType, PowerButton, SleepButton, LidOpen,
  LidClose
}
enum  CpuFreqPolicy {
  UnknownCpuFreqPolicy = 0, OnDemand = 1, Userspace = 2, Powersave = 4,
  Performance = 8, Conservative = 16
}
enum  SuspendMethod { UnknownSuspendMethod = 0, Standby = 1, ToRam = 2, ToDisk = 4 }

Functions

Solid::Control::PowerManager::AcAdapterState acAdapterState ()
int batteryChargePercent ()
Solid::Control::PowerManager::BatteryState batteryState ()
float brightness (const QString &device=QString())
Solid::Control::PowerManager::BrightnessControlsList brightnessControlsAvailable ()
bool canDisableCpu (int cpuNum)
Solid::Control::PowerManager::CpuFreqPolicy cpuFreqPolicy ()
Solid::Control::PowerManager::Notifier * notifier ()
QString scheme ()
QString schemeDescription (const QString &schemeName)
bool setBrightness (float brightness, const QString &device=QString())
bool setCpuEnabled (int cpuNum, bool enabled)
bool setCpuFreqPolicy (CpuFreqPolicy newPolicy)
bool setScheme (const QString &name)
Solid::Control::PowerManager::CpuFreqPolicies supportedCpuFreqPolicies ()
QStringList supportedSchemes ()
Solid::Control::PowerManager::SuspendMethods supportedSuspendMethods ()
KJob * suspend (SuspendMethod method)

Typedef Documentation

typedef QHash<QString, BrightnessControlType> Solid::Control::PowerManager::BrightnessControlsList

Definition at line 119 of file powermanager.h.


Enumeration Type Documentation

enum Solid::Control::PowerManager::AcAdapterState

This enum type defines the different states of the AC adapter.

  • UnknownAcAdapterState: The AC adapter has an unknown state
  • Plugged: The AC adapter is plugged
  • Unplugged: The AC adapter is unplugged
Enumerator:
UnknownAcAdapterState 
Plugged 
Unplugged 

Definition at line 65 of file powermanager.h.

enum Solid::Control::PowerManager::BatteryState

This enum type defines the different states of the system battery.

  • NoBatteryState: No battery available
  • Normal: The battery is at its normal charge level
  • Warning: The battery is at its warning charge level
  • Low: The battery is at its low charge level
  • Critical: The battery is at its critical charge level
Enumerator:
NoBatteryState 
Normal 
Warning 
Low 
Critical 

Definition at line 56 of file powermanager.h.

enum Solid::Control::PowerManager::BrightnessControlType

This type stores an OR combination of CpuFreqPolicy values.

This enum defines the different types of brightness controls.

  • UnknownBrightnessControl: Unknown
  • Screen: Brightness control for a monitor or laptop panel
  • Keyboard: Brightness control for a keyboard backlight
Enumerator:
UnknownBrightnessControl 
Screen 
Keyboard 

Definition at line 117 of file powermanager.h.

enum Solid::Control::PowerManager::ButtonType

This enum type defines the types of system button events.

  • UnknownButtonType: An unknown button
  • PowerButton: A power button pressed event, generally used to turn on or off the system
  • SleepButton: A sleep button pressed event, generally used to make the system asleep
  • LidOpen: A laptop lid open event
  • LidClose: A laptop lid close event
Enumerator:
UnknownButtonType 
PowerButton 
SleepButton 
LidOpen 
LidClose 

Definition at line 76 of file powermanager.h.

enum Solid::Control::PowerManager::CpuFreqPolicy

This type stores an OR combination of SuspendMethod values.

This enum type defines the different CPU frequency policies.

  • UnknownCpuFreqPolicy: The name says it all
  • OnDemand: Frequency is changed by the kernel depending on the processor load
  • Conservative: Frequency is changed by the kernel depending on the processor load; the stepping is less aggressive than OnDemand. This may be equivalent to OnDemand depending on the operating system.
  • Userspace: Frequency is changed by a userspace agent depending on the processor load
  • Powersave: Frequency is always set to the lowest available
  • Performance: Frequency is always set to the highest available
Enumerator:
UnknownCpuFreqPolicy 
OnDemand 
Userspace 
Powersave 
Performance 
Conservative 

Definition at line 103 of file powermanager.h.

enum Solid::Control::PowerManager::SuspendMethod

This enum type defines the different suspend methods.

  • UnknownSuspendMethod: The name says it all
  • Standby: Processes are stopped, some hardware is deactivated (ACPI S1)
  • ToRam: Most devices are deactivated, only RAM is powered (ACPI S3)
  • ToDisk: State of the machine is saved to disk, and it's powered down (ACPI S4)
Enumerator:
UnknownSuspendMethod 
Standby 
ToRam 
ToDisk 

Definition at line 86 of file powermanager.h.


Function Documentation

SOLIDCONTROL_EXPORT AcAdapterState Solid::Control::PowerManager::acAdapterState (  ) 

Retrieves the current state of the system AC adapter.

Returns:
the current AC adapter state
See also:
Solid::Control::PowerManager::AcAdapterState

Definition at line 88 of file powermanager.cpp.

SOLIDCONTROL_EXPORT int Solid::Control::PowerManager::batteryChargePercent (  ) 

Retrieves the current charge percentage of the system batteries.

Returns:
the current global battery charge percentage

Definition at line 82 of file powermanager.cpp.

SOLIDCONTROL_EXPORT BatteryState Solid::Control::PowerManager::batteryState (  ) 

Retrieves the current state of the system battery.

Returns:
the current battery state
See also:
Solid::Control::PowerManager::BatteryState

Definition at line 76 of file powermanager.cpp.

SOLIDCONTROL_EXPORT float Solid::Control::PowerManager::brightness ( const QString &  device = QString()  ) 

Gets the screen brightness.

Parameters:
device the name of the device that you would like to control
Returns:
the brightness of the device, as a percentage

Definition at line 168 of file powermanager.cpp.

SOLIDCONTROL_EXPORT BrightnessControlsList Solid::Control::PowerManager::brightnessControlsAvailable (  ) 

Checks if brightness controls are enabled on this system.

Returns:
a list of the devices available to control

Definition at line 136 of file powermanager.cpp.

SOLIDCONTROL_EXPORT bool Solid::Control::PowerManager::canDisableCpu ( int  cpuNum  ) 

Checks if a CPU can be disabled.

Parameters:
cpuNum the number of the CPU we want to check
Returns:
true if the given CPU can be disabled, false otherwise

Definition at line 124 of file powermanager.cpp.

SOLIDCONTROL_EXPORT CpuFreqPolicy Solid::Control::PowerManager::cpuFreqPolicy (  ) 

Retrieves the current CPU frequency policy of the system.

Returns:
the current CPU frequency policy used by the system
See also:
Solid::Control::PowerManager::CpuFreqPolicy

Definition at line 112 of file powermanager.cpp.

SOLIDCONTROL_EXPORT Notifier * Solid::Control::PowerManager::notifier (  ) 

Definition at line 190 of file powermanager.cpp.

SOLIDCONTROL_EXPORT QString Solid::Control::PowerManager::scheme (  ) 

Retrieves the name of the current power management scheme used by the system.

Returns:
the current scheme

Definition at line 65 of file powermanager.cpp.

SOLIDCONTROL_EXPORT QString Solid::Control::PowerManager::schemeDescription ( const QString &  schemeName  ) 

Retrieves a localized description corresponding to the given scheme.

Parameters:
schemeName the name of the scheme we request the description for
Returns:
the associated description

Definition at line 59 of file powermanager.cpp.

SOLIDCONTROL_EXPORT bool Solid::Control::PowerManager::setBrightness ( float  brightness,
const QString &  device = QString() 
)

Sets the screen brightness.

Parameters:
brightness the desired screen brightness, as a percentage
device the name of the device that you would like to control
Returns:
true if the brightness change succeeded, false otherwise

Definition at line 142 of file powermanager.cpp.

SOLIDCONTROL_EXPORT bool Solid::Control::PowerManager::setCpuEnabled ( int  cpuNum,
bool  enabled 
)

Enables or disables a CPU.

Parameters:
cpuNum the number of the CPU we want to enable or disable
enabled the new state of the CPU
Returns:
true if the state change succeeded, false otherwise

Definition at line 130 of file powermanager.cpp.

SOLIDCONTROL_EXPORT bool Solid::Control::PowerManager::setCpuFreqPolicy ( CpuFreqPolicy  newPolicy  ) 

Changes the current CPU frequency policy of the system.

Parameters:
newPolicy the new policy
Returns:
true if the policy change succeeded, false otherwise
See also:
Solid::Control::PowerManager::CpuFreqPolicy

Definition at line 118 of file powermanager.cpp.

SOLIDCONTROL_EXPORT bool Solid::Control::PowerManager::setScheme ( const QString &  name  ) 

Changes the current power management scheme.

Parameters:
name the name of the new scheme
Returns:
true if the scheme change succeeded, false otherwise

Definition at line 70 of file powermanager.cpp.

SOLIDCONTROL_EXPORT CpuFreqPolicies Solid::Control::PowerManager::supportedCpuFreqPolicies (  ) 

Retrieves the set of CPU frequency policies supported by the system.

Returns:
the CPU frequency policies supported by this system
See also:
Solid::Control::PowerManager::CpuFreqPolicy

Solid::Control::PowerManager::CpuFreqPolicies

Definition at line 106 of file powermanager.cpp.

SOLIDCONTROL_EXPORT QStringList Solid::Control::PowerManager::supportedSchemes (  ) 

Retrieves the list of power management schemes available on this system.

Returns:
the available power management schemes

Definition at line 53 of file powermanager.cpp.

SOLIDCONTROL_EXPORT SuspendMethods Solid::Control::PowerManager::supportedSuspendMethods (  ) 

Retrieves the set of suspend methods supported by the system.

Returns:
the suspend methods supported by this system
See also:
Solid::Control::PowerManager::SuspendMethod

Solid::Control::PowerManager::SuspendMethods

Definition at line 94 of file powermanager.cpp.

SOLIDCONTROL_EXPORT KJob * Solid::Control::PowerManager::suspend ( SuspendMethod  method  ) 

Requests a suspend of the system.

Parameters:
method the suspend method to use
Returns:
the job handling the operation

Definition at line 100 of file powermanager.cpp.

libsolidcontrol

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal