libsolidcontrol
powermanager.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2006 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_IFACES_POWERMANAGER_H 00022 #define SOLID_IFACES_POWERMANAGER_H 00023 00024 #include <QtCore/QObject> 00025 #include <QtCore/QStringList> 00026 00027 #include "../solid_control_export.h" 00028 00029 #include "../powermanager.h" 00030 00031 class KJob; 00032 00033 namespace Solid 00034 { 00035 namespace Control 00036 { 00037 namespace Ifaces 00038 { 00046 class SOLIDCONTROLIFACES_EXPORT PowerManager : public QObject 00047 { 00048 Q_OBJECT 00049 00050 public: 00054 PowerManager(QObject *parent = 0); 00055 00059 virtual ~PowerManager(); 00060 00061 00067 virtual QStringList supportedSchemes() const = 0; 00068 00075 virtual QString schemeDescription(const QString &schemeName) const = 0; 00076 00083 virtual QString scheme() const = 0; 00084 00091 virtual bool setScheme(const QString &name) = 0; 00092 00093 00100 virtual Solid::Control::PowerManager::BatteryState batteryState() const = 0; 00101 00107 virtual int batteryChargePercent() const = 0; 00108 00114 virtual int batteryRemainingTime() const = 0; 00115 00122 virtual Solid::Control::PowerManager::AcAdapterState acAdapterState() const = 0; 00123 00124 00132 virtual Solid::Control::PowerManager::SuspendMethods supportedSuspendMethods() const = 0; 00133 00140 virtual KJob *suspend(Solid::Control::PowerManager::SuspendMethod method) const = 0; 00141 00142 00150 virtual Solid::Control::PowerManager::CpuFreqPolicies supportedCpuFreqPolicies() const = 0; 00151 00158 virtual Solid::Control::PowerManager::CpuFreqPolicy cpuFreqPolicy() const = 0; 00159 00167 virtual bool setCpuFreqPolicy(Solid::Control::PowerManager::CpuFreqPolicy newPolicy) = 0; 00168 00175 virtual bool canDisableCpu(int cpuNum) const = 0; 00176 00184 virtual bool setCpuEnabled(int cpuNum, bool enabled) = 0; 00185 00191 virtual Solid::Control::PowerManager::BrightnessControlsList brightnessControlsAvailable() = 0; 00192 00199 virtual float brightness(const QString &device = QString()) = 0; 00200 00208 virtual bool setBrightness(float brightness, const QString &panel = QString()) = 0; 00209 00210 Q_SIGNALS: 00216 void schemeChanged(QString newScheme); 00217 00224 void acAdapterStateChanged(int newState); 00225 00232 void batteryStateChanged(int newState); 00233 00240 void buttonPressed(int buttonType); 00241 00247 void brightnessChanged(float brightness); 00248 00254 void batteryRemainingTimeChanged(int time); 00255 }; 00256 } 00257 } 00258 } 00259 00260 #endif