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

libsolidcontrol

powermanager.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2006-2007 Kevin Ottens <ervin@kde.org>
00003     Copyright (C) 2008 Dario Freddi <drf54321@gmail.com>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License version 2 as published by the Free Software Foundation.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 
00019 */
00020 
00021 #ifndef SOLID_CONTROL_POWERMANAGER_H
00022 #define SOLID_CONTROL_POWERMANAGER_H
00023 
00024 #include <QtCore/QObject>
00025 #include <QtCore/QHash>
00026 
00027 #include "solid_control_export.h"
00028 
00029 class KJob;
00030 
00031 namespace Solid
00032 {
00033 namespace Control
00034 {
00046     namespace PowerManager
00047     {
00057         enum BatteryState{ NoBatteryState, Normal, Warning, Low, Critical };
00058 
00066         enum AcAdapterState{ UnknownAcAdapterState, Plugged, Unplugged };
00067 
00077         enum ButtonType{ UnknownButtonType, PowerButton, SleepButton, LidOpen, LidClose };
00078 
00087         enum SuspendMethod{ UnknownSuspendMethod = 0, Standby = 1, ToRam = 2, ToDisk = 4};
00088 
00092         Q_DECLARE_FLAGS(SuspendMethods, SuspendMethod)
00093 
00094         
00104         enum CpuFreqPolicy{ UnknownCpuFreqPolicy = 0, OnDemand = 1, Userspace = 2, Powersave = 4, Performance = 8, Conservative = 16 };
00105 
00109         Q_DECLARE_FLAGS(CpuFreqPolicies, CpuFreqPolicy)
00110 
00111         
00118         enum BrightnessControlType{ UnknownBrightnessControl = 0, Screen = 1, Keyboard = 2 };
00119 
00120         typedef QHash<QString, BrightnessControlType> BrightnessControlsList;
00121 
00122 
00128         SOLIDCONTROL_EXPORT QStringList supportedSchemes();
00129 
00136         SOLIDCONTROL_EXPORT QString schemeDescription(const QString &schemeName);
00137 
00144         SOLIDCONTROL_EXPORT QString scheme();
00145 
00152         SOLIDCONTROL_EXPORT bool setScheme(const QString &name);
00153 
00154 
00161         SOLIDCONTROL_EXPORT BatteryState batteryState();
00162 
00168         SOLIDCONTROL_EXPORT int batteryChargePercent();
00169 
00175         SOLIDCONTROL_EXPORT int batteryRemainingTime();
00176 
00183         SOLIDCONTROL_EXPORT AcAdapterState acAdapterState();
00184 
00185 
00193         SOLIDCONTROL_EXPORT SuspendMethods supportedSuspendMethods();
00194 
00201         SOLIDCONTROL_EXPORT KJob *suspend(SuspendMethod method);
00202 
00203 
00211         SOLIDCONTROL_EXPORT CpuFreqPolicies supportedCpuFreqPolicies();
00212 
00219         SOLIDCONTROL_EXPORT CpuFreqPolicy cpuFreqPolicy();
00220 
00228         SOLIDCONTROL_EXPORT bool setCpuFreqPolicy(CpuFreqPolicy newPolicy);
00229 
00236         SOLIDCONTROL_EXPORT bool canDisableCpu(int cpuNum);
00237 
00245         SOLIDCONTROL_EXPORT bool setCpuEnabled(int cpuNum, bool enabled);
00246 
00252         SOLIDCONTROL_EXPORT BrightnessControlsList brightnessControlsAvailable();
00253 
00260         SOLIDCONTROL_EXPORT float brightness(const QString &device = QString());
00261 
00269         SOLIDCONTROL_EXPORT bool setBrightness(float brightness, const QString &device = QString());
00270 
00271         class SOLIDCONTROL_EXPORT Notifier : public QObject
00272         {
00273             Q_OBJECT
00274         Q_SIGNALS:
00280             void schemeChanged(QString newScheme);
00281 
00288             void acAdapterStateChanged(int newState);
00289 
00296             void batteryStateChanged(int newState);
00297 
00304             void buttonPressed(int buttonType);
00305 
00311              void brightnessChanged(float brightness);
00312 
00318              void batteryRemainingTimeChanged(int time);
00319         };
00320 
00321         SOLIDCONTROL_EXPORT Notifier *notifier();
00322     }
00323 }
00324 }
00325 
00326 Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::Control::PowerManager::SuspendMethods)
00327 Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::Control::PowerManager::CpuFreqPolicies)
00328 
00329 #endif

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