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>
45 #include <solid/video.h>
47 class DeviceSignalMapper
: public QSignalMapper
52 DeviceSignalMapper(QObject
*parent
=0);
53 ~DeviceSignalMapper();
55 void setMapping(QObject
* device
, const QString
&udi
);
58 void deviceChanged(const QString
& udi
, const QString
&property
, QVariant value
);
61 QMap
<QObject
*, QString
> signalmap
;
64 class AcAdapterSignalMapper
: public DeviceSignalMapper
69 AcAdapterSignalMapper(QObject
*parent
=0);
70 ~AcAdapterSignalMapper();
73 void plugStateChanged(bool newState
);
76 class ButtonSignalMapper
: public DeviceSignalMapper
81 ButtonSignalMapper(QObject
*parent
=0);
82 ~ButtonSignalMapper();
85 void pressed(Solid::Button::ButtonType type
);
88 class BatterySignalMapper
: public DeviceSignalMapper
93 BatterySignalMapper(QObject
*parent
=0);
94 ~BatterySignalMapper();
97 void chargePercentChanged(int value
);
98 void chargeStateChanged(int newState
);
99 void plugStateChanged(bool newState
);
102 class StorageAccessSignalMapper
: public DeviceSignalMapper
107 StorageAccessSignalMapper(QObject
*parent
=0);
108 ~StorageAccessSignalMapper();
111 void accessibilityChanged(bool accessible
);