QtNovelUI/WordsIDE/storyunitspresent.h

62 lines
1.6 KiB
C
Raw Normal View History

2022-11-18 23:47:32 +00:00
#ifndef STORYUNITSPRESENT_H
#define STORYUNITSPRESENT_H
#include <QPlainTextEdit>
#include <QStandardItemModel>
#include <QTextEdit>
#include <QTreeView>
#include <QWidget>
#include "appcore.h"
2022-11-18 23:47:32 +00:00
#include "libParse.h"
2023-03-11 07:01:28 +00:00
namespace DataModel {
2022-11-18 23:47:32 +00:00
2023-03-10 13:01:19 +00:00
class StoryunitsPresentModel : public Schedule::AccessibleObject {
public:
StoryunitsPresentModel(Core::AppCore *core);
virtual ~StoryunitsPresentModel();
QStandardItemModel *treeModel() const;
QTextDocument *detailsBackend() const;
2022-11-18 23:47:32 +00:00
2023-03-10 15:18:46 +00:00
void refreshTree();
void details_show(const QList<QString> &path);
2022-11-18 23:47:32 +00:00
2023-03-10 13:01:19 +00:00
// AccessibleObject interface
public:
virtual QString name() const override;
2022-11-18 23:47:32 +00:00
2023-03-10 13:01:19 +00:00
private:
Core::AppCore *const core_ins;
2022-11-18 23:47:32 +00:00
QStandardItemModel *const model_ins;
2023-03-10 13:01:19 +00:00
QTextDocument *const details_backend;
};
2023-03-11 07:01:28 +00:00
} // namespace DataModel
namespace Components {
2023-03-10 13:01:19 +00:00
class StoryunitsPresent : public QWidget,
public Schedule::AccessibleObject {
Q_OBJECT
public:
explicit StoryunitsPresent(Schedule::CommandsDispatcher *core,
QWidget *parent = nullptr);
// AccessibleObject interface
public:
virtual QString name() const override;
private:
2023-03-10 15:18:46 +00:00
Schedule::CommandsDispatcher *const disp_core;
2022-11-18 23:47:32 +00:00
QTreeView *const units_view;
2023-03-10 13:01:19 +00:00
QTextEdit *const details_show;
2022-11-18 23:47:32 +00:00
2023-03-10 13:01:19 +00:00
void jump_to(const QModelIndex &curr);
void show_details(const QModelIndex &curr);
2022-11-18 23:47:32 +00:00
};
2023-03-10 13:01:19 +00:00
} // namespace Components
2022-11-18 23:47:32 +00:00
#endif // STORYUNITSPRESENT_H