QtNovelUI/WordsIDE/storyconceptspresent.h

61 lines
1.7 KiB
C
Raw Normal View History

2022-11-29 03:47:12 +00:00
#ifndef STORYCONCEPTSPRESENT_H
#define STORYCONCEPTSPRESENT_H
2022-11-25 01:18:54 +00:00
2023-03-17 13:58:38 +00:00
#include "DocsManager.h"
2022-11-25 01:18:54 +00:00
#include "appcore.h"
2022-11-29 03:47:12 +00:00
#include "tools.h"
#include <libParse.h>
2022-11-25 01:18:54 +00:00
#include <QObject>
#include <QTextBrowser>
#include <QTreeView>
#include <QWidget>
2023-03-11 07:01:28 +00:00
namespace DataModel {
2023-03-11 04:52:33 +00:00
class StoryconceptsPresentModel : public Schedule::AccessibleObject {
public:
StoryconceptsPresentModel(Core::AppCore *core);
virtual ~StoryconceptsPresentModel();
2022-11-25 01:18:54 +00:00
2023-03-11 04:52:33 +00:00
QStandardItemModel *treeModel() const;
QTextDocument *detailsBackend() const;
2022-11-25 01:18:54 +00:00
2023-03-11 04:52:33 +00:00
void refreshTree();
void detailsShow(const QList<QString> &path);
// AccessibleObject interface
public:
virtual QString name() const override;
private:
2022-11-25 01:18:54 +00:00
Core::AppCore *const core_ins;
QStandardItemModel *const model_base;
2023-03-11 04:52:33 +00:00
QTextDocument *const detail_backend;
Tools::TreeSyncs<Parse::Result::DesNode *> *concept_model;
};
2023-03-11 07:01:28 +00:00
} // namespace DataModel
namespace Components {
2023-03-17 13:58:38 +00:00
class StoryconceptsPresent : public QWidget, public MakeTools::PresentBase {
2023-03-11 04:52:33 +00:00
public:
2023-03-17 13:58:38 +00:00
StoryconceptsPresent(Schedule::CommandsDispatcher *core, DataModel::StoryconceptsPresentModel *backend, QWidget *parent = nullptr);
2023-03-11 04:52:33 +00:00
private:
Schedule::CommandsDispatcher *const core_ins;
QTreeView *const tree_view;
2022-11-25 01:18:54 +00:00
QTextBrowser *const details_view;
2023-03-11 04:52:33 +00:00
void show_details(const QModelIndex &curr);
void jump_to(const QModelIndex &curr);
2023-03-11 05:55:16 +00:00
2023-03-17 13:58:38 +00:00
// PresentBase interface
2023-03-11 05:55:16 +00:00
public:
2023-03-17 13:58:38 +00:00
virtual QWidget *widget() const override;
2023-03-11 05:55:16 +00:00
virtual QString name() const override;
2022-11-25 01:18:54 +00:00
};
2023-03-11 07:01:28 +00:00
} // namespace Components
2022-11-25 01:18:54 +00:00
2022-11-29 03:47:12 +00:00
#endif // STORYCONCEPTSPRESENT_H