File indexing completed on 2024-05-12 04:59:44

0001 /*
0002     This file is part of the MTP KIOD module, part of the KDE project.
0003 
0004     SPDX-FileCopyrightText: 2018 Andreas Krutzler <andreas.krutzler@gmx.net>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef KMTPD_H
0010 #define KMTPD_H
0011 
0012 #include <KDEDModule>
0013 #include <Solid/Device>
0014 
0015 #include <QDBusObjectPath>
0016 
0017 class MTPDevice;
0018 
0019 class KMTPd : public KDEDModule
0020 {
0021     Q_OBJECT
0022     Q_PROPERTY(QString version READ version CONSTANT)
0023 
0024 public:
0025     explicit KMTPd(QObject *parent, const QList<QVariant> &parameters);
0026     ~KMTPd() override;
0027 
0028     QString version() const;
0029 
0030 private:
0031     void checkDevice(const Solid::Device &solidDevice);
0032     MTPDevice *deviceFromUdi(const QString &udi) const;
0033 
0034     QList<MTPDevice *> m_devices;
0035 
0036 public Q_SLOTS:
0037     // D-Bus methods
0038     QList<QDBusObjectPath> listDevices() const;
0039 
0040 private Q_SLOTS:
0041     void deviceAdded(const QString &udi);
0042     void deviceRemoved(const QString &udi);
0043 
0044 Q_SIGNALS:
0045     // D-Bus signals
0046     void devicesChanged();
0047 };
0048 
0049 #endif // KMTPD_H