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 KMTPDEVICEINTERFACE_H 0010 #define KMTPDEVICEINTERFACE_H 0011 0012 #include <QObject> 0013 0014 #include "deviceinterface.h" 0015 0016 class KMTPStorageInterface; 0017 0018 /** 0019 * @brief The KMTPDeviceInterface class 0020 * 0021 * @note This interface should be a public API. 0022 */ 0023 class KMTPDeviceInterface : public QObject 0024 { 0025 Q_OBJECT 0026 Q_PROPERTY(QString udi READ udi CONSTANT) 0027 Q_PROPERTY(QString friendlyName READ friendlyName NOTIFY friendlyNameChanged) 0028 0029 public: 0030 explicit KMTPDeviceInterface(const QString &dbusObjectPath, QObject *parent); 0031 0032 QString udi() const; 0033 QString friendlyName() const; 0034 0035 QVector<KMTPStorageInterface *> storages(); 0036 KMTPStorageInterface *storageFromDescription(const QString &description) const; 0037 void updateStorages(); 0038 0039 private: 0040 org::kde::kmtp::Device *m_dbusInterface; 0041 QVector<KMTPStorageInterface *> m_storages; 0042 0043 public Q_SLOTS: 0044 int setFriendlyName(const QString &friendlyName); 0045 0046 Q_SIGNALS: 0047 void friendlyNameChanged(const QString &friendlyName); 0048 }; 0049 0050 #endif // KMTPDEVICEINTERFACE_H