2022-01-06 19:29:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "accounts/generated_account.h"
|
|
|
|
#include "accounts/service_interface.h"
|
|
|
|
#include "controller_interface.h"
|
|
|
|
#include "interfaces/module_controller_delegate_interface.h"
|
|
|
|
#include "signals.h"
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
namespace Modules
|
|
|
|
{
|
|
|
|
namespace Startup
|
|
|
|
{
|
|
|
|
namespace Onboarding
|
|
|
|
{
|
|
|
|
class Controller : public QObject, ControllerInterface
|
|
|
|
{
|
2022-02-21 18:03:38 +00:00
|
|
|
Q_OBJECT
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
public:
|
2022-02-21 18:03:38 +00:00
|
|
|
Controller(ModuleControllerDelegateInterface* delegate,
|
|
|
|
Accounts::ServiceInterface* accountsService,
|
|
|
|
QObject* parent = nullptr);
|
|
|
|
void init() override;
|
|
|
|
QVector<Accounts::GeneratedAccountDto> getGeneratedAccounts() override;
|
|
|
|
Accounts::GeneratedAccountDto getImportedAccount() override;
|
|
|
|
void setSelectedAccountByIndex(int index) override;
|
|
|
|
void storeSelectedAccountAndLogin(QString password) override;
|
|
|
|
QString validateMnemonic(QString mnemonic) override;
|
|
|
|
void importMnemonic(QString mnemonic) override;
|
|
|
|
void onLogin(Signals::NodeSignal signal);
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-21 18:03:38 +00:00
|
|
|
Accounts::ServiceInterface* m_accountsService;
|
|
|
|
ModuleControllerDelegateInterface* m_delegate;
|
|
|
|
QString m_selectedAccountId;
|
2022-01-06 19:29:19 +00:00
|
|
|
};
|
|
|
|
} // namespace Onboarding
|
|
|
|
} // namespace Startup
|
2022-02-21 18:03:38 +00:00
|
|
|
} // namespace Modules
|