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