69 lines
2.3 KiB
C++
69 lines
2.3 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 {
|
|
typedef float pos;
|
|
typedef float width;
|
|
|
|
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;
|
|
|
|
|
|
public:
|
|
SplitWindow(QWidget *parent = nullptr);
|
|
virtual ~SplitWindow();
|
|
|
|
//======================================================
|
|
/**
|
|
* @brief 临时展示
|
|
* @param t
|
|
* @param target
|
|
*/
|
|
void tempShow(split_frame::DockType t, split_frame::ViewBase *target);
|
|
|
|
|
|
/**
|
|
* @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;
|
|
};
|
|
|
|
} // namespace split_panel
|
|
|
|
#endif // SPLITWINDOW_H
|