2022-02-14 14:38:41 +00:00
|
|
|
#ifndef MODULE_H
|
|
|
|
#define MODULE_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
#include "interfaces/module_access_interface.h"
|
|
|
|
#include "wallet_accounts/service_interface.h"
|
2022-01-20 14:48:57 +00:00
|
|
|
|
|
|
|
#include "controller.h"
|
|
|
|
#include "view.h"
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
namespace Modules::Main
|
2022-01-20 14:48:57 +00:00
|
|
|
{
|
2022-02-14 14:38:41 +00:00
|
|
|
class Module : public QObject, virtual public IModuleAccess
|
2022-01-20 14:48:57 +00:00
|
|
|
{
|
2022-02-14 14:38:41 +00:00
|
|
|
Q_OBJECT
|
2022-02-16 21:51:04 +00:00
|
|
|
Q_INTERFACES(Modules::Main::IModuleAccess)
|
|
|
|
|
2022-01-20 14:48:57 +00:00
|
|
|
private:
|
2022-02-14 14:38:41 +00:00
|
|
|
bool m_moduleLoaded;
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
View* m_viewPtr;
|
|
|
|
Controller* m_controllerPtr;
|
|
|
|
Modules::Main::IModuleAccess* m_walletModulePtr;
|
2022-02-14 14:38:41 +00:00
|
|
|
|
|
|
|
void connect();
|
2022-02-16 21:51:04 +00:00
|
|
|
void checkIfModuleDidLoad();
|
2022-01-20 14:48:57 +00:00
|
|
|
|
|
|
|
public:
|
2022-02-16 21:51:04 +00:00
|
|
|
explicit Module(std::shared_ptr<Wallets::ServiceInterface> walletService, QObject* parent = nullptr);
|
2022-02-14 14:38:41 +00:00
|
|
|
~Module() = default;
|
|
|
|
|
|
|
|
void load() override;
|
|
|
|
bool isLoaded() override;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void viewDidLoad();
|
|
|
|
void walletDidLoad();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void loaded() override;
|
2022-01-20 14:48:57 +00:00
|
|
|
};
|
2022-02-16 21:51:04 +00:00
|
|
|
} // namespace Modules::Main
|
2022-02-14 14:38:41 +00:00
|
|
|
|
|
|
|
#endif // MODULE_H
|