2022-01-06 19:29:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "interfaces/module_view_delegate_interface.h"
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
namespace Modules
|
|
|
|
{
|
|
|
|
namespace Startup
|
|
|
|
{
|
|
|
|
enum AppState
|
|
|
|
{
|
2022-02-21 18:03:38 +00:00
|
|
|
OnboardingState = 0,
|
|
|
|
LoginState = 1,
|
|
|
|
MainAppState = 2
|
|
|
|
// TODO: is Pending
|
2022-01-06 19:29:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class View : public QObject
|
|
|
|
{
|
2022-02-21 18:03:38 +00:00
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(int appState READ getAppState NOTIFY appStateChanged)
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
public:
|
2022-02-21 18:03:38 +00:00
|
|
|
explicit View(ModuleViewDelegateInterface* delegate, QObject* parent = nullptr);
|
|
|
|
void emitLogOut();
|
|
|
|
void setAppState(AppState state);
|
|
|
|
void load();
|
|
|
|
|
2022-01-06 19:29:19 +00:00
|
|
|
signals:
|
2022-02-21 18:03:38 +00:00
|
|
|
void appStateChanged(int state);
|
|
|
|
void logOut();
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-21 18:03:38 +00:00
|
|
|
ModuleViewDelegateInterface* m_delegate;
|
|
|
|
AppState m_appState;
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
public slots:
|
2022-02-21 18:03:38 +00:00
|
|
|
int getAppState();
|
2022-01-06 19:29:19 +00:00
|
|
|
};
|
|
|
|
} // namespace Startup
|
2022-02-21 18:03:38 +00:00
|
|
|
} // namespace Modules
|