2021-12-04 00:18:05 +00:00
|
|
|
#pragma once
|
|
|
|
#include <QList>
|
|
|
|
#include <QNetworkReply>
|
2023-08-14 17:16:53 +01:00
|
|
|
#include <QObject>
|
2021-12-04 00:18:05 +00:00
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
#include "AccountTask.h"
|
2021-12-04 00:18:05 +00:00
|
|
|
#include "QObjectPtr.h"
|
|
|
|
#include "minecraft/auth/AccountData.h"
|
|
|
|
|
|
|
|
class AuthStep : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
public:
|
2021-12-04 00:18:05 +00:00
|
|
|
using Ptr = shared_qobject_ptr<AuthStep>;
|
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
public:
|
|
|
|
explicit AuthStep(AccountData* data);
|
2021-12-04 00:18:05 +00:00
|
|
|
virtual ~AuthStep() noexcept;
|
|
|
|
|
|
|
|
virtual QString describe() = 0;
|
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
public slots:
|
2021-12-04 00:18:05 +00:00
|
|
|
virtual void perform() = 0;
|
|
|
|
virtual void rehydrate() = 0;
|
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
signals:
|
2021-12-04 00:18:05 +00:00
|
|
|
void finished(AccountTaskState resultingState, QString message);
|
2023-08-14 17:16:53 +01:00
|
|
|
void showVerificationUriAndCode(const QUrl& uri, const QString& code, int expiresIn);
|
2021-12-04 00:18:05 +00:00
|
|
|
void hideVerificationUriAndCode();
|
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
protected:
|
|
|
|
AccountData* m_data;
|
2021-12-04 00:18:05 +00:00
|
|
|
};
|