1// Copyright (C) 2017 Witekio.
2// Copyright (C) 2018 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QCOAPREPLY_P_H
7#define QCOAPREPLY_P_H
8
9#include <QtCoap/qcoapreply.h>
10#include <private/qcoapmessage_p.h>
11#include <private/qiodevice_p.h>
12
13//
14// W A R N I N G
15// -------------
16//
17// This file is not part of the Qt API. It exists purely as an
18// implementation detail. This header file may change from version to
19// version without notice, or even be removed.
20//
21// We mean it.
22//
23
24QT_BEGIN_NAMESPACE
25
26class QHostAddress;
27class Q_AUTOTEST_EXPORT QCoapReplyPrivate : public QIODevicePrivate
28{
29public:
30 QCoapReplyPrivate(const QCoapRequest &request);
31
32 void _q_setRunning(const QCoapToken &, QCoapMessageId);
33 virtual void _q_setContent(const QHostAddress &sender, const QCoapMessage &, QtCoap::ResponseCode);
34 void _q_setNotified();
35 void _q_setObserveCancelled();
36 void _q_setFinished(QtCoap::Error = QtCoap::Error::Ok);
37 void _q_setError(QtCoap::ResponseCode code);
38 void _q_setError(QtCoap::Error);
39
40 static QCoapReply *createCoapReply(const QCoapRequest &request, QObject *parent = nullptr);
41
42 QCoapRequest request;
43 QCoapMessage message;
44 QtCoap::ResponseCode responseCode = QtCoap::ResponseCode::InvalidCode;
45 QtCoap::Error error = QtCoap::Error::Ok;
46 bool isRunning = false;
47 bool isFinished = false;
48 bool isAborted = false;
49
50 Q_DECLARE_PUBLIC(QCoapReply)
51};
52
53QT_END_NAMESPACE
54
55#endif // QCOAPREPLY_P_H
56

source code of qtcoap/src/coap/qcoapreply_p.h