File: kmtpdinterface.h

package info (click to toggle)
kio-extras 4%3A25.04.2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 31,928 kB
  • sloc: cpp: 28,852; ansic: 3,084; perl: 1,048; xml: 116; sh: 92; python: 28; makefile: 9
file content (55 lines) | stat: -rw-r--r-- 1,201 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
    This file is part of the KMTP framework, part of the KDE project.

    SPDX-FileCopyrightText: 2018 Andreas Krutzler <andreas.krutzler@gmx.net>

    SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/

#ifndef KMTPDINTERFACE_H
#define KMTPDINTERFACE_H

#include "daemoninterface.h"
#include <QObject>

class KMTPDeviceInterface;

/**
 * @brief The KMTPDeviceInterface class
 *
 * @note This interface should be a public API.
 */
class KMTPDInterface : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString version READ version CONSTANT)

public:
    explicit KMTPDInterface(QObject *parent = nullptr);

    bool isValid() const;

    KMTPDeviceInterface *deviceFromName(const QString &friendlyName);
    KMTPDeviceInterface *deviceFromUdi(const QString &udi);

    QList<KMTPDeviceInterface *> devices();

    // D-Bus properties
    QString version() const;

private:
    void updateDevices();

    org::kde::kmtp::Daemon *m_dbusInterface;
    QList<KMTPDeviceInterface *> m_devices;

public Q_SLOTS:
    // D-Bus methods
    QList<QDBusObjectPath> listDevices();

Q_SIGNALS:
    // D-Bus signals
    void devicesChanged();
};

#endif // KMTPDINTERFACE_H