| 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_SECURE_WEBSOCKET_IODEVICE_H |
| 6 | #define QTMQTTCLIENT_SECURE_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 | #ifdef QT_MQTT_WITH_WEBSOCKETS |
| 19 | |
| 20 | #include <QtWebSockets/QWebSocketHandshakeOptions> |
| 21 | #include <QtWebSockets/QWebSocket> |
| 22 | #include <QtCore/QIODevice> |
| 23 | #include "transportLayers/mqtt_websocket_io_base_p.h" |
| 24 | #include "qmqttclient.h" |
| 25 | |
| 26 | QT_BEGIN_NAMESPACE |
| 27 | |
| 28 | class QMqttSecureWebSocketIO : public QMqttWebSocketIOBase |
| 29 | { |
| 30 | Q_OBJECT |
| 31 | |
| 32 | public: |
| 33 | Q_DISABLE_COPY_MOVE(QMqttSecureWebSocketIO) |
| 34 | |
| 35 | ~QMqttSecureWebSocketIO() override; |
| 36 | QMqttSecureWebSocketIO(QObject *parent = nullptr, QWebSocket *webSocket = nullptr); |
| 37 | |
| 38 | void close() override; |
| 39 | |
| 40 | void connectToHostEncrypted(const QString &hostname, quint16 port, QMqttClient::ProtocolVersion version); |
| 41 | |
| 42 | Q_SIGNALS: |
| 43 | void encrypted(); |
| 44 | |
| 45 | public slots: |
| 46 | void doSocketEncrypted(); |
| 47 | }; |
| 48 | |
| 49 | QT_END_NAMESPACE |
| 50 | |
| 51 | #endif /* QT_MQTT_WITH_WEBSOCKETS */ |
| 52 | |
| 53 | #endif /* QTMQTTCLIENT_SECURE_WEBSOCKET_IODEVICE_H */ |
| 54 | |