| 1 |
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#pragma once |
| 6 |
#include "dtkcore_global.h" |
| 7 |
#include <QDBusAbstractInterface> |
| 8 |
|
| 9 |
DCORE_BEGIN_NAMESPACE |
| 10 |
|
| 11 |
class DDBusInterfacePrivate; |
| 12 |
|
| 13 |
// Imported since 5.6.3 |
| 14 |
class DDBusInterface : public QDBusAbstractInterface |
| 15 |
{ |
| 16 |
Q_OBJECT |
| 17 |
|
| 18 |
public: |
| 19 |
explicit DDBusInterface(const QString &service, |
| 20 |
const QString &path, |
| 21 |
const QString &interface, |
| 22 |
const QDBusConnection &connection = QDBusConnection::sessionBus(), |
| 23 |
QObject *parent = nullptr); |
| 24 |
virtual ~DDBusInterface() override; |
| 25 |
|
| 26 |
bool serviceValid() const; |
| 27 |
QString suffix() const; |
| 28 |
void setSuffix(const QString &suffix); |
| 29 |
|
| 30 |
QVariant property(const char *propName); |
| 31 |
void setProperty(const char *propName, const QVariant &value); |
| 32 |
|
| 33 |
Q_SIGNALS: |
| 34 |
void serviceValidChanged(const bool valid) const; |
| 35 |
|
| 36 |
private: |
| 37 |
QScopedPointer<DDBusInterfacePrivate> d_ptr; |
| 38 |
Q_DECLARE_PRIVATE(DDBusInterface) |
| 39 |
Q_DISABLE_COPY(DDBusInterface) |
| 40 |
}; |
| 41 |
DCORE_END_NAMESPACE |