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

libsolidcontrol

Solid::Control::PowerManager

Solid::Control::PowerManager Namespace Reference

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


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

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

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>


Typedef Documentation

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

Definition at line 120 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 66 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 57 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 118 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 77 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 104 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 87 of file powermanager.h.


Function Documentation

Solid::Control::PowerManager::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 96 of file powermanager.cpp.

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

Retrieves the current charge percentage of the system batteries.

Returns:
the current global battery charge percentage

Definition at line 84 of file powermanager.cpp.

int Solid::Control::PowerManager::batteryRemainingTime (  ) 

Retrieves the current estimated remaining time of the system batteries.

Returns:
the current global estimated remaining time in milliseconds

Definition at line 90 of file powermanager.cpp.

Solid::Control::PowerManager::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 78 of file powermanager.cpp.

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 176 of file powermanager.cpp.

Solid::Control::PowerManager::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 144 of file powermanager.cpp.

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 132 of file powermanager.cpp.

Solid::Control::PowerManager::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 120 of file powermanager.cpp.

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

Definition at line 198 of file powermanager.cpp.

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 67 of file powermanager.cpp.

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 61 of file powermanager.cpp.

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 150 of file powermanager.cpp.

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 138 of file powermanager.cpp.

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 126 of file powermanager.cpp.

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 72 of file powermanager.cpp.

Solid::Control::PowerManager::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 114 of file powermanager.cpp.

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 55 of file powermanager.cpp.

Solid::Control::PowerManager::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 102 of file powermanager.cpp.

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 108 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
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
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