QtNovelUI/WordsIDE/viewsession.h

50 lines
1.6 KiB
C
Raw Normal View History

2023-08-29 01:37:58 +00:00
#ifndef VIEWSESSION_H
#define VIEWSESSION_H
#include "projectview.h"
#include <QList>
#include <QMainWindow>
#include <QStandardItemModel>
#include <libConfig.h>
2023-08-29 04:31:29 +00:00
#include <presentcontainerview.h>
2023-12-30 05:04:51 +00:00
#include <splitwindow.h>
class MainWindow;
namespace Core {
2023-08-29 01:37:58 +00:00
class ViewSession : public QObject {
Q_OBJECT
public:
ViewSession(Config::Configration *port, MainWindow *host);
2023-08-29 04:31:29 +00:00
void initPresentView(Components::PresentContainerView *center_frame, Components::ProjectView *project_present, QStandardItemModel *model);
2023-12-30 05:04:51 +00:00
void viewStatesSave(QMainWindow *win, SplitFrame::SplitPanel *root);
void viewStatesRestore(QMainWindow *win, SplitFrame::SplitPanel *root);
private:
QList<QString> base_path;
2023-12-30 05:04:51 +00:00
SplitFrame::SplitPanel *host;
SplitFrame::RectCom *edit_panel = nullptr;
Config::Configration *const recover_port;
QHash<QString, SplitFrame::RectCom *> view_store;
typedef float split_pos;
typedef float split_width;
2023-12-27 11:59:08 +00:00
std::map<SplitFrame::SplitView *, std::tuple<SplitFrame::SplitType, split_pos, split_width>> split_infos;
SplitFrame::RectCom *views_state_restore(const QHash<QString, SplitFrame::RectCom *> &cache, const QList<QString> &target_path,
2023-12-30 05:04:51 +00:00
Config::Configration *port, SplitFrame::SplitPanel *host);
void relayout_cascade(SplitFrame::RectCom *root);
// QObject interface
public:
virtual bool eventFilter(QObject *watched, QEvent *event) override;
};
} // namespace Core
2023-08-29 01:37:58 +00:00
#endif // VIEWSESSION_H