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 QCOAPREQUEST_H
7#define QCOAPREQUEST_H
8
9#include <QtCoap/qcoapglobal.h>
10#include <QtCoap/qcoapnamespace.h>
11#include <QtCoap/qcoapmessage.h>
12
13#include <QtCore/qobject.h>
14#include <QtCore/qurl.h>
15
16QT_BEGIN_NAMESPACE
17
18class QCoapInternalRequest;
19class QCoapRequestPrivate;
20class Q_COAP_EXPORT QCoapRequest : public QCoapMessage
21{
22public:
23 explicit QCoapRequest(const QUrl &url = QUrl(),
24 Type type = Type::NonConfirmable,
25 const QUrl &proxyUrl = QUrl());
26 explicit QCoapRequest(const char* url, Type type = Type::NonConfirmable);
27 QCoapRequest(const QCoapRequest &other);
28 ~QCoapRequest();
29
30 QCoapRequest &operator=(const QCoapRequest &other);
31
32 QUrl url() const;
33 QUrl proxyUrl() const;
34 QtCoap::Method method() const;
35 bool isObserve() const;
36 void setUrl(const QUrl &url);
37 void setProxyUrl(const QUrl &proxyUrl);
38 void enableObserve();
39
40private:
41 // Q_DECLARE_PRIVATE equivalent for shared data pointers
42 inline QCoapRequestPrivate* d_func();
43 const QCoapRequestPrivate* d_func() const
44 { return reinterpret_cast<const QCoapRequestPrivate*>(d_ptr.constData()); }
45
46 friend class QCoapRequestPrivate;
47};
48
49QT_END_NAMESPACE
50
51#endif // QCOAPREQUEST_H
52

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