| 1 | /* |
| 2 | * BluezQt - Asynchronous BlueZ wrapper library |
| 3 | * |
| 4 | * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com> |
| 5 | * |
| 6 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #ifndef BLUEZQT_INPUT_H |
| 10 | #define BLUEZQT_INPUT_H |
| 11 | |
| 12 | #include <QObject> |
| 13 | |
| 14 | #include "bluezqt_export.h" |
| 15 | #include "types.h" |
| 16 | |
| 17 | #include <memory> |
| 18 | |
| 19 | namespace BluezQt |
| 20 | { |
| 21 | /*! |
| 22 | * \inmodule BluezQt |
| 23 | * \class BluezQt::Input |
| 24 | * \inheaderfile BluezQt/Input |
| 25 | * \brief Device input. |
| 26 | * |
| 27 | * This class represents an input interface. |
| 28 | */ |
| 29 | class BLUEZQT_EXPORT Input : public QObject |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | /*! \property BluezQt::Input::reconnectMode */ |
| 33 | Q_PROPERTY(ReconnectMode reconnectMode READ reconnectMode NOTIFY reconnectModeChanged) |
| 34 | |
| 35 | public: |
| 36 | /*! |
| 37 | * \enum BluezQt::Input::ReconnectMode |
| 38 | * \value NoReconnect |
| 39 | * Device and host are not required to automatically restore the connection. |
| 40 | * \value HostReconnect |
| 41 | * Host restores the connection. |
| 42 | * \value DeviceReconnect |
| 43 | * Device restores the connection |
| 44 | * \value AnyReconnect |
| 45 | * Device shall attempt to restore the lost connection, |
| 46 | * but host may also restore the connection. |
| 47 | */ |
| 48 | enum ReconnectMode { |
| 49 | NoReconnect, |
| 50 | HostReconnect, |
| 51 | DeviceReconnect, |
| 52 | AnyReconnect, |
| 53 | }; |
| 54 | Q_ENUM(ReconnectMode) |
| 55 | |
| 56 | ~Input() override; |
| 57 | |
| 58 | /*! |
| 59 | * Returns a shared pointer from this. |
| 60 | */ |
| 61 | InputPtr toSharedPtr() const; |
| 62 | |
| 63 | /*! |
| 64 | * Returns the reconnect mode. |
| 65 | */ |
| 66 | ReconnectMode reconnectMode() const; |
| 67 | |
| 68 | Q_SIGNALS: |
| 69 | /*! |
| 70 | * Indicates that the input's reconnect \a mode has changed. |
| 71 | */ |
| 72 | void reconnectModeChanged(ReconnectMode mode); |
| 73 | |
| 74 | private: |
| 75 | BLUEZQT_NO_EXPORT explicit Input(const QString &path, const QVariantMap &properties); |
| 76 | |
| 77 | std::unique_ptr<class InputPrivate> const d; |
| 78 | |
| 79 | friend class InputPrivate; |
| 80 | friend class DevicePrivate; |
| 81 | }; |
| 82 | |
| 83 | } // namespace BluezQt |
| 84 | |
| 85 | #endif // BLUEZQT_INPUT_H |
| 86 | |