From 3cfe15a9c3db0993d8b8fef5d148625840e5a75c Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周二, 05 12月 2023 15:43:39 +0800 Subject: [PATCH] Add host interface --- src/core/windowitemdelegate.h | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/core/windowitemdelegate.h b/src/core/windowitemdelegate.h index 9886fa5..498216d 100644 --- a/src/core/windowitemdelegate.h +++ b/src/core/windowitemdelegate.h @@ -2,27 +2,35 @@ #define WINDOWITEMDELEGATE_H #include <QtCore/QObject> +#include <QtCore/QPoint> #include <QtGui/QWindow> -#include <QWKCore/qwkcoreglobal.h> +#include <QWKCore/corewindowagent.h> namespace QWK { - class WindowItemDelegate { - Q_DISABLE_COPY(WindowItemDelegate) + class QWK_CORE_EXPORT WindowItemDelegate { + public: + WindowItemDelegate(); + virtual ~WindowItemDelegate(); public: - WindowItemDelegate() = default; - virtual ~WindowItemDelegate() = default; - - public: + // Item property query virtual QWindow *window(QObject *obj) const = 0; - virtual bool isEnabled(QObject *obj) const = 0; virtual bool isVisible(QObject *obj) const = 0; - }; + virtual QRect mapGeometryToScene(const QObject *obj) const = 0; - using WindowItemDelegatePtr = std::shared_ptr<WindowItemDelegate>; + // Host property query + virtual QWindow *hostWindow(QObject *host) const = 0; + virtual bool isHostSizeFixed(QObject *host) const = 0; + + // Callbacks + virtual bool resetQtGrabbedControl() const; + + private: + Q_DISABLE_COPY_MOVE(WindowItemDelegate) + }; } -- Gitblit v1.9.1