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_HARMONY)
41#include <optional>
42
43typedef struct ArkUI_Node *ArkUI_NodeHandle;
44#endif
45
47
48class QMargins;
49
56
57// ----------------- QNativeInterface -----------------
58
59namespace QNativeInterface::Private {
60
61#if defined(Q_OS_WASM) || defined(Q_QDOC)
63{
65 virtual emscripten::val document() const = 0;
66 virtual emscripten::val clientArea() const = 0;
67 virtual emscripten::val canvas() const = 0;
68};
69#endif
70
71#if defined(Q_OS_MACOS) || defined(Q_QDOC)
73{
75 virtual QPoint bottomLeftClippedByNSWindowOffset() const = 0;
76 virtual CALayer *contentLayer() const = 0;
80};
81#endif
82
83#if QT_CONFIG(xcb) || defined(Q_QDOC)
85{
87
88 enum WindowType {
89 None = 0x000000,
90 Normal = 0x000001,
91 Desktop = 0x000002,
92 Dock = 0x000004,
93 Toolbar = 0x000008,
94 Menu = 0x000010,
95 Utility = 0x000020,
96 Splash = 0x000040,
97 Dialog = 0x000080,
98 DropDownMenu = 0x000100,
99 PopupMenu = 0x000200,
100 Tooltip = 0x000400,
101 Notification = 0x000800,
102 Combo = 0x001000,
103 Dnd = 0x002000,
104 KdeOverride = 0x004000
105 };
107
108 virtual void setWindowType(WindowTypes type) = 0;
109 virtual void setWindowRole(const QString &role) = 0;
110 virtual void setWindowIconText(const QString &text) = 0;
111 virtual uint visualId() const = 0;
112};
113#endif // xcb
114
115#if defined(Q_OS_WIN) || defined(Q_QDOC)
117{
119
120 virtual void setHasBorderInFullScreen(bool border) = 0;
121 virtual bool hasBorderInFullScreen() const = 0;
122
123 virtual QMargins customMargins() const = 0;
124 virtual void setCustomMargins(const QMargins &margins) = 0;
125};
126#endif // Q_OS_WIN
127
128#if QT_CONFIG(wayland)
129struct Q_GUI_EXPORT QWaylandWindow : public QObject
130{
132public:
134
135 enum WindowType {
136 Default,
137 ToolTip,
138 ComboBox,
139 Menu,
140 SubMenu,
141 };
142
143 virtual wl_surface *surface() const = 0;
144 virtual void setCustomMargins(const QMargins &margins) = 0;
145 virtual void requestXdgActivationToken(uint serial) = 0;
146 template<typename T>
147 T *surfaceRole() const
148 {
150 auto role = std::any_cast<T *>(&anyRole);
151 return role ? *role : nullptr;
152 }
153 virtual void setSessionRestoreId(const QString &role) = 0;
154
156 virtual void setParentControlGeometry(const QRect &parentAnchor) = 0;
157
159 void surfaceCreated();
160 void surfaceDestroyed();
161 void surfaceRoleCreated();
164
165protected:
166 virtual std::any _surfaceRole() const = 0;
167};
168#endif
169
170#if defined(Q_OS_HARMONY)
172{
175 virtual std::optional<double> windowId() const = 0;
176};
177
179{
183};
184#endif // defined(Q_OS_HARMONY)
185
186} // QNativeInterface::Private
187
188QT_END_NAMESPACE
189
190#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