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

Plasma

soliddeviceengine.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright (C) 2007 Christopher Blauvelt <cblauvelt@gmail.com>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License version 2 as
00006  *   published by the Free Software Foundation
00007  *
00008  *   This program 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
00011  *   GNU General Public License for more details
00012  *
00013  *   You should have received a copy of the GNU Library General Public
00014  *   License along with this program; if not, write to the
00015  *   Free Software Foundation, Inc.,
00016  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00017  */
00018 
00019 #ifndef SOLIDDEVICEENGINE_H
00020 #define SOLIDDEVICEENGINE_H
00021 
00022 #include <QObject>
00023 #include <QString>
00024 #include <QList>
00025 #include <QMap>
00026 #include <QPair>
00027 
00028 #include <solid/devicenotifier.h>
00029 #include <solid/device.h>
00030 #include <solid/deviceinterface.h>
00031 #include <solid/predicate.h>
00032 
00033 #include "plasma/dataengine.h"
00034 #include "devicesignalmapmanager.h"
00035 #include "devicesignalmapper.h"
00036 #include "hddtemp.h"
00037 
00041 class SolidDeviceEngine : public Plasma::DataEngine
00042 {
00043     Q_OBJECT
00044 
00045 public:
00046     SolidDeviceEngine( QObject* parent, const QVariantList& args);
00047     ~SolidDeviceEngine();
00048 
00049 protected:
00050     bool sourceRequestEvent(const QString &name);
00051     bool updateSourceEvent(const QString& source);
00052 
00053 private:
00054     bool populateDeviceData(const QString &name);
00055     qlonglong freeDiskSpace(const QString &mountPoint);
00056     bool updateFreeSpace(const QString &udi);
00057     bool updateHardDiskTemperature(const QString &udi);
00058     void listenForNewDevices();
00059 
00060     //predicate in string form, list of devices by udi
00061     QMap<QString, QStringList> predicatemap;
00062     //udi, corresponding device
00063     QMap<QString, Solid::Device> devicemap;
00064     DeviceSignalMapManager *signalmanager;
00065 
00066     HddTemp *temperature;
00067     Solid::DeviceNotifier *notifier;
00068 
00069 private Q_SLOTS:
00070     void deviceAdded(const QString &udi);
00071     void deviceRemoved(const QString &udi);
00072     void deviceChanged(const QString& udi, const QString &property, const QVariant &value);
00073     void sourceRemoved(const QString &source);
00074 };
00075 
00076 K_EXPORT_PLASMA_DATAENGINE(soliddevice, SolidDeviceEngine)
00077 
00078 #endif

Plasma

Skip menu "Plasma"
  • 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
  •   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