Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / plasma / dataengines / soliddevice / devicesignalmapper.h
blob4176f0be58eb17e300e47db65d9d0749689fdebb
1 /*
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 DEVICE_SIGNAL_MAPPER_H
20 #define DEVICE_SIGNAL_MAPPER_H
22 #include <QObject>
23 #include <QSignalMapper>
24 #include <QMap>
26 #include <KDebug>
28 #include <solid/devicenotifier.h>
29 #include <solid/device.h>
30 #include <solid/processor.h>
31 #include <solid/block.h>
32 #include <solid/storageaccess.h>
33 #include <solid/storagedrive.h>
34 #include <solid/opticaldrive.h>
35 #include <solid/storagevolume.h>
36 #include <solid/opticaldisc.h>
37 #include <solid/camera.h>
38 #include <solid/portablemediaplayer.h>
39 #include <solid/networkinterface.h>
40 #include <solid/acadapter.h>
41 #include <solid/battery.h>
42 #include <solid/button.h>
43 #include <solid/audiointerface.h>
44 #include <solid/dvbinterface.h>
46 class DeviceSignalMapper : public QSignalMapper
48 Q_OBJECT
50 public:
51 DeviceSignalMapper(QObject *parent=0);
52 ~DeviceSignalMapper();
54 void setMapping(QObject* device, const QString &udi);
56 Q_SIGNALS:
57 void deviceChanged(const QString& udi, const QString &property, QVariant value);
59 protected:
60 QMap<QObject*, QString> signalmap;
63 class AcAdapterSignalMapper : public DeviceSignalMapper
65 Q_OBJECT
67 public:
68 AcAdapterSignalMapper(QObject *parent=0);
69 ~AcAdapterSignalMapper();
71 public Q_SLOTS:
72 void plugStateChanged(bool newState);
75 class ButtonSignalMapper : public DeviceSignalMapper
77 Q_OBJECT
79 public:
80 ButtonSignalMapper(QObject *parent=0);
81 ~ButtonSignalMapper();
83 public Q_SLOTS:
84 void pressed(Solid::Button::ButtonType type);
87 class BatterySignalMapper : public DeviceSignalMapper
89 Q_OBJECT
91 public:
92 BatterySignalMapper(QObject *parent=0);
93 ~BatterySignalMapper();
95 public Q_SLOTS:
96 void chargePercentChanged(int value);
97 void chargeStateChanged(int newState);
98 void plugStateChanged(bool newState);
101 class StorageAccessSignalMapper : public DeviceSignalMapper
103 Q_OBJECT
105 public:
106 StorageAccessSignalMapper(QObject *parent=0);
107 ~StorageAccessSignalMapper();
109 public Q_SLOTS:
110 void accessibilityChanged(bool accessible);
113 #endif