• Skip to content
  • Skip to link menu
KDE 4.1 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 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License version 2 as published by the Free Software Foundation.
00007 
00008     This library is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011     Library General Public License for more details.
00012 
00013     You should have received a copy of the GNU Library General Public License
00014     along with this library; see the file COPYING.LIB.  If not, write to
00015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016     Boston, MA 02110-1301, USA.
00017 
00018 */
00019 
00020 #ifndef SOLID_CONTROL_POWERMANAGER_H
00021 #define SOLID_CONTROL_POWERMANAGER_H
00022 
00023 #include <QtCore/QObject>
00024 #include <QtCore/QHash>
00025 
00026 #include "solid_control_export.h"
00027 
00028 class KJob;
00029 
00030 namespace Solid
00031 {
00032 namespace Control
00033 {
00045     namespace PowerManager
00046     {
00056         enum BatteryState{ NoBatteryState, Normal, Warning, Low, Critical };
00057 
00065         enum AcAdapterState{ UnknownAcAdapterState, Plugged, Unplugged };
00066 
00076         enum ButtonType{ UnknownButtonType, PowerButton, SleepButton, LidOpen, LidClose };
00077 
00086         enum SuspendMethod{ UnknownSuspendMethod = 0, Standby = 1, ToRam = 2, ToDisk = 4};
00087 
00091         Q_DECLARE_FLAGS(SuspendMethods, SuspendMethod)
00092 
00093         
00103         enum CpuFreqPolicy{ UnknownCpuFreqPolicy = 0, OnDemand = 1, Userspace = 2, Powersave = 4, Performance = 8, Conservative = 16 };
00104 
00108         Q_DECLARE_FLAGS(CpuFreqPolicies, CpuFreqPolicy)
00109 
00110         
00117         enum BrightnessControlType{ UnknownBrightnessControl = 0, Screen = 1, Keyboard = 2 };
00118 
00119         typedef QHash<QString, BrightnessControlType> BrightnessControlsList;
00120 
00121 
00127         SOLIDCONTROL_EXPORT QStringList supportedSchemes();
00128 
00135         SOLIDCONTROL_EXPORT QString schemeDescription(const QString &schemeName);
00136 
00143         SOLIDCONTROL_EXPORT QString scheme();
00144 
00151         SOLIDCONTROL_EXPORT bool setScheme(const QString &name);
00152 
00153 
00160         SOLIDCONTROL_EXPORT BatteryState batteryState();
00161 
00167         SOLIDCONTROL_EXPORT int batteryChargePercent();
00168 
00175         SOLIDCONTROL_EXPORT AcAdapterState acAdapterState();
00176 
00177 
00185         SOLIDCONTROL_EXPORT SuspendMethods supportedSuspendMethods();
00186 
00193         SOLIDCONTROL_EXPORT KJob *suspend(SuspendMethod method);
00194 
00195 
00203         SOLIDCONTROL_EXPORT CpuFreqPolicies supportedCpuFreqPolicies();
00204 
00211         SOLIDCONTROL_EXPORT CpuFreqPolicy cpuFreqPolicy();
00212 
00220         SOLIDCONTROL_EXPORT bool setCpuFreqPolicy(CpuFreqPolicy newPolicy);
00221 
00228         SOLIDCONTROL_EXPORT bool canDisableCpu(int cpuNum);
00229 
00237         SOLIDCONTROL_EXPORT bool setCpuEnabled(int cpuNum, bool enabled);
00238 
00244         SOLIDCONTROL_EXPORT BrightnessControlsList brightnessControlsAvailable();
00245 
00252         SOLIDCONTROL_EXPORT float brightness(const QString &device = QString());
00253 
00261         SOLIDCONTROL_EXPORT bool setBrightness(float brightness, const QString &device = QString());
00262 
00263         class SOLIDCONTROL_EXPORT Notifier : public QObject
00264         {
00265             Q_OBJECT
00266         Q_SIGNALS:
00272             void schemeChanged(QString newScheme);
00273 
00280             void acAdapterStateChanged(int newState);
00281 
00288             void batteryStateChanged(int newState);
00289 
00296             void buttonPressed(int buttonType);
00297 
00303              void brightnessChanged(float brightness);
00304         };
00305 
00306         SOLIDCONTROL_EXPORT Notifier *notifier();
00307     }
00308 }
00309 }
00310 
00311 Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::Control::PowerManager::SuspendMethods)
00312 Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::Control::PowerManager::CpuFreqPolicies)
00313 
00314 #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
  •   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