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
23 #include <QSignalMapper>
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
51 DeviceSignalMapper(QObject
*parent
=0);
52 ~DeviceSignalMapper();
54 void setMapping(QObject
* device
, const QString
&udi
);
57 void deviceChanged(const QString
& udi
, const QString
&property
, QVariant value
);
60 QMap
<QObject
*, QString
> signalmap
;
63 class AcAdapterSignalMapper
: public DeviceSignalMapper
68 AcAdapterSignalMapper(QObject
*parent
=0);
69 ~AcAdapterSignalMapper();
72 void plugStateChanged(bool newState
);
75 class ButtonSignalMapper
: public DeviceSignalMapper
80 ButtonSignalMapper(QObject
*parent
=0);
81 ~ButtonSignalMapper();
84 void pressed(Solid::Button::ButtonType type
);
87 class BatterySignalMapper
: public DeviceSignalMapper
92 BatterySignalMapper(QObject
*parent
=0);
93 ~BatterySignalMapper();
96 void chargePercentChanged(int value
);
97 void chargeStateChanged(int newState
);
98 void plugStateChanged(bool newState
);
101 class StorageAccessSignalMapper
: public DeviceSignalMapper
106 StorageAccessSignalMapper(QObject
*parent
=0);
107 ~StorageAccessSignalMapper();
110 void accessibilityChanged(bool accessible
);