aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/auth/AuthStep.h
blob: becd9b0c5286fed854fc16e7817d6fe1661792a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <QList>
#include <QNetworkReply>
#include <QObject>

#include "AccountTask.h"
#include "QObjectPtr.h"
#include "minecraft/auth/AccountData.h"

class AuthStep : public QObject {
    Q_OBJECT

   public:
    using Ptr = shared_qobject_ptr<AuthStep>;

   public:
    explicit AuthStep(AccountData* data);
    virtual ~AuthStep() noexcept;

    virtual QString describe() = 0;

   public slots:
    virtual void perform() = 0;
    virtual void rehydrate() = 0;

   signals:
    void finished(AccountTaskState resultingState, QString message);
    void showVerificationUriAndCode(const QUrl& uri, const QString& code, int expiresIn);
    void hideVerificationUriAndCode();

   protected:
    AccountData* m_data;
};