not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / plasma / dataengines / soliddevice / devicesignalmapper.h
blobe74674741229c7e8a13ba043e04421b535aaf6c1
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>
45 #include <solid/video.h>
47 class DeviceSignalMapper : public QSignalMapper
49 Q_OBJECT
51 public:
52 DeviceSignalMapper(QObject *parent=0);
53 ~DeviceSignalMapper();
55 void setMapping(QObject* device, const QString &udi);
57 Q_SIGNALS:
58 void deviceChanged(const QString& udi, const QString &property, QVariant value);
60 protected:
61 QMap<QObject*, QString> signalmap;
64 class AcAdapterSignalMapper : public DeviceSignalMapper
66 Q_OBJECT
68 public:
69 AcAdapterSignalMapper(QObject *parent=0);
70 ~AcAdapterSignalMapper();
72 public Q_SLOTS:
73 void plugStateChanged(bool newState);
76 class ButtonSignalMapper : public DeviceSignalMapper
78 Q_OBJECT
80 public:
81 ButtonSignalMapper(QObject *parent=0);
82 ~ButtonSignalMapper();
84 public Q_SLOTS:
85 void pressed(Solid::Button::ButtonType type);
88 class BatterySignalMapper : public DeviceSignalMapper
90 Q_OBJECT
92 public:
93 BatterySignalMapper(QObject *parent=0);
94 ~BatterySignalMapper();
96 public Q_SLOTS:
97 void chargePercentChanged(int value);
98 void chargeStateChanged(int newState);
99 void plugStateChanged(bool newState);
102 class StorageAccessSignalMapper : public DeviceSignalMapper
104 Q_OBJECT
106 public:
107 StorageAccessSignalMapper(QObject *parent=0);
108 ~StorageAccessSignalMapper();
110 public Q_SLOTS:
111 void accessibilityChanged(bool accessible);
114 #endif