File indexing completed on 2024-12-22 04:56:59

0001 /*
0002     SPDX-FileCopyrightText: 2018 Krzysztof Nowicki <krissn@op.pl>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 class QObject;
0010 #include "ewsabstractauth.h"
0011 
0012 #include <memory>
0013 
0014 class EwsOAuthPrivate;
0015 
0016 class EwsOAuth : public EwsAbstractAuth
0017 {
0018     Q_OBJECT
0019 public:
0020     EwsOAuth(QObject *parent, const QString &email, const QString &appId, const QString &redirectUri);
0021     ~EwsOAuth() override;
0022 
0023     void init() override;
0024     bool getAuthData(QString &username, QString &password, QStringList &customHeaders) override;
0025     void notifyRequestAuthFailed() override;
0026     bool authenticate(bool interactive) override;
0027     const QString &reauthPrompt() const override;
0028     const QString &authFailedPrompt() const override;
0029 
0030     void walletPasswordRequestFinished(const QString &password) override;
0031     void walletMapRequestFinished(const QMap<QString, QString> &map) override;
0032 
0033 private:
0034     std::unique_ptr<EwsOAuthPrivate> const d_ptr;
0035     Q_DECLARE_PRIVATE(EwsOAuth)
0036 };