1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QMQTTCLIENT_P_H
5#define QMQTTCLIENT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qmqttclient.h"
19#include "qmqttconnection_p.h"
20
21#include <QtNetwork/QAbstractSocket>
22
23#include <private/qobject_p.h>
24
25QT_BEGIN_NAMESPACE
26
27class QMqttClientPrivate : public QObjectPrivate
28{
29 Q_DECLARE_PUBLIC(QMqttClient)
30public:
31 QMqttClientPrivate(QMqttClient *c);
32 ~QMqttClientPrivate() override;
33 void setStateAndError(QMqttClient::ClientState s, QMqttClient::ClientError e = QMqttClient::NoError);
34 void setClientId(const QString &id);
35 QMqttClient *m_client{nullptr};
36 QString m_hostname;
37 quint16 m_port{0};
38 QMqttConnection m_connection;
39 QString m_clientId; // auto-generated
40 quint16 m_keepAlive{60};
41 QMqttClient::ProtocolVersion m_protocolVersion{QMqttClient::MQTT_3_1_1};
42 QMqttClient::ClientState m_state{QMqttClient::Disconnected};
43 QMqttClient::ClientError m_error{QMqttClient::NoError};
44 QString m_willTopic;
45 QByteArray m_willMessage;
46 quint8 m_willQoS{0};
47 bool m_willRetain{false};
48 bool m_autoKeepAlive{true};
49 QString m_username;
50 QString m_password;
51 bool m_cleanSession{true};
52 QMqttConnectionProperties m_connectionProperties;
53 QMqttLastWillProperties m_lastWillProperties;
54 QMqttServerConnectionProperties m_serverConnectionProperties;
55};
56
57QT_END_NAMESPACE
58#endif // QMQTTCLIENT_P_H
59

source code of qtmqtt/src/mqtt/qmqttclient_p.h