| 1 | /* |
| 2 | * BluezQt - Asynchronous BlueZ wrapper library |
| 3 | * |
| 4 | * SPDX-FileCopyrightText: 2018 Manuel Weichselbaumer <mincequi@web.de> |
| 5 | * |
| 6 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #ifndef BLUEZQT_MEDIA_H |
| 10 | #define BLUEZQT_MEDIA_H |
| 11 | |
| 12 | #include <QObject> |
| 13 | |
| 14 | #include "bluezqt_export.h" |
| 15 | |
| 16 | #include <memory> |
| 17 | |
| 18 | namespace BluezQt |
| 19 | { |
| 20 | class MediaEndpoint; |
| 21 | class PendingCall; |
| 22 | |
| 23 | /*! |
| 24 | * \inmodule BluezQt |
| 25 | * \class BluezQt::Media |
| 26 | * \inheaderfile BluezQt/Media |
| 27 | * \brief Bluetooth Media. |
| 28 | * |
| 29 | * This allows media endpoints to be established in accordance with the |
| 30 | * capabilities of a specific media service profile. |
| 31 | * |
| 32 | * For example, an A2DP media endpoint could be created allowing data from a |
| 33 | * remote device to be streamed to/from the sender. |
| 34 | * |
| 35 | * Each media endpoint is associated with a service object instance that |
| 36 | * implements the required behaviours of the endpoint. The service object |
| 37 | * must be created at a given path before it is registered. |
| 38 | * |
| 39 | * \sa MediaEndpoint |
| 40 | */ |
| 41 | class BLUEZQT_EXPORT Media : public QObject |
| 42 | { |
| 43 | Q_OBJECT |
| 44 | |
| 45 | public: |
| 46 | ~Media() override; |
| 47 | |
| 48 | /*! |
| 49 | * Registers an \a endpoint. |
| 50 | * |
| 51 | * Register a local end point to sender, the sender can register as many end points as it likes. |
| 52 | * |
| 53 | * \note If the sender disconnects the end points are automatically unregistered. |
| 54 | * |
| 55 | * Possible errors: |
| 56 | * |
| 57 | * \list |
| 58 | * \li PendingCall::InvalidArguments |
| 59 | * \li PendingCall::NotSupported |
| 60 | * \endlist |
| 61 | * |
| 62 | * Returns void pending call. |
| 63 | */ |
| 64 | PendingCall *registerEndpoint(MediaEndpoint *endpoint); |
| 65 | |
| 66 | /*! |
| 67 | * Unregisters an \a endpoint. |
| 68 | * |
| 69 | * Returns void pending call. |
| 70 | */ |
| 71 | PendingCall *unregisterEndpoint(MediaEndpoint *endpoint); |
| 72 | |
| 73 | private: |
| 74 | BLUEZQT_NO_EXPORT explicit Media(const QString &path, QObject *parent = nullptr); |
| 75 | |
| 76 | std::unique_ptr<class MediaPrivate> const d; |
| 77 | |
| 78 | friend class AdapterPrivate; |
| 79 | }; |
| 80 | |
| 81 | } // namespace BluezQt |
| 82 | |
| 83 | #endif // BLUEZQT_MEDIA_H |
| 84 | |