File indexing completed on 2024-05-12 04:59:45
0001 /* 0002 This file is part of the KMTP framework, part of the KDE project. 0003 0004 SPDX-FileCopyrightText: 2018 Andreas Krutzler <andreas.krutzler@gmx.net> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #ifndef KMTPDINTERFACE_H 0010 #define KMTPDINTERFACE_H 0011 0012 #include "daemoninterface.h" 0013 #include <QObject> 0014 0015 class KMTPDeviceInterface; 0016 0017 /** 0018 * @brief The KMTPDeviceInterface class 0019 * 0020 * @note This interface should be a public API. 0021 */ 0022 class KMTPDInterface : public QObject 0023 { 0024 Q_OBJECT 0025 Q_PROPERTY(QString version READ version CONSTANT) 0026 0027 public: 0028 explicit KMTPDInterface(QObject *parent = nullptr); 0029 0030 bool isValid() const; 0031 0032 KMTPDeviceInterface *deviceFromName(const QString &friendlyName); 0033 KMTPDeviceInterface *deviceFromUdi(const QString &udi); 0034 0035 QVector<KMTPDeviceInterface *> devices(); 0036 0037 // D-Bus properties 0038 QString version() const; 0039 0040 private: 0041 void updateDevices(); 0042 0043 org::kde::kmtp::Daemon *m_dbusInterface; 0044 QVector<KMTPDeviceInterface *> m_devices; 0045 0046 public Q_SLOTS: 0047 // D-Bus methods 0048 QList<QDBusObjectPath> listDevices(); 0049 0050 Q_SIGNALS: 0051 // D-Bus signals 0052 void devicesChanged(); 0053 }; 0054 0055 #endif // KMTPDINTERFACE_H