File indexing completed on 2024-05-12 04:01:51

0001 /*
0002     SPDX-FileCopyrightText: 2005-2007 Kevin Ottens <ervin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef SOLID_DEVICENOTIFIER_H
0008 #define SOLID_DEVICENOTIFIER_H
0009 
0010 #include <QObject>
0011 
0012 #include <solid/solid_export.h>
0013 
0014 namespace Solid
0015 {
0016 /**
0017  * @class Solid::DeviceNotifier devicenotifier.h <Solid/DeviceNotifier>
0018  *
0019  * This class allow to query the underlying system to obtain information
0020  * about the hardware available.
0021  *
0022  * It's the unique entry point for hardware discovery. Applications should use
0023  * it to find devices, or to be notified about hardware changes.
0024  *
0025  * Note that it's implemented as a singleton and encapsulates the backend logic.
0026  *
0027  * @author Kevin Ottens <ervin@kde.org>
0028  */
0029 class SOLID_EXPORT DeviceNotifier : public QObject // krazy:exclude=dpointer (interface class)
0030 {
0031     Q_OBJECT
0032 public:
0033     static DeviceNotifier *instance();
0034 
0035 Q_SIGNALS:
0036     /**
0037      * This signal is emitted when a new device appears in the underlying system.
0038      *
0039      * @param udi the new device UDI
0040      */
0041     void deviceAdded(const QString &udi);
0042 
0043     /**
0044      * This signal is emitted when a device disappears from the underlying system.
0045      *
0046      * @param udi the old device UDI
0047      */
0048     void deviceRemoved(const QString &udi);
0049 };
0050 }
0051 
0052 #endif