| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QABSTRACTOAUTHREPLYHANDLER_H |
| 5 | #define QABSTRACTOAUTHREPLYHANDLER_H |
| 6 | |
| 7 | #include <QtNetworkAuth/qoauthglobal.h> |
| 8 | |
| 9 | #ifndef QT_NO_HTTP |
| 10 | |
| 11 | #include <QtNetworkAuth/qabstractoauth.h> |
| 12 | |
| 13 | #include <QtCore/qobject.h> |
| 14 | |
| 15 | QT_BEGIN_NAMESPACE |
| 16 | |
| 17 | class Q_OAUTH_EXPORT QAbstractOAuthReplyHandler : public QObject |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | |
| 21 | public: |
| 22 | explicit QAbstractOAuthReplyHandler(QObject *parent = nullptr); |
| 23 | virtual ~QAbstractOAuthReplyHandler(); |
| 24 | |
| 25 | virtual QString callback() const = 0; |
| 26 | |
| 27 | public Q_SLOTS: |
| 28 | virtual void networkReplyFinished(QNetworkReply *reply) = 0; |
| 29 | |
| 30 | Q_SIGNALS: |
| 31 | void callbackReceived(const QVariantMap &values); |
| 32 | void tokensReceived(const QVariantMap &tokens); |
| 33 | void tokenRequestErrorOccurred(QAbstractOAuth::Error error, const QString& errorString); |
| 34 | |
| 35 | void replyDataReceived(const QByteArray &data); |
| 36 | void callbackDataReceived(const QByteArray &data); |
| 37 | |
| 38 | protected: |
| 39 | QAbstractOAuthReplyHandler(QObjectPrivate &d, QObject *parent = nullptr); |
| 40 | |
| 41 | private: |
| 42 | Q_DISABLE_COPY(QAbstractOAuthReplyHandler) |
| 43 | }; |
| 44 | |
| 45 | QT_END_NAMESPACE |
| 46 | |
| 47 | #endif // QT_NO_HTTP |
| 48 | |
| 49 | #endif // QABSTRACTOAUTHREPLYHANDLER_H |
| 50 | |