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)
35typedef long NSInteger;
39#endif
40
41#if defined(Q_OS_WIN)
42#include <QtGui/qwindowdefs_win.h>
43#endif
44
45#if defined(Q_OS_HARMONY)
46#include <optional>
47
48typedef struct ArkUI_Node *ArkUI_NodeHandle;
49#endif
50
52
53class QMargins;
54
61
62// ----------------- QNativeInterface -----------------
63
64namespace QNativeInterface::Private {
65
66#if defined(Q_OS_WASM) || defined(Q_QDOC)
68{
70 virtual emscripten::val document() const = 0;
71 virtual emscripten::val clientArea() const = 0;
72 virtual emscripten::val canvas() const = 0;
73};
74#endif
75
76#if defined(Q_OS_MACOS) || defined(Q_QDOC)
78{
80 virtual NSView *view() const = 0;
81 virtual QPoint bottomLeftClippedByNSWindowOffset() const = 0;
82 virtual CALayer *contentLayer() const = 0;
86 virtual void enableTrackpadTouchDelivery(bool enable) = 0;
87};
88#endif
89
90#if QT_CONFIG(xcb) || defined(Q_QDOC)
92{
94
95 enum WindowType {
96 None = 0x000000,
97 Normal = 0x000001,
98 Desktop = 0x000002,
99 Dock = 0x000004,
100 Toolbar = 0x000008,
101 Menu = 0x000010,
102 Utility = 0x000020,
103 Splash = 0x000040,
104 Dialog = 0x000080,
105 DropDownMenu = 0x000100,
106 PopupMenu = 0x000200,
107 Tooltip = 0x000400,
108 Notification = 0x000800,
109 Combo = 0x001000,
110 Dnd = 0x002000,
111 KdeOverride = 0x004000
112 };
114
115 virtual void setWindowType(WindowTypes type) = 0;
116 virtual void setWindowRole(const QString &role) = 0;
117 virtual void setWindowIconText(const QString &text) = 0;
118 virtual uint visualId() const = 0;
119};
120#endif // xcb
121
122#if defined(Q_OS_WIN) || defined(Q_QDOC)
124{
126
127 virtual HWND handle() const = 0;
128
129 virtual void setHasBorderInFullScreen(bool border) = 0;
130 virtual bool hasBorderInFullScreen() const = 0;
131
132 virtual QMargins customMargins() const = 0;
133 virtual void setCustomMargins(const QMargins &margins) = 0;
134};
135#endif // Q_OS_WIN
136
137#if QT_CONFIG(wayland)
138struct Q_GUI_EXPORT QWaylandWindow : public QObject
139{
141public:
143
144 enum WindowType {
145 Default,
146 ToolTip,
147 ComboBox,
148 Menu,
149 SubMenu,
150 };
151
152 virtual wl_surface *surface() const = 0;
153 virtual void setCustomMargins(const QMargins &margins) = 0;
154 virtual void requestXdgActivationToken(uint serial) = 0;
155 template<typename T>
156 T *surfaceRole() const
157 {
159 auto role = std::any_cast<T *>(&anyRole);
160 return role ? *role : nullptr;
161 }
162 virtual void setSessionRestoreId(const QString &role) = 0;
163
165 virtual void setParentControlGeometry(const QRect &parentAnchor) = 0;
166
168 void surfaceCreated();
169 void surfaceDestroyed();
170 void surfaceRoleCreated();
173
174protected:
175 virtual std::any _surfaceRole() const = 0;
176};
177#endif
178
179#if defined(Q_OS_HARMONY)
181{
184 virtual std::optional<double> windowId() const = 0;
185};
186
188{
192};
193#endif // defined(Q_OS_HARMONY)
194
195} // QNativeInterface::Private
196
197QT_END_NAMESPACE
198
199#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