2
* Copyright (C) 2007 Christopher Blauvelt <cblauvelt@gmail.com>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Library General Public License version 2 as
6
* published by the Free Software Foundation
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details
13
* You should have received a copy of the GNU Library General Public
14
* License along with this program; if not, write to the
15
* Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
#ifndef SOLIDDEVICEENGINE_H
20
#define SOLIDDEVICEENGINE_H
28
#include <solid/devicenotifier.h>
29
#include <solid/device.h>
30
#include <solid/deviceinterface.h>
31
#include <solid/predicate.h>
33
#include <Plasma/DataEngine>
34
#include "devicesignalmapmanager.h"
35
#include "devicesignalmapper.h"
39
* This class evaluates the basic expressions given in the interface.
41
class SolidDeviceEngine : public Plasma::DataEngine
46
SolidDeviceEngine( QObject* parent, const QVariantList& args);
50
bool sourceRequestEvent(const QString &name);
51
bool updateSourceEvent(const QString& source);
54
bool populateDeviceData(const QString &name);
55
qlonglong freeDiskSpace(const QString &mountPoint);
56
bool updateFreeSpace(const QString &udi);
57
bool updateHardDiskTemperature(const QString &udi);
58
bool updateEmblems(const QString &udi);
59
bool forceUpdateAccessibility(const QString &udi);
60
void listenForNewDevices();
62
//predicate in string form, list of devices by udi
63
QMap<QString, QStringList> predicatemap;
64
//udi, corresponding device
65
QMap<QString, Solid::Device> devicemap;
66
//udi, corresponding encrypted container udi;
67
QMap<QString, QString> encryptedContainerMap;
68
DeviceSignalMapManager *signalmanager;
71
Solid::DeviceNotifier *notifier;
74
void deviceAdded(const QString &udi);
75
void deviceRemoved(const QString &udi);
76
void deviceChanged(const QString& udi, const QString &property, const QVariant &value);
77
void sourceWasRemoved(const QString &source);
80
K_EXPORT_PLASMA_DATAENGINE(soliddevice, SolidDeviceEngine)