Solid

fakedevice.h
1/*
2 SPDX-FileCopyrightText: 2006 Michaƫl Larouche <michael.larouche@kdemail.net>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6#ifndef SOLID_BACKENDS_FAKEHW_FAKEDEVICE_H
7#define SOLID_BACKENDS_FAKEHW_FAKEDEVICE_H
8
9#include <solid/devices/ifaces/device.h>
10
11#include <QMap>
12#include <QSharedPointer>
13
14namespace Solid
15{
16namespace Backends
17{
18namespace Fake
19{
20class FakeDevice : public Solid::Ifaces::Device
21{
23public:
24 FakeDevice(const QString &udi, const QMap<QString, QVariant> &propertyMap);
25 FakeDevice(const FakeDevice &dev);
26 ~FakeDevice() override;
27
28public Q_SLOTS:
29 QString udi() const override;
30 QString parentUdi() const override;
31 QString vendor() const override;
32 QString product() const override;
33 QString icon() const override;
34 QStringList emblems() const override;
35 QString description() const override;
36
37 virtual QVariant property(const QString &key) const;
38 virtual QMap<QString, QVariant> allProperties() const;
39 virtual bool propertyExists(const QString &key) const;
40 virtual bool setProperty(const QString &key, const QVariant &value);
41 virtual bool removeProperty(const QString &key);
42
43 virtual bool lock(const QString &reason);
44 virtual bool unlock();
45 virtual bool isLocked() const;
46 virtual QString lockReason() const;
47
48 void setBroken(bool broken);
49 bool isBroken();
50 void raiseCondition(const QString &condition, const QString &reason);
51
52public:
53 bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const override;
54 QObject *createDeviceInterface(const Solid::DeviceInterface::Type &type) override;
55
57 void propertyChanged(const QMap<QString, int> &changes);
58 void conditionRaised(const QString &condition, const QString &reason);
59
60private:
61 class Private;
63};
64}
65}
66}
67
68#endif // SOLID_BACKENDS_FAKEHW_FAKEDEVICE_H
Type
This enum type defines the type of device interface that a Device can have.
This class specifies the interface a device will have to comply to in order to be used in the system.
The single responsibility of this class is to create arguments valid for logind Inhibit call.
Definition fakebattery.h:16
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:12 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.