QtNovelUI/WordsIDE/storychainspresent.h

73 lines
1.8 KiB
C
Raw Normal View History

2022-11-18 05:43:27 +00:00
#ifndef STORYCHAINSPRESENT_H
#define STORYCHAINSPRESENT_H
2023-03-17 13:58:38 +00:00
#include "DocsManager.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
*/
2023-03-17 13:58:38 +00:00
class StorychainsPresent : public QWidget, public MakeTools::PresentBase {
2023-03-10 13:01:19 +00:00
Q_OBJECT
public:
2023-03-17 13:58:38 +00:00
explicit StorychainsPresent(Schedule::CommandsDispatcher *disp, DataModel::StorychainsPresentModel *back, QWidget *parent = nullptr);
2023-03-10 13:01:19 +00:00
// AccessibleObject interface
public:
virtual QString name() const override;
2023-03-17 13:58:38 +00:00
// PresentBase interface
public:
virtual QWidget *widget() const override;
private:
2023-03-10 13:01:19 +00:00
Schedule::CommandsDispatcher *disp_core;
2022-11-18 05:43:27 +00:00
QTreeView *const tree_view;
2023-03-17 13:58:38 +00:00
QTextEdit *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