Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qplatformwindow_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QPLATFORMWINDOW_P_H
6#define QPLATFORMWINDOW_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/private/qtguiglobal_p.h>
20#include <QtCore/qbasictimer.h>
21#include <QtCore/qrect.h>
22#include <QtCore/qnativeinterface.h>
23#include <QtGui/qwindow.h>
24
25#if QT_CONFIG(wayland)
26#include <any>
27#include <QtCore/qobject.h>
28
29struct wl_surface;
30#endif
31
32#if defined(Q_OS_MACOS)
34typedef long NSInteger;
38#endif
39
40#if defined(Q_OS_OHOS)
41typedef struct ArkUI_Node *ArkUI_NodeHandle;
42#endif
43
45
46class QMargins;
47
54
55// ----------------- QNativeInterface -----------------
56
57namespace QNativeInterface::Private {
58
59#if defined(Q_OS_WASM) || defined(Q_QDOC)
61{
63 virtual emscripten::val document() const = 0;
64 virtual emscripten::val clientArea() const = 0;
65 virtual emscripten::val canvas() const = 0;
66};
67#endif
68
69#if defined(Q_OS_MACOS) || defined(Q_QDOC)
71{
73 virtual QPoint bottomLeftClippedByNSWindowOffset() const = 0;
74 virtual CALayer *contentLayer() const = 0;
78};
79#endif
80
81#if QT_CONFIG(xcb) || defined(Q_QDOC)
83{
85
86 enum WindowType {
87 None = 0x000000,
88 Normal = 0x000001,
89 Desktop = 0x000002,
90 Dock = 0x000004,
91 Toolbar = 0x000008,
92 Menu = 0x000010,
93 Utility = 0x000020,
94 Splash = 0x000040,
95 Dialog = 0x000080,
96 DropDownMenu = 0x000100,
97 PopupMenu = 0x000200,
98 Tooltip = 0x000400,
99 Notification = 0x000800,
100 Combo = 0x001000,
101 Dnd = 0x002000,
102 KdeOverride = 0x004000
103 };
105
106 virtual void setWindowType(WindowTypes type) = 0;
107 virtual void setWindowRole(const QString &role) = 0;
108 virtual void setWindowIconText(const QString &text) = 0;
109 virtual uint visualId() const = 0;
110};
111#endif // xcb
112
113#if defined(Q_OS_WIN) || defined(Q_QDOC)
115{
117
118 virtual void setHasBorderInFullScreen(bool border) = 0;
119 virtual bool hasBorderInFullScreen() const = 0;
120
121 virtual QMargins customMargins() const = 0;
122 virtual void setCustomMargins(const QMargins &margins) = 0;
123};
124#endif // Q_OS_WIN
125
126#if QT_CONFIG(wayland)
127struct Q_GUI_EXPORT QWaylandWindow : public QObject
128{
130public:
132
133 enum WindowType {
134 Default,
135 ToolTip,
136 ComboBox,
137 Menu,
138 SubMenu,
139 };
140
141 virtual wl_surface *surface() const = 0;
142 virtual void setCustomMargins(const QMargins &margins) = 0;
143 virtual void requestXdgActivationToken(uint serial) = 0;
144 template<typename T>
145 T *surfaceRole() const
146 {
148 auto role = std::any_cast<T *>(&anyRole);
149 return role ? *role : nullptr;
150 }
151 virtual void setSessionRestoreId(const QString &role) = 0;
152
154 virtual void setParentControlGeometry(const QRect &parentAnchor) = 0;
155
157 void surfaceCreated();
158 void surfaceDestroyed();
159 void surfaceRoleCreated();
162
163protected:
164 virtual std::any _surfaceRole() const = 0;
165};
166#endif
167
168#if defined(Q_OS_OHOS)
170{
173};
174
176{
179};
180#endif // defined(Q_OS_OHOS)
181
182} // QNativeInterface::Private
183
184QT_END_NAMESPACE
185
186#endif // QPLATFORMWINDOW_P_H
\inmodule QtCore
Definition qmargins.h:27
Combined button and popup list for selecting options.
static QSize fixInitialSize(QSize size, const QWindow *w, int deviceIndependentDefaultWidth, int deviceIndependentDefaultHeight)
static const QScreen * effectiveScreen(const QWindow *window)
#define QWINDOWSIZE_MAX