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