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 | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/core/windowitemdelegate.h b/src/core/windowitemdelegate.h index 985dedc..498216d 100644 --- a/src/core/windowitemdelegate.h +++ b/src/core/windowitemdelegate.h @@ -1,25 +1,32 @@ #ifndef WINDOWITEMDELEGATE_H #define WINDOWITEMDELEGATE_H -#include <memory> - #include <QtCore/QObject> +#include <QtCore/QPoint> #include <QtGui/QWindow> -#include <QWKCore/qwkcoreglobal.h> +#include <QWKCore/corewindowagent.h> namespace QWK { - class WindowItemDelegate { + class QWK_CORE_EXPORT WindowItemDelegate { public: - WindowItemDelegate() = default; - virtual ~WindowItemDelegate() = default; + WindowItemDelegate(); + virtual ~WindowItemDelegate(); 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; + + // 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