2020-02-22 05:47:09 +08:00
|
|
|
// NOTE: there is a separate sip/linux/FloatingDockContainer.sip as the base
|
|
|
|
// class for CFloatingDockContainer changes for Linux.
|
|
|
|
|
2019-10-09 20:15:53 +08:00
|
|
|
%Import QtWidgets/QtWidgetsmod.sip
|
|
|
|
|
|
|
|
%If (Qt_5_0_0 -)
|
|
|
|
|
2020-02-25 14:22:51 +08:00
|
|
|
%If (WS_X11)
|
|
|
|
typedef QDockWidget tFloatingWidgetBase;
|
|
|
|
%End
|
|
|
|
%If (!WS_X11)
|
|
|
|
typedef QWidget tFloatingWidgetBase;
|
|
|
|
%End
|
|
|
|
|
2019-10-09 20:15:53 +08:00
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
|
2019-12-19 06:21:34 +08:00
|
|
|
class IFloatingWidget
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <FloatingDockContainer.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
|
|
|
|
ads::eDragState DragState, QWidget* MouseEventHandler) = 0;
|
|
|
|
|
|
|
|
virtual void moveFloating() = 0;
|
2019-12-19 07:17:28 +08:00
|
|
|
virtual void finishDragging() = 0;
|
2020-06-05 05:55:02 +08:00
|
|
|
virtual ~IFloatingWidget();
|
2019-12-19 06:21:34 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-25 14:22:51 +08:00
|
|
|
class CFloatingDockContainer : tFloatingWidgetBase, ads::IFloatingWidget
|
2019-10-09 20:15:53 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <FloatingDockContainer.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
protected:
|
2019-12-19 07:17:28 +08:00
|
|
|
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
|
2019-10-09 20:15:53 +08:00
|
|
|
ads::eDragState DragState, QWidget* MouseEventHandler);
|
|
|
|
void startDragging(const QPoint& DragStartMousePos, const QSize& Size,
|
|
|
|
QWidget* MouseEventHandler);
|
2019-12-19 07:17:28 +08:00
|
|
|
virtual void finishDragging();
|
2019-10-09 20:15:53 +08:00
|
|
|
void initFloatingGeometry(const QPoint& DragStartMousePos, const QSize& Size);
|
|
|
|
void moveFloating();
|
2019-12-19 06:21:34 +08:00
|
|
|
bool restoreState(ads::CDockingStateReader& Stream, bool Testing);
|
2019-10-09 20:15:53 +08:00
|
|
|
void updateWindowTitle();
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void changeEvent(QEvent *event);
|
|
|
|
virtual void closeEvent(QCloseEvent *event);
|
|
|
|
virtual void hideEvent(QHideEvent *event);
|
|
|
|
virtual void showEvent(QShowEvent *event);
|
2020-09-01 22:06:43 +08:00
|
|
|
|
|
|
|
%If (WS_MACX)
|
|
|
|
virtual bool event(QEvent *e);
|
|
|
|
virtual void moveEvent(QMoveEvent *event);
|
|
|
|
%End
|
|
|
|
|
|
|
|
%If (WS_X11)
|
|
|
|
virtual void moveEvent(QMoveEvent *event);
|
|
|
|
virtual void resizeEvent(QResizeEvent *event);
|
2023-03-21 13:04:19 +08:00
|
|
|
virtual bool event(QEvent *e);
|
2020-09-01 22:06:43 +08:00
|
|
|
%End
|
|
|
|
|
2020-06-05 05:55:02 +08:00
|
|
|
%If (WS_WIN)
|
|
|
|
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
|
|
|
|
%End
|
|
|
|
|
2019-10-09 20:15:53 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
CFloatingDockContainer(ads::CDockManager* DockManager /TransferThis/);
|
|
|
|
CFloatingDockContainer(ads::CDockAreaWidget* DockArea /TransferThis/);
|
|
|
|
CFloatingDockContainer(ads::CDockWidget* DockWidget /TransferThis/);
|
|
|
|
virtual ~CFloatingDockContainer();
|
|
|
|
ads::CDockContainerWidget* dockContainer() const;
|
|
|
|
bool isClosable() const;
|
|
|
|
bool hasTopLevelDockWidget() const;
|
|
|
|
ads::CDockWidget* topLevelDockWidget() const;
|
|
|
|
QList<ads::CDockWidget*> dockWidgets() const;
|
2020-09-01 22:06:43 +08:00
|
|
|
|
|
|
|
%If (WS_X11)
|
|
|
|
void onMaximizeRequest();
|
|
|
|
void showNormal(bool fixGeometry);
|
|
|
|
void showMaximized();
|
|
|
|
bool isMaximized() const;
|
|
|
|
void show();
|
|
|
|
bool hasNativeTitleBar();
|
|
|
|
%End
|
2019-10-09 20:15:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
%End
|