Changeset View
Changeset View
Standalone View
Standalone View
mtp/kiod_module/kmtpd.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | This file is part of the MTP KIOD module, part of the KDE project. | ||||
3 | | ||||
4 | Copyright (C) 2018 Andreas Krutzler <andreas.krutzler@gmx.net> | ||||
5 | | ||||
6 | This program is free software: you can redistribute it and/or modify | ||||
7 | it under the terms of the GNU General Public License as published by | ||||
8 | the Free Software Foundation, either version 2 of the License, or | ||||
9 | (at your option) any later version. | ||||
10 | | ||||
11 | This program is distributed in the hope that it will be useful, | ||||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
14 | GNU General Public License for more details. | ||||
15 | | ||||
16 | You should have received a copy of the GNU General Public License | ||||
17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
18 | */ | ||||
19 | | ||||
20 | #ifndef KMTPD_H | ||||
21 | #define KMTPD_H | ||||
22 | | ||||
23 | #include <KDEDModule> | ||||
24 | #include <Solid/Device> | ||||
25 | | ||||
26 | #include <QDBusObjectPath> | ||||
27 | | ||||
28 | #include "mtpdevice.h" | ||||
29 | | ||||
30 | Q_DECLARE_LOGGING_CATEGORY(LOG_KIOD_KMTPD) | ||||
31 | | ||||
32 | class KMTPd : public KDEDModule | ||||
33 | { | ||||
34 | Q_OBJECT | ||||
35 | Q_PROPERTY(QString version READ version CONSTANT) | ||||
36 | | ||||
37 | public: | ||||
38 | KMTPd(QObject *parent, const QList<QVariant> ¶meters); | ||||
39 | ~KMTPd() override; | ||||
40 | | ||||
41 | QString version() const; | ||||
42 | | ||||
43 | private: | ||||
44 | void checkDevice(const Solid::Device &solidDevice); | ||||
45 | MTPDevice *deviceFromUdi(const QString &udi) const; | ||||
46 | | ||||
47 | QList<MTPDevice *> m_devices; | ||||
48 | qint32 m_timeout; | ||||
49 | | ||||
50 | public slots: | ||||
51 | // D-Bus methods | ||||
52 | QList<QDBusObjectPath> listDevices() const; | ||||
53 | | ||||
54 | private slots: | ||||
55 | void deviceAdded(const QString &udi); | ||||
56 | void deviceRemoved(const QString &udi); | ||||
57 | | ||||
58 | signals: | ||||
59 | // D-Bus signals | ||||
60 | void devicesChanged(); | ||||
61 | }; | ||||
62 | | ||||
63 | #endif // KMTPD_H |