1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QOAUTHHTTPSERVERREPLYHANDLER_H
5#define QOAUTHHTTPSERVERREPLYHANDLER_H
6
7#ifndef QT_NO_HTTP
8
9#include <QtNetworkAuth/qoauthglobal.h>
10#include <QtNetworkAuth/qoauthoobreplyhandler.h>
11
12#include <QtNetwork/qhostaddress.h>
13
14QT_BEGIN_NAMESPACE
15
16class QUrlQuery;
17
18class QOAuthHttpServerReplyHandlerPrivate;
19class Q_OAUTH_EXPORT QOAuthHttpServerReplyHandler : public QOAuthOobReplyHandler
20{
21 Q_OBJECT
22
23public:
24 explicit QOAuthHttpServerReplyHandler(QObject *parent = nullptr);
25 explicit QOAuthHttpServerReplyHandler(quint16 port, QObject *parent = nullptr);
26 explicit QOAuthHttpServerReplyHandler(const QHostAddress &address, quint16 port,
27 QObject *parent = nullptr);
28 ~QOAuthHttpServerReplyHandler();
29
30 QString callback() const override;
31
32 QString callbackPath() const;
33 void setCallbackPath(const QString &path);
34
35 QString callbackText() const;
36 void setCallbackText(const QString &text);
37
38 quint16 port() const;
39
40 bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
41 void close();
42 bool isListening() const;
43
44private:
45 Q_DECLARE_PRIVATE(QOAuthHttpServerReplyHandler)
46 QScopedPointer<QOAuthHttpServerReplyHandlerPrivate> d_ptr;
47};
48
49QT_END_NAMESPACE
50
51#endif // QT_NO_HTTP
52
53#endif // QOAUTHHTTPSERVERREPLYHANDLER_H
54

source code of qtnetworkauth/src/oauth/qoauthhttpserverreplyhandler.h