78 lines
2.9 KiB
C++
78 lines
2.9 KiB
C++
#ifndef SPLITWINDOW_H
|
||
#define SPLITWINDOW_H
|
||
|
||
#include "libSplitView.h"
|
||
#include "AcceptPanel.h"
|
||
|
||
#include <QMainWindow>
|
||
#include <QWidget>
|
||
#include <libConfig.h>
|
||
#include <QToolBar>
|
||
|
||
namespace split_window {
|
||
|
||
/**
|
||
* @brief 窗口即视图资源管理器
|
||
*/
|
||
class SPLITVIEW_EXPORT SplitWindow : public QMainWindow, public split_frame::ResManager, public split_frame::FreedomViewsListener {
|
||
private:
|
||
bool active = false;
|
||
QToolBar *const unused_stack;
|
||
QList<split_frame::FreedomViewsListener*> listener_list;
|
||
|
||
QHash<qulonglong, split_frame::ViewBase*> presents_store;
|
||
accept_panel::AcceptPanel *const accept_port;
|
||
split_frame::ViewRes *view_root = nullptr, *temp_show = nullptr;
|
||
split_frame::ViewBase *adjust_target = nullptr;
|
||
|
||
// freedom-records:tuple<ID,tuple<ptr,replace,close,retrieve>>
|
||
QHash<qulonglong, std::tuple<split_frame::ViewBase*, bool, bool, bool>> freedom_records;
|
||
|
||
|
||
public:
|
||
SplitWindow(QWidget *parent = nullptr);
|
||
virtual ~SplitWindow();
|
||
|
||
//======================================================
|
||
/**
|
||
* @brief 临时展示
|
||
* @param t
|
||
* @param target
|
||
*/
|
||
void tempShow(split_frame::ViewBase *target);
|
||
|
||
void freedomHasBeenRemoved(split_frame::ViewBase *inst);
|
||
void freedomHasBeenAppended(split_frame::ViewBase *inst);
|
||
|
||
/**
|
||
* @brief 璁剧疆鎸囧畾瑙嗗浘涓烘牴瑙嗗浘鎴栬€呭彇娑 * @param inst
|
||
*/
|
||
void setPresentTarget(split_frame::ViewRes *inst = nullptr);
|
||
|
||
bool eventFilter(QObject *sender, QEvent *ev) override;
|
||
|
||
// ResManager interface
|
||
public:
|
||
virtual void addListener(split_frame::FreedomViewsListener *lsn) override;
|
||
virtual void removeListener(split_frame::FreedomViewsListener *lsn) override;
|
||
virtual void appendPresentView(split_frame::ViewBase *inst) override;
|
||
virtual void removePresentView(split_frame::ViewBase *inst) override;
|
||
virtual bool isPresented(split_frame::ViewBase *inst) const override;
|
||
virtual void doRetrieve(split_frame::ViewBase *inst) override;
|
||
virtual void doClose(split_frame::ViewBase *inst) override;
|
||
virtual void siblingAttach(split_frame::ViewBase *view, split_frame::ViewBase *pos, split_frame::SplitType ori) override;
|
||
virtual split_frame::ViewBase *adjustView() const override;
|
||
virtual void setAdjustView(split_frame::ViewBase *target) override;
|
||
|
||
// FreedomViewsListener interface
|
||
public:
|
||
virtual void freedomAppend(split_frame::ViewBase *ins) override;
|
||
virtual void freedomRemove(split_frame::ViewBase *ins) override;
|
||
virtual void aboutToBeDelete(split_frame::ViewBase *inst) override;
|
||
virtual void hasBeenAppend(split_frame::ViewBase *inst) override;
|
||
};
|
||
|
||
} // namespace split_panel
|
||
|
||
#endif // SPLITWINDOW_H
|