File indexing completed on 2024-09-15 04:48:49
0001 /* 0002 * SPDX-FileCopyrightText: 2013 Alejandro Fiestas Fiestas <afiestas@kde.org> 0003 * SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include <QDBusAbstractAdaptor> 0011 #include <QDBusMessage> 0012 #include <QHash> 0013 0014 #include <BluezQt/Manager> 0015 0016 class QDBusPendingCallWatcher; 0017 0018 class BlueDevilDaemon; 0019 0020 class Q_DECL_EXPORT ObexFtp : public QDBusAbstractAdaptor 0021 { 0022 Q_OBJECT 0023 Q_CLASSINFO("D-Bus Interface", "org.kde.BlueDevil.ObexFtp") 0024 0025 public: 0026 explicit ObexFtp(BlueDevilDaemon *daemon); 0027 0028 Q_SCRIPTABLE bool isOnline(); 0029 Q_SCRIPTABLE QString preferredTarget(const QString &address); 0030 Q_SCRIPTABLE QString session(const QString &address, const QString &target, const QDBusMessage &msg); 0031 Q_SCRIPTABLE bool cancelTransfer(const QString &transfer, const QDBusMessage &msg); 0032 0033 private Q_SLOTS: 0034 void createSessionFinished(BluezQt::PendingCall *call); 0035 void cancelTransferFinished(QDBusPendingCallWatcher *watcher); 0036 void sessionRemoved(BluezQt::ObexSessionPtr session); 0037 0038 private: 0039 BlueDevilDaemon *const m_daemon; 0040 QHash<QString, QString> m_sessionMap; 0041 QHash<QString, QList<QDBusMessage>> m_pendingSessions; 0042 };