| 1 | // Copyright (C) 2024 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | // Qt-Security score:significant reason:default |
| 4 | |
| 5 | #ifndef QTMQTTCLIENT_WEBSOCKET_IODEVICE_H |
| 6 | #define QTMQTTCLIENT_WEBSOCKET_IODEVICE_H |
| 7 | |
| 8 | // |
| 9 | // W A R N I N G |
| 10 | // ------------- |
| 11 | // |
| 12 | // This file is not part of the Qt API. It exists purely as an |
| 13 | // implementation detail. This header file may change from version to |
| 14 | // version without notice, or even be removed. |
| 15 | // |
| 16 | // We mean it. |
| 17 | // |
| 18 | |
| 19 | #ifdef QT_MQTT_WITH_WEBSOCKETS |
| 20 | |
| 21 | #include <QtWebSockets/QWebSocketHandshakeOptions> |
| 22 | #include <QtWebSockets/QWebSocket> |
| 23 | #include <QtCore/QIODevice> |
| 24 | |
| 25 | #include "transportLayers/mqtt_websocket_io_base_p.h" |
| 26 | #include "qmqttclient.h" |
| 27 | |
| 28 | QT_BEGIN_NAMESPACE |
| 29 | |
| 30 | class QMqttWebSocketIO : public QMqttWebSocketIOBase |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | public: |
| 34 | Q_DISABLE_COPY_MOVE(QMqttWebSocketIO) |
| 35 | |
| 36 | ~QMqttWebSocketIO() override; |
| 37 | QMqttWebSocketIO(QObject *parent = nullptr, QWebSocket *webSocket = nullptr); |
| 38 | |
| 39 | void close() override; |
| 40 | |
| 41 | void connectToHost(const QString &hostname, quint16 port, QMqttClient::ProtocolVersion version); |
| 42 | |
| 43 | Q_SIGNALS: |
| 44 | void connected(); |
| 45 | |
| 46 | public slots: |
| 47 | void doSocketConnected(); |
| 48 | }; |
| 49 | |
| 50 | QT_END_NAMESPACE |
| 51 | |
| 52 | #endif /* QT_MQTT_WITH_WEBSOCKETS */ |
| 53 | |
| 54 | #endif /* QTMQTTCLIENT_WEBSOCKET_IODEVICE_H */ |
| 55 | |