2022-02-22 09:02:34 +01:00
|
|
|
#pragma once
|
2022-01-20 10:48:57 -04:00
|
|
|
|
|
|
|
#include <QObject>
|
2022-02-16 22:51:04 +01:00
|
|
|
#include <memory>
|
2022-01-20 10:48:57 -04:00
|
|
|
|
2022-02-16 22:51:04 +01:00
|
|
|
#include "../shared/section_model.h"
|
2022-01-20 10:48:57 -04:00
|
|
|
|
2022-02-16 22:51:04 +01:00
|
|
|
namespace Modules::Main
|
|
|
|
{
|
2022-01-20 10:48:57 -04:00
|
|
|
class View : public QObject
|
|
|
|
{
|
2022-02-14 15:38:41 +01:00
|
|
|
Q_OBJECT
|
2022-02-16 22:51:04 +01:00
|
|
|
Q_PROPERTY(Shared::Models::SectionModel* sectionsModel READ getSectionsModel NOTIFY sectionsModelChanged)
|
|
|
|
Q_PROPERTY(Shared::Models::SectionItem* activeSection READ getActiveSection NOTIFY activeSectionChanged)
|
2022-01-20 10:48:57 -04:00
|
|
|
|
|
|
|
public:
|
2022-02-22 09:02:34 +01:00
|
|
|
using QObject::QObject;
|
|
|
|
|
2022-02-14 15:38:41 +01:00
|
|
|
void load();
|
2022-02-16 22:51:04 +01:00
|
|
|
|
2022-02-21 19:03:38 +01:00
|
|
|
void addItem(Shared::Models::SectionItem* item);
|
2022-02-16 22:51:04 +01:00
|
|
|
|
|
|
|
void setActiveSection(const QString& Id);
|
|
|
|
|
2022-02-14 15:38:41 +01:00
|
|
|
signals:
|
|
|
|
void viewLoaded();
|
2022-02-16 22:51:04 +01:00
|
|
|
void sectionsModelChanged();
|
|
|
|
void activeSectionChanged();
|
|
|
|
|
|
|
|
private:
|
2022-02-22 09:02:34 +01:00
|
|
|
Shared::Models::SectionModel* getSectionsModel();
|
|
|
|
Shared::Models::SectionItem* getActiveSection() const;
|
|
|
|
|
|
|
|
Shared::Models::SectionModel m_sectionModel;
|
2022-01-20 10:48:57 -04:00
|
|
|
};
|
2022-02-16 22:51:04 +01:00
|
|
|
} // namespace Modules::Main
|