Plasma5Support

devicesignalmapper.h
1/*
2 SPDX-FileCopyrightText: 2007 Christopher Blauvelt <cblauvelt@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-only
5*/
6
7#pragma once
8
9#include <QMap>
10#include <QObject>
11#include <QSignalMapper>
12
13#include <QDebug>
14
15#include <solid/battery.h>
16#include <solid/block.h>
17#include <solid/camera.h>
18#include <solid/device.h>
19#include <solid/devicenotifier.h>
20#include <solid/opticaldisc.h>
21#include <solid/opticaldrive.h>
22#include <solid/portablemediaplayer.h>
23#include <solid/processor.h>
24#include <solid/storageaccess.h>
25#include <solid/storagedrive.h>
26#include <solid/storagevolume.h>
27
28class DeviceSignalMapper : public QSignalMapper
29{
31
32public:
33 explicit DeviceSignalMapper(QObject *parent = nullptr);
34 ~DeviceSignalMapper() override;
35
36 void setMapping(QObject *device, const QString &udi);
37
39 void deviceChanged(const QString &udi, const QString &property, QVariant value);
40
41protected:
43};
44
45class BatterySignalMapper : public DeviceSignalMapper
46{
48
49public:
50 explicit BatterySignalMapper(QObject *parent = nullptr);
51 ~BatterySignalMapper() override;
52
53public Q_SLOTS:
54 void chargePercentChanged(int value);
55 void chargeStateChanged(int newState);
56 void presentStateChanged(bool newState);
57};
58
59class StorageAccessSignalMapper : public DeviceSignalMapper
60{
62
63public:
64 explicit StorageAccessSignalMapper(QObject *parent = nullptr);
65 ~StorageAccessSignalMapper() override;
66
67public Q_SLOTS:
68 void accessibilityChanged(bool accessible);
69};
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
QVariant property(const char *name) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.