2023-08-29 01:37:58 +00:00
|
|
|
#ifndef VIEWSESSION_H
|
|
|
|
#define VIEWSESSION_H
|
2023-08-29 01:32:49 +00:00
|
|
|
|
2023-08-29 04:18:41 +00:00
|
|
|
#include "projectview.h"
|
2023-08-29 01:32:49 +00:00
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QStandardItemModel>
|
|
|
|
#include <libConfig.h>
|
2023-08-29 04:31:29 +00:00
|
|
|
#include <presentcontainerview.h>
|
2023-08-29 01:32:49 +00:00
|
|
|
#include <splitpanel.h>
|
|
|
|
|
2023-08-29 03:52:56 +00:00
|
|
|
class MainWindow;
|
|
|
|
|
2023-08-29 01:32:49 +00:00
|
|
|
namespace Core {
|
2023-08-29 01:37:58 +00:00
|
|
|
class ViewSession : public QObject {
|
2023-08-29 01:32:49 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-08-29 03:52:56 +00:00
|
|
|
ViewSession(Config::Configration *port, MainWindow *host);
|
2023-08-29 01:32:49 +00:00
|
|
|
|
2023-08-29 04:31:29 +00:00
|
|
|
void initPresentView(Components::PresentContainerView *center_frame, Components::ProjectView *project_present, QStandardItemModel *model);
|
2023-08-29 01:32:49 +00:00
|
|
|
|
|
|
|
void viewStatesSave(QMainWindow *win, SplitFrame::ViewPresent *root);
|
|
|
|
void viewStatesRestore(QMainWindow *win, SplitFrame::ViewPresent *root);
|
|
|
|
|
|
|
|
private:
|
2023-08-29 03:52:56 +00:00
|
|
|
QList<QString> base_path;
|
2023-08-29 01:32:49 +00:00
|
|
|
SplitFrame::ViewPresent *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;
|
2023-08-29 01:32:49 +00:00
|
|
|
|
|
|
|
SplitFrame::RectCom *views_state_restore(const QHash<QString, SplitFrame::RectCom *> &cache, const QList<QString> &target_path,
|
|
|
|
Config::Configration *port, SplitFrame::ViewPresent *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
|