2022-11-06 00:37:50 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "ContentPresent.h"
|
2022-12-31 13:05:58 +00:00
|
|
|
#include "DocsManager.h"
|
2023-03-17 13:58:38 +00:00
|
|
|
#include "fragmentsorderpresent.h"
|
2023-03-05 14:32:20 +00:00
|
|
|
#include "manager_docs.h"
|
2023-03-17 13:58:38 +00:00
|
|
|
#include "messagespresent.h"
|
|
|
|
#include "presentcontainer.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "projectpresent.h"
|
2022-11-25 01:18:54 +00:00
|
|
|
#include "storyboardspresent.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "storychainspresent.h"
|
2022-11-29 03:47:12 +00:00
|
|
|
#include "storyconceptspresent.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "storyunitspresent.h"
|
2022-12-01 13:54:04 +00:00
|
|
|
#include "tools.h"
|
2023-03-17 13:58:38 +00:00
|
|
|
#include "welcomepanel.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include <QListView>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QSplitter>
|
|
|
|
#include <QTableView>
|
|
|
|
#include <QTreeView>
|
|
|
|
#include <StoryTool.h>
|
|
|
|
#include <libProjectManager.h>
|
2022-11-18 23:47:32 +00:00
|
|
|
|
2023-03-17 13:58:38 +00:00
|
|
|
class MainWindow : public QMainWindow, public Components::PresentHost, public Components::HostListener {
|
2022-11-06 00:37:50 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2023-03-11 07:01:28 +00:00
|
|
|
public:
|
2022-11-06 00:37:50 +00:00
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
2022-11-11 14:38:52 +00:00
|
|
|
|
2023-03-11 07:01:28 +00:00
|
|
|
private:
|
2022-11-22 03:42:48 +00:00
|
|
|
Core::AppCore *const app_core;
|
2023-03-11 07:01:28 +00:00
|
|
|
|
2022-12-01 13:54:04 +00:00
|
|
|
Tools::StatusSyncCore *const sync_kernel;
|
2023-03-17 13:58:38 +00:00
|
|
|
QSplitter *const split_first;
|
|
|
|
QSplitter *const split_second;
|
|
|
|
QSplitter *const split_third;
|
2022-11-15 08:07:02 +00:00
|
|
|
|
|
|
|
Project::ProjectManager *const project_manager;
|
2022-11-17 08:16:54 +00:00
|
|
|
|
2023-03-17 13:58:38 +00:00
|
|
|
// containers =======================================
|
|
|
|
Components::PresentHost *const left_funcs;
|
|
|
|
Components::PresentHost *const right_funcs;
|
|
|
|
Components::PresentHost *const center_funcs;
|
|
|
|
Components::PresentHost *const bottom_funcs;
|
|
|
|
|
|
|
|
// model ============================================
|
|
|
|
DataModel::DocumentsManager *const docs_container;
|
|
|
|
DataModel::FragmentsOrderviewModel *const fragments_model;
|
|
|
|
DataModel::StoryboardsPresentModel *const boards_model;
|
|
|
|
DataModel::StorychainsPresentModel *const chains_model;
|
|
|
|
DataModel::StoryconceptsPresentModel *const concepts_model;
|
|
|
|
DataModel::StoryunitsPresentModel *const units_model;
|
|
|
|
|
|
|
|
// view =============================================
|
|
|
|
Components::WelcomePanel *const welcome_list;
|
|
|
|
Components::MessagesPresent *const errors_present;
|
2023-03-10 13:01:19 +00:00
|
|
|
Components::ProjectPresent *const project_present;
|
2023-03-17 13:58:38 +00:00
|
|
|
Components::FragmentsOrderPresent *const fragments_order;
|
2023-03-11 07:01:28 +00:00
|
|
|
Components::StoryboardsPresent *const boards_view;
|
2023-03-17 13:58:38 +00:00
|
|
|
Components::StorychainsPresent *const chains_view;
|
2023-03-11 04:51:30 +00:00
|
|
|
Components::StoryconceptsPresent *const concept_view;
|
2023-03-17 13:58:38 +00:00
|
|
|
Components::StoryunitsPresent *const units_view;
|
2022-11-17 08:16:54 +00:00
|
|
|
|
2022-11-15 12:58:12 +00:00
|
|
|
// 内部逻辑 ===========================================
|
2023-03-10 13:01:19 +00:00
|
|
|
void initial_menubar(QMenuBar *mbar);
|
2023-03-17 13:58:38 +00:00
|
|
|
void initial_commandlist(Schedule::CommandsDispatcher *host);
|
|
|
|
|
|
|
|
void accept_view_transport(const Core::Route &key, Components::GroupType type);
|
2023-03-10 13:01:19 +00:00
|
|
|
|
2023-01-01 05:10:31 +00:00
|
|
|
void refresh_views();
|
|
|
|
|
2022-11-17 08:16:54 +00:00
|
|
|
void build_internal(bool all_from_disk = false);
|
2022-11-22 03:42:48 +00:00
|
|
|
|
2023-03-17 13:58:38 +00:00
|
|
|
void splitter_layout_save(const QList<QString> &path_type, const QList<int> &size);
|
2022-11-22 03:42:48 +00:00
|
|
|
|
2023-03-05 14:32:20 +00:00
|
|
|
// PresentContainer interface
|
2023-03-11 07:01:28 +00:00
|
|
|
public:
|
2023-03-17 13:58:38 +00:00
|
|
|
virtual QWidget *hostWidget() const override;
|
|
|
|
virtual void setVisibleState(bool state) override;
|
|
|
|
virtual bool visibleState() const override;
|
|
|
|
|
|
|
|
virtual void append(MakeTools::PresentBase *ins, const Core::Route &unique) override;
|
|
|
|
virtual bool active(const Core::Route &unique) override;
|
|
|
|
virtual MakeTools::PresentBase *remove(const Core::Route &unique) override;
|
2023-03-05 14:32:20 +00:00
|
|
|
|
2023-08-15 14:14:00 +00:00
|
|
|
virtual bool contains(MakeTools::PresentBase *ins) const override;
|
2023-03-17 13:58:38 +00:00
|
|
|
|
|
|
|
// HostListener interface
|
|
|
|
public:
|
|
|
|
virtual void hasBeenAccepted(const Core::Route &key) override;
|
|
|
|
virtual void hasBeenRemoved(const Core::Route &key) override;
|
|
|
|
virtual void hasBeenClosed(const Core::Route &key) override;
|
2023-03-05 14:32:20 +00:00
|
|
|
|
2022-11-17 08:16:54 +00:00
|
|
|
// QWidget interface
|
2023-03-11 07:01:28 +00:00
|
|
|
protected:
|
2022-11-17 08:16:54 +00:00
|
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
2022-11-18 23:47:32 +00:00
|
|
|
|
|
|
|
// QObject interface
|
2023-03-11 07:01:28 +00:00
|
|
|
public:
|
2022-11-18 23:47:32 +00:00
|
|
|
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
2022-11-06 00:37:50 +00:00
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|