Solid

upowerdevice.h
1/*
2 SPDX-FileCopyrightText: 2010 Michael Zanetti <mzanetti@kde.org>
3 SPDX-FileCopyrightText: 2010 Lukas Tinkl <ltinkl@redhat.com>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6
7*/
8
9#ifndef UPOWERDEVICE_H
10#define UPOWERDEVICE_H
11
12#include <ifaces/device.h>
13#include <solid/deviceinterface.h>
14
15namespace Solid
16{
17namespace Backends
18{
19namespace UPower
20{
21class UPowerDevice : public Solid::Ifaces::Device
22{
24public:
25 UPowerDevice(const QString &udi);
26 ~UPowerDevice() override;
27
28 QObject *createDeviceInterface(const Solid::DeviceInterface::Type &type) override;
29 bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const override;
30 QString description() const override;
31 QStringList emblems() const override;
32 QString icon() const override;
33 QString product() const override;
34 QString vendor() const override;
35 QString udi() const override;
36 QString parentUdi() const override;
37
38 QVariant prop(const QString &key) const;
39 bool propertyExists(const QString &key) const;
40 QMap<QString, QVariant> allProperties() const;
41
43 void propertyChanged(const QMap<QString, int> &changes);
44
45private Q_SLOTS:
46 void onPropertiesChanged(const QString &ifaceName, const QVariantMap &changedProps, const QStringList &invalidatedProps);
47 void login1Resuming(bool active);
48
49private:
50 QString batteryTechnology() const;
51 QString m_udi;
52 mutable QVariantMap m_cache;
53 mutable QStringList m_negativeCache;
54 mutable bool m_cacheComplete = false;
55
56 void checkCache(const QString &key) const;
57 void loadCache() const;
58};
59
60}
61}
62}
63
64#endif // UPOWERDEVICE_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.
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 Fri Nov 29 2024 11:47:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.