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 void listenForNewDevices();
60 //predicate in string form, list of devices by udi
61 QMap
<QString
, QStringList
> predicatemap
;
62 //udi, corresponding device
63 QMap
<QString
, Solid::Device
> devicemap
;
64 DeviceSignalMapManager
*signalmanager
;
67 Solid::DeviceNotifier
*notifier
;
70 void deviceAdded(const QString
&udi
);
71 void deviceRemoved(const QString
&udi
);
72 void deviceChanged(const QString
& udi
, const QString
&property
, const QVariant
&value
);
73 void sourceRemoved(const QString
&source
);
76 K_EXPORT_PLASMA_DATAENGINE(soliddevice
, SolidDeviceEngine
)