File indexing completed on 2024-12-01 12:29:50

0001 /*
0002  * BluezQt - Asynchronous Bluez wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef BLUEZQT_OBEXAGENTADAPTOR_H
0010 #define BLUEZQT_OBEXAGENTADAPTOR_H
0011 
0012 #include <QDBusAbstractAdaptor>
0013 
0014 #include "request.h"
0015 #include "types.h"
0016 
0017 class QDBusObjectPath;
0018 class QDBusPendingCallWatcher;
0019 
0020 namespace BluezQt
0021 {
0022 class ObexAgent;
0023 class ObexManager;
0024 
0025 class ObexAgentAdaptor : public QDBusAbstractAdaptor
0026 {
0027     Q_OBJECT
0028     Q_CLASSINFO("D-Bus Interface", "org.bluez.obex.Agent1")
0029 
0030 public:
0031     explicit ObexAgentAdaptor(ObexAgent *parent, ObexManager *manager);
0032 
0033 public Q_SLOTS:
0034     QString AuthorizePush(const QDBusObjectPath &transfer, const QDBusMessage &msg);
0035 
0036     Q_NOREPLY void Cancel();
0037     Q_NOREPLY void Release();
0038 
0039 private Q_SLOTS:
0040     void getPropertiesFinished(QDBusPendingCallWatcher *watcher);
0041 
0042 private:
0043     ObexAgent *m_agent;
0044     ObexManager *m_manager;
0045     QString m_transferPath;
0046     Request<QString> m_transferRequest;
0047 };
0048 
0049 } // namespace BluezQt
0050 
0051 #endif // BLUEZQT_OBEXAGENTADAPTOR_H