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

Engines

powermanagementengine.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2007 Aaron Seigo <aseigo@kde.org>
00003  *   Copyright 2007-2008 Sebastian Kuegler <sebas@kde.org>
00004  *   Copyright 2008 Dario Freddi <drf54321@gmail.com>
00005  *
00006  *   This program is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU Library General Public License version 2 as
00008  *   published by the Free Software Foundation
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details
00014  *
00015  *   You should have received a copy of the GNU Library General Public
00016  *   License along with this program; if not, write to the
00017  *   Free Software Foundation, Inc.,
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 #ifndef POWERMANAGEMENTENGINE_H
00022 #define POWERMANAGEMENTENGINE_H
00023 
00024 #include <Plasma/DataEngine>
00025 
00026 #include <solid/battery.h>
00027 #include <solid/acadapter.h>
00028 
00029 #include <QtDBus/QDBusConnection>
00030 #include <QHash>
00031 
00036 class PowermanagementEngine : public Plasma::DataEngine
00037 {
00038     Q_OBJECT
00039 
00040 public:
00041     PowermanagementEngine( QObject* parent, const QVariantList& args );
00042     ~PowermanagementEngine();
00043     QStringList sources() const;
00044 
00045 protected:
00046     bool sourceRequestEvent(const QString &name);
00047     void init();
00048 
00049 private slots:
00050     void updateBatteryChargeState(int newState, const QString& udi);
00051     void updateBatteryPlugState(bool newState, const QString& udi);
00052     void updateBatteryChargePercent(int newValue, const QString& udi);
00053     void updateAcPlugState(bool newState);
00054     void deviceRemoved(const QString& udi);
00055     void deviceAdded(const QString& udi);
00056     void profilesChanged(const QString &current, const QStringList &profiles);
00057     void batteryRemainingTimeChanged(int time);
00058 
00059 private:
00060     Solid::AcAdapter* m_acadapter;
00061     QStringList m_sources;
00062     QDBusConnection m_dbus;
00063 
00064     QHash<QString, QString> m_batterySources;
00065 
00066 };
00067 
00068 K_EXPORT_PLASMA_DATAENGINE(powermanagement, PowermanagementEngine)
00069 
00070 #endif

Engines

Skip menu "Engines"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

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