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

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