File indexing completed on 2024-04-28 15:17:54

0001 /*
0002  * BluezQt - Asynchronous BlueZ wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2018 Manuel Weichselbaumer <mincequi@web.de>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef BLUEZQT_MEDIA_H
0010 #define BLUEZQT_MEDIA_H
0011 
0012 #include <QObject>
0013 
0014 #include "bluezqt_export.h"
0015 
0016 namespace BluezQt
0017 {
0018 class MediaEndpoint;
0019 class PendingCall;
0020 
0021 /**
0022  * @class BluezQt::Media Media.h <BluezQt/Media>
0023  *
0024  * Bluetooth Media.
0025  *
0026  * This allows media endpoints to be established in accordance with the
0027  * capabilities of a specific media service profile.
0028  *
0029  * For example, an A2DP media endpoint could be created allowing data from a
0030  * remote device to be streamed to/from the sender.
0031  *
0032  * Each media endpoint is associated with a service object instance that
0033  * implements the required behaviours of the endpoint. The service object
0034  * must be created at a given path before it is registered.
0035  *
0036  * @see MediaEndpoint
0037  */
0038 class BLUEZQT_EXPORT Media : public QObject
0039 {
0040     Q_OBJECT
0041 
0042 public:
0043     /**
0044      * Destroys a Media object.
0045      */
0046     ~Media() override;
0047 
0048     /**
0049      * Registers endpoint.
0050      *
0051      * Register a local end point to sender, the sender can register as many end points as it likes.
0052      *
0053      * Note: If the sender disconnects the end points are automatically unregistered.
0054      *
0055      * Possible errors: PendingCall::InvalidArguments, PendingCall::NotSupported
0056      *
0057      * @param endpoint endpoint to be registered
0058      * @return void pending call
0059      */
0060     PendingCall *registerEndpoint(MediaEndpoint *endpoint);
0061 
0062     /**
0063      * Unregisters endpoint.
0064      *
0065      * @param endpoint endpoint to be unregistered
0066      * @return void pending call
0067      */
0068     PendingCall *unregisterEndpoint(MediaEndpoint *endpoint);
0069 
0070 private:
0071     BLUEZQT_NO_EXPORT explicit Media(const QString &path, QObject *parent = nullptr);
0072 
0073     class MediaPrivate *const d;
0074 
0075     friend class AdapterPrivate;
0076 };
0077 
0078 } // namespace BluezQt
0079 
0080 #endif // BLUEZQT_MEDIA_H