2019-10-09 20:15:53 +08:00
|
|
|
%Import QtWidgets/QtWidgetsmod.sip
|
|
|
|
|
|
|
|
%If (Qt_5_0_0 -)
|
|
|
|
|
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Container that manages a number of dock areas with single dock widgets
|
|
|
|
* or tabyfied dock widgets in each area.
|
|
|
|
* Each window that support docking has a DockContainerWidget. That means
|
2023-08-09 01:46:12 +08:00
|
|
|
* the main application window and all floating windows contain a
|
|
|
|
* DockContainerWidget.
|
2019-10-09 20:15:53 +08:00
|
|
|
*/
|
|
|
|
class CDockContainerWidget : QFrame
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <DockContainerWidget.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool event(QEvent *e);
|
|
|
|
QSplitter* rootSplitter() const;
|
2023-08-03 02:23:49 +08:00
|
|
|
ads::CAutoHideDockContainer* createAndSetupAutoHideContainer(ads::SideBarLocation area, ads::CDockWidget* DockWidget /Transfer/, int TabIndex = -1);
|
2019-10-09 20:15:53 +08:00
|
|
|
void createRootSplitter();
|
|
|
|
void dropFloatingWidget(ads::CFloatingDockContainer* FloatingWidget, const QPoint& TargetPos);
|
2023-08-03 02:23:49 +08:00
|
|
|
void dropWidget(QWidget* Widget, DockWidgetArea DropArea, CDockAreaWidget* TargetAreaWidget, int TabIndex = -1);
|
2019-10-09 20:15:53 +08:00
|
|
|
void addDockArea(ads::CDockAreaWidget* DockAreaWidget /Transfer/, ads::DockWidgetArea area = ads::CenterDockWidgetArea);
|
2020-02-22 05:47:09 +08:00
|
|
|
void removeDockArea(ads::CDockAreaWidget* area /TransferBack/);
|
2019-10-09 20:15:53 +08:00
|
|
|
void saveState(QXmlStreamWriter& Stream) const;
|
2019-12-19 06:21:34 +08:00
|
|
|
bool restoreState(CDockingStateReader& Stream, bool Testing);
|
2019-10-09 20:15:53 +08:00
|
|
|
ads::CDockAreaWidget* lastAddedDockAreaWidget(ads::DockWidgetArea area) const;
|
|
|
|
ads::CDockWidget* topLevelDockWidget() const;
|
|
|
|
ads::CDockAreaWidget* topLevelDockArea() const;
|
|
|
|
QList<ads::CDockWidget*> dockWidgets() const;
|
2020-09-01 22:06:43 +08:00
|
|
|
void updateSplitterHandles(QSplitter* splitter);
|
2023-03-21 13:04:19 +08:00
|
|
|
void registerAutoHideWidget(ads::CAutoHideDockContainer* AutoHideWidget /Transfer/);
|
|
|
|
void removeAutoHideWidget(ads::CAutoHideDockContainer* AutoHideWidget /TransferBack/);
|
|
|
|
void handleAutoHideWidgetEvent(QEvent* e, QWidget* w);
|
2019-10-09 20:15:53 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
CDockContainerWidget(ads::CDockManager* DockManager /TransferThis/, QWidget* parent /TransferThis/ = 0);
|
|
|
|
virtual ~CDockContainerWidget();
|
|
|
|
ads::CDockAreaWidget* addDockWidget(ads::DockWidgetArea area, ads::CDockWidget* Dockwidget /Transfer/,
|
2023-03-21 13:04:19 +08:00
|
|
|
ads::CDockAreaWidget* DockAreaWidget /Transfer/ = 0,
|
|
|
|
int Index = -1);
|
2019-10-09 20:15:53 +08:00
|
|
|
void removeDockWidget(ads::CDockWidget* Dockwidget) /TransferBack/;
|
|
|
|
virtual unsigned int zOrderIndex() const;
|
|
|
|
bool isInFrontOf(ads::CDockContainerWidget* Other) const;
|
|
|
|
ads::CDockAreaWidget* dockAreaAt(const QPoint& GlobalPos) const;
|
|
|
|
ads::CDockAreaWidget* dockArea(int Index) const;
|
|
|
|
QList<ads::CDockAreaWidget*> openedDockAreas() const;
|
2023-03-21 13:04:19 +08:00
|
|
|
QList<ads::CDockWidget*> openedDockWidgets() const;
|
2020-02-22 05:47:09 +08:00
|
|
|
bool hasTopLevelDockWidget() const;
|
2019-10-09 20:15:53 +08:00
|
|
|
int dockAreaCount() const;
|
|
|
|
int visibleDockAreaCount() const;
|
|
|
|
bool isFloating() const;
|
|
|
|
void dumpLayout();
|
|
|
|
ads::CDockWidget::DockWidgetFeatures features() const;
|
|
|
|
ads::CFloatingDockContainer* floatingWidget() const;
|
|
|
|
void closeOtherAreas(ads::CDockAreaWidget* KeepOpenArea);
|
2023-08-03 02:23:49 +08:00
|
|
|
ads::CAutoHideSideBar* autoHideSideBar(SideBarLocation area) const;
|
2023-03-21 13:04:19 +08:00
|
|
|
QList<ads::CAutoHideDockContainer*> autoHideWidgets() const;
|
|
|
|
QRect contentRect() const;
|
|
|
|
QRect contentRectGlobal() const;
|
|
|
|
ads::CDockManager* dockManager() const;
|
2019-10-09 20:15:53 +08:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void dockAreasAdded();
|
2023-03-21 13:04:19 +08:00
|
|
|
void autoHideWidgetCreated(ads::CAutoHideDockContainer* AutoHideWidget);
|
2019-10-09 20:15:53 +08:00
|
|
|
void dockAreasRemoved();
|
|
|
|
void dockAreaViewToggled(ads::CDockAreaWidget* DockArea, bool Open);
|
|
|
|
};
|
2023-03-21 13:04:19 +08:00
|
|
|
|
|
|
|
};
|
2019-10-09 20:15:53 +08:00
|
|
|
|
|
|
|
%End
|