2022-11-06 00:37:50 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2022-12-31 13:05:58 +00:00
|
|
|
#include "DocsManager.h"
|
2023-03-05 14:32:20 +00:00
|
|
|
#include "manager_docs.h"
|
2023-08-29 04:18:41 +00:00
|
|
|
#include "messageview.h"
|
2023-08-16 13:48:43 +00:00
|
|
|
#include "parsebridge.h"
|
2023-08-29 04:31:29 +00:00
|
|
|
#include "presentcontainerview.h"
|
2023-08-29 04:18:41 +00:00
|
|
|
#include "projectview.h"
|
2022-12-01 13:54:04 +00:00
|
|
|
#include "tools.h"
|
2023-08-29 01:37:58 +00:00
|
|
|
#include "viewsession.h"
|
2023-08-29 04:18:41 +00:00
|
|
|
#include "viewstackedbar.h"
|
2023-03-17 13:58:38 +00:00
|
|
|
#include "welcomepanel.h"
|
2023-08-31 15:33:45 +00:00
|
|
|
#include "xapp.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include <QListView>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QSplitter>
|
|
|
|
#include <QTableView>
|
|
|
|
#include <QTreeView>
|
|
|
|
#include <libProjectManager.h>
|
2023-08-27 14:09:46 +00:00
|
|
|
#include <splitpanel.h>
|
2022-11-18 23:47:32 +00:00
|
|
|
|
2023-08-27 14:09:46 +00:00
|
|
|
class MainWindow : public QMainWindow {
|
2022-11-06 00:37:50 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2023-08-29 03:52:56 +00:00
|
|
|
public:
|
2023-08-31 15:33:45 +00:00
|
|
|
MainWindow(XApp *core, const QString &layout, QWidget *parent = nullptr);
|
2023-08-29 03:52:56 +00:00
|
|
|
virtual ~MainWindow();
|
|
|
|
|
|
|
|
SplitFrame::ViewPresent *bindPresent() const;
|
|
|
|
QString layoutName() const;
|
2023-09-01 22:34:06 +00:00
|
|
|
void resetLayoutName(const QString &name);
|
2022-11-11 14:38:52 +00:00
|
|
|
|
2023-08-15 14:40:40 +00:00
|
|
|
private:
|
2023-08-29 03:52:56 +00:00
|
|
|
QString layout_name_store;
|
2023-08-27 14:09:46 +00:00
|
|
|
// model ============================================
|
2023-08-31 15:33:45 +00:00
|
|
|
XApp *const core_bind;
|
2022-12-01 13:54:04 +00:00
|
|
|
Tools::StatusSyncCore *const sync_kernel;
|
2023-08-29 01:32:49 +00:00
|
|
|
SplitFrame::ViewPresent *const present_host;
|
2023-08-29 01:37:58 +00:00
|
|
|
Core::ViewSession *const session_service;
|
2023-03-17 13:58:38 +00:00
|
|
|
|
|
|
|
// view =============================================
|
2023-08-31 15:33:45 +00:00
|
|
|
QToolBar *const actions_stack;
|
2023-08-27 14:09:46 +00:00
|
|
|
Components::ViewStackedBar *const views_bar;
|
2023-08-29 04:31:29 +00:00
|
|
|
Components::PresentContainerView *const center_frame;
|
2023-08-29 04:18:41 +00:00
|
|
|
Components::ProjectView *const project_present;
|
2022-11-17 08:16:54 +00:00
|
|
|
|
2022-11-15 12:58:12 +00:00
|
|
|
// 内部逻辑 ===========================================
|
2023-03-17 13:58:38 +00:00
|
|
|
|
2023-08-31 15:33:45 +00:00
|
|
|
void initial_menubar(QMenuBar *mbar);
|
|
|
|
void build_project_menu(QMenu *pmenu);
|
|
|
|
void build_edit_menu(QMenu *pmenu);
|
|
|
|
void build_view_menu(QMenu *pmenu);
|
2023-09-01 22:34:06 +00:00
|
|
|
void build_tools_menu(QMenu *pmenu);
|
|
|
|
void build_window_menu(QMenu *pmenu);
|
2023-08-31 15:33:45 +00:00
|
|
|
|
2022-11-17 08:16:54 +00:00
|
|
|
// QWidget interface
|
2023-08-29 03:52:56 +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
|