| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2018 Manuel Weichselbaumer <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef MEDIAENDPOINTCONNECTOR_H |
| 8 |
#define MEDIAENDPOINTCONNECTOR_H |
| 9 |
|
| 10 |
#include <QObject> |
| 11 |
|
| 12 |
#include "agent.h" |
| 13 |
#include "manager.h" |
| 14 |
#include "types.h" |
| 15 |
|
| 16 |
#include <memory> |
| 17 |
|
| 18 |
class NoInputNoOutputAgent : public BluezQt::Agent |
| 19 |
{ |
| 20 |
Q_OBJECT |
| 21 |
|
| 22 |
public: |
| 23 |
/* |
| 24 |
* Creates a new NoInputNoOutputAgent object. |
| 25 |
*/ |
| 26 |
explicit NoInputNoOutputAgent(const QStringList &uuids, QObject *parent = nullptr); |
| 27 |
|
| 28 |
/* |
| 29 |
* Destroys a NoInputNoOutputAgent object. |
| 30 |
*/ |
| 31 |
~NoInputNoOutputAgent() override; |
| 32 |
|
| 33 |
Q_SIGNALS: |
| 34 |
/* |
| 35 |
* Indicates that a service was authorized. |
| 36 |
*/ |
| 37 |
void serviceAuthorized(BluezQt::DevicePtr device, const QString &uuid, bool allowed); |
| 38 |
|
| 39 |
private: |
| 40 |
QDBusObjectPath objectPath() const override; |
| 41 |
Capability capability() const override; |
| 42 |
void authorizeService(BluezQt::DevicePtr device, const QString &uuid, const BluezQt::Request<> &request) override; |
| 43 |
|
| 44 |
std::unique_ptr<class NoInputNoOutputAgentPrivate> const d; |
| 45 |
}; |
| 46 |
|
| 47 |
class MediaEndpointConnector : public QObject |
| 48 |
{ |
| 49 |
Q_OBJECT |
| 50 |
|
| 51 |
public: |
| 52 |
explicit MediaEndpointConnector(BluezQt::Manager *manager, QObject *parent = nullptr); |
| 53 |
|
| 54 |
private: |
| 55 |
void onTransportChanged(BluezQt::MediaTransportPtr transport); |
| 56 |
void onServiceAuthorized(BluezQt::DevicePtr device, const QString &uuid, bool allowed); |
| 57 |
void onConfigurationSelected(const QByteArray &capabilities, const QByteArray &configuration); |
| 58 |
void onConfigurationSet(const QString &transportObjectPath, const QVariantMap &properties); |
| 59 |
void onConfigurationCleared(const QString &transportObjectPath); |
| 60 |
|
| 61 |
BluezQt::Manager *m_manager; |
| 62 |
}; |
| 63 |
|
| 64 |
#endif // MEDIAENDPOINTCONNECTOR_H |