Changeset View
Changeset View
Standalone View
Standalone View
mtp/shared/kmtpdeviceinterface.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | This file is part of the KMTP framework, part of the KDE project. | ||||
3 | | ||||
4 | Copyright (C) 2018 Andreas Krutzler <andreas.krutzler@gmx.net> | ||||
5 | | ||||
6 | This library is free software; you can redistribute it and/or | ||||
7 | modify it under the terms of the GNU Lesser General Public | ||||
8 | License as published by the Free Software Foundation; either | ||||
9 | version 2.1 of the License, or (at your option) version 3, or any | ||||
10 | later version accepted by the membership of KDE e.V. (or its | ||||
11 | successor approved by the membership of KDE e.V.), which shall | ||||
12 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
13 | | ||||
14 | This library is distributed in the hope that it will be useful, | ||||
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
17 | Lesser General Public License for more details. | ||||
18 | | ||||
19 | You should have received a copy of the GNU Lesser General Public | ||||
20 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
21 | */ | ||||
22 | | ||||
23 | #ifndef KMTPDEVICEINTERFACE_H | ||||
24 | #define KMTPDEVICEINTERFACE_H | ||||
25 | | ||||
26 | #include <QObject> | ||||
27 | | ||||
28 | #include "deviceinterface.h" | ||||
29 | | ||||
30 | class KMTPStorageInterface; | ||||
31 | | ||||
32 | /** | ||||
33 | * @brief The KMTPDeviceInterface class | ||||
34 | * | ||||
35 | * @note This interface should be a public API. | ||||
36 | */ | ||||
37 | class KMTPDeviceInterface : public QObject | ||||
38 | { | ||||
39 | Q_OBJECT | ||||
40 | Q_PROPERTY(QString udi READ udi CONSTANT) | ||||
41 | Q_PROPERTY(QString friendlyName READ friendlyName NOTIFY friendlyNameChanged) | ||||
42 | | ||||
43 | public: | ||||
44 | KMTPDeviceInterface(const QString &dbusObjectPath, QObject *parent); | ||||
45 | | ||||
46 | QString udi() const; | ||||
47 | QString friendlyName() const; | ||||
48 | | ||||
49 | QVector<KMTPStorageInterface *> storages() const; | ||||
50 | KMTPStorageInterface *storageFromDescription(const QString &description) const; | ||||
51 | | ||||
52 | private: | ||||
53 | org::kde::kmtp::Device *m_dbusInterface; | ||||
54 | QVector<KMTPStorageInterface *> m_storages; | ||||
55 | | ||||
56 | public slots: | ||||
57 | int setFriendlyName(const QString &friendlyName); | ||||
58 | | ||||
59 | signals: | ||||
60 | void friendlyNameChanged(const QString &friendlyName); | ||||
61 | }; | ||||
62 | | ||||
63 | | ||||
64 | #endif // KMTPDEVICEINTERFACE_H |