windowitemdelegate_p.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright (C) 2023-2024 Stdware Collections (https://www.github.com/stdware)
  2. // Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao)
  3. // SPDX-License-Identifier: Apache-2.0
  4. #ifndef WINDOWITEMDELEGATE_P_H
  5. #define WINDOWITEMDELEGATE_P_H
  6. //
  7. // W A R N I N G !!!
  8. // -----------------
  9. //
  10. // This file is not part of the QWindowKit API. It is used purely as an
  11. // implementation detail. This header file may change from version to
  12. // version without notice, or may even be removed.
  13. //
  14. #include <QtCore/QObject>
  15. #include <QtCore/QPoint>
  16. #include <QtGui/QWindow>
  17. #include <core/kernel/winidchangeeventfilter_p.h>
  18. #include <core/qwkglobal.h>
  19. namespace QWK {
  20. class QWK_CORE_EXPORT WindowItemDelegate {
  21. public:
  22. WindowItemDelegate();
  23. virtual ~WindowItemDelegate();
  24. public:
  25. // Item property query
  26. virtual QWindow *window(const QObject *obj) const = 0;
  27. virtual bool isEnabled(const QObject *obj) const = 0;
  28. virtual bool isVisible(const QObject *obj) const = 0;
  29. virtual QRect mapGeometryToScene(const QObject *obj) const = 0;
  30. // Host property query
  31. virtual QWindow *hostWindow(const QObject *host) const = 0;
  32. virtual bool isWindowActive(const QObject *host) const = 0;
  33. virtual Qt::WindowStates getWindowState(const QObject *host) const = 0;
  34. virtual Qt::WindowFlags getWindowFlags(const QObject *host) const = 0;
  35. virtual QRect getGeometry(const QObject *host) const = 0;
  36. // Callbacks
  37. virtual void resetQtGrabbedControl(QObject *host) const;
  38. virtual void setWindowState(QObject *host, Qt::WindowStates state) const = 0;
  39. virtual void setCursorShape(QObject *host, Qt::CursorShape shape) const = 0;
  40. virtual void restoreCursorShape(QObject *host) const = 0;
  41. virtual void setWindowFlags(QObject *host, Qt::WindowFlags flags) const = 0;
  42. virtual void setWindowVisible(QObject *host, bool visible) const = 0;
  43. virtual void setGeometry(QObject *host, const QRect &rect) = 0;
  44. virtual void bringWindowToTop(QObject *host) const = 0;
  45. // Factories
  46. virtual WinIdChangeEventFilter *
  47. createWinIdEventFilter(QObject *host, AbstractWindowContext *context) const;
  48. private:
  49. Q_DISABLE_COPY(WindowItemDelegate)
  50. };
  51. }
  52. #endif // WINDOWITEMDELEGATE_P_H