Solid

udevqtclient.h
1/*
2 SPDX-FileCopyrightText: 2009 Benjamin K. Stuhl <bks24@cornell.edu>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef UDEVQTCLIENT_H
8#define UDEVQTCLIENT_H
9
10#include <QObject>
11#include <QString>
12#include <QStringList>
13#include <QVariant>
14
15#include "udevqtdevice.h"
16
17namespace UdevQt
18{
19class ClientPrivate;
20class Client : public QObject
21{
23
24 Q_PROPERTY(QStringList watchedSubsystems READ watchedSubsystems WRITE setWatchedSubsystems)
25
26public:
27 Client(QObject *parent = nullptr);
28 Client(const QStringList &subsystemList, QObject *parent = nullptr);
29 ~Client() override;
30
31 QStringList watchedSubsystems() const;
32 void setWatchedSubsystems(const QStringList &subsystemList);
33
34 DeviceList allDevices();
35 DeviceList devicesByProperty(const QString &property, const QVariant &value);
36 DeviceList devicesBySubsystem(const QString &subsystem);
37 /**
38 * Returns a list of devices matching any of the given subsystems AND any of the properties.
39 *
40 * (subsystem1 || subsystem2 || ...) && (property1 || property2 || ...)
41 */
42 DeviceList devicesBySubsystemsAndProperties(const QStringList &subsystems, const QVariantMap &properties);
43 Device deviceByDeviceFile(const QString &deviceFile);
44 Device deviceBySysfsPath(const QString &sysfsPath);
45 Device deviceBySubsystemAndName(const QString &subsystem, const QString &name);
46
48 void deviceAdded(const UdevQt::Device &dev);
49 void deviceRemoved(const UdevQt::Device &dev);
50 void deviceChanged(const UdevQt::Device &dev);
51 void deviceOnlined(const UdevQt::Device &dev);
52 void deviceOfflined(const UdevQt::Device &dev);
53 void deviceBound(const UdevQt::Device &dev);
54 void deviceUnbound(const UdevQt::Device &dev);
55
56private:
57 friend class ClientPrivate;
58 ClientPrivate *d;
59};
60
61}
62
63#endif
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
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 Fri Nov 22 2024 12:01:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.