QtNovelUI/WordsIDE/storychainspresent.h

70 lines
1.7 KiB
C
Raw Normal View History

2022-11-18 05:43:27 +00:00
#ifndef STORYCHAINSPRESENT_H
#define STORYCHAINSPRESENT_H
#include "appcore.h"
2022-12-01 13:54:04 +00:00
#include "tools.h"
2022-11-18 05:43:27 +00:00
#include <QPlainTextEdit>
#include <QStandardItemModel>
#include <QTreeView>
#include <QWidget>
#include <libParse.h>
2023-03-11 07:01:28 +00:00
namespace DataModel {
2022-11-18 05:43:27 +00:00
2023-03-10 13:01:19 +00:00
/**
* @brief
*/
2023-03-11 07:01:28 +00:00
class StorychainsPresentModel : public Schedule::AccessibleObject {
public:
2023-03-10 13:01:19 +00:00
StorychainsPresentModel(Core::AppCore *core);
virtual ~StorychainsPresentModel();
2023-03-11 07:01:28 +00:00
QStandardItemModel *treeModel() const;
2023-03-10 13:01:19 +00:00
QTextDocument *const detailsBackend() const;
2022-11-18 05:43:27 +00:00
2023-03-10 13:01:19 +00:00
void refreshTree();
void showDetails(const QList<QString> &chain_path);
2022-11-18 05:43:27 +00:00
2023-03-10 13:01:19 +00:00
// AccessibleObject interface
2023-03-11 07:01:28 +00:00
public:
2023-03-10 13:01:19 +00:00
virtual QString name() const override;
2022-11-18 05:43:27 +00:00
2023-03-11 07:01:28 +00:00
private:
Core::AppCore *const core_ins;
2022-11-18 05:43:27 +00:00
QStandardItemModel *const model_base;
2023-03-10 13:01:19 +00:00
QTextDocument *const details_base;
2023-03-11 07:01:28 +00:00
Tools::TreeSyncs<Parse::Result::DesNode *> *sync_tools;
2023-03-10 13:01:19 +00:00
};
2023-03-11 07:01:28 +00:00
} // namespace DataModel
namespace Components {
2023-03-10 13:01:19 +00:00
/**
* @brief
*/
class StorychainsPresent : public QWidget,
public Schedule::AccessibleObject {
Q_OBJECT
public:
explicit StorychainsPresent(Schedule::CommandsDispatcher *disp,
QWidget *parent = nullptr);
// AccessibleObject interface
public:
virtual QString name() const override;
private:
Schedule::CommandsDispatcher *disp_core;
2022-11-18 05:43:27 +00:00
QTreeView *const tree_view;
QPlainTextEdit *const details_show;
2023-03-10 13:01:19 +00:00
void jump_to(const QModelIndex &curr);
void detail_show(const QModelIndex &curr);
2022-11-18 05:43:27 +00:00
};
}
#endif // STORYCHAINSPRESENT_H