Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwaylandqtshellchrome.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDQTSHELLCHROME_H
5#define QWAYLANDQTSHELLCHROME_H
6
7#include <QtQuick/qquickitem.h>
8#include <QtWaylandCompositor/qwaylandquickshellsurfaceitem.h>
9
11
13class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQtShellChrome : public QQuickItem
14{
16 Q_DECLARE_PRIVATE(QWaylandQtShellChrome)
17 Q_PROPERTY(bool hasDecorations READ hasDecorations NOTIFY windowMetaInfoChanged)
18 Q_PROPERTY(uint windowState READ currentWindowState NOTIFY currentWindowStateChanged)
19 Q_PROPERTY(uint windowFlags READ currentWindowFlags NOTIFY currentWindowFlagsChanged)
20 Q_PROPERTY(QWaylandQuickShellSurfaceItem *shellSurfaceItem READ shellSurfaceItem WRITE setShellSurfaceItem NOTIFY shellSurfaceItemChanged)
21 Q_PROPERTY(QRect maximizedRect READ maximizedRect WRITE setMaximizedRect NOTIFY maximizedRectChanged)
22
23 Q_PROPERTY(int frameMarginLeft READ frameMarginLeft WRITE setFrameMarginLeft NOTIFY frameMarginChanged)
24 Q_PROPERTY(int frameMarginRight READ frameMarginRight WRITE setFrameMarginRight NOTIFY frameMarginChanged)
25 Q_PROPERTY(int frameMarginTop READ frameMarginTop WRITE setFrameMarginTop NOTIFY frameMarginChanged)
26 Q_PROPERTY(int frameMarginBottom READ frameMarginBottom WRITE setFrameMarginBottom NOTIFY frameMarginChanged)
27
28 Q_PROPERTY(QQuickItem *titleBar READ titleBar WRITE setTitleBar NOTIFY titleBarChanged);
29 Q_PROPERTY(QQuickItem *leftResizeHandle READ leftResizeHandle WRITE setLeftResizeHandle NOTIFY leftResizeHandleChanged);
30 Q_PROPERTY(QQuickItem *rightResizeHandle READ rightResizeHandle WRITE setRightResizeHandle NOTIFY rightResizeHandleChanged);
31 Q_PROPERTY(QQuickItem *topResizeHandle READ topResizeHandle WRITE setTopResizeHandle NOTIFY topResizeHandleChanged);
32 Q_PROPERTY(QQuickItem *bottomResizeHandle READ bottomResizeHandle WRITE setBottomResizeHandle NOTIFY bottomResizeHandleChanged);
33 Q_PROPERTY(QQuickItem *topLeftResizeHandle READ topLeftResizeHandle WRITE setTopLeftResizeHandle NOTIFY topLeftResizeHandleChanged);
34 Q_PROPERTY(QQuickItem *topRightResizeHandle READ topRightResizeHandle WRITE setTopRightResizeHandle NOTIFY topRightResizeHandleChanged);
35 Q_PROPERTY(QQuickItem *bottomLeftResizeHandle READ bottomLeftResizeHandle WRITE setBottomLeftResizeHandle NOTIFY bottomLeftResizeHandleChanged);
36 Q_PROPERTY(QQuickItem *bottomRightResizeHandle READ bottomRightResizeHandle WRITE setBottomRightResizeHandle NOTIFY bottomRightResizeHandleChanged);
37public:
39 ~QWaylandQtShellChrome() override;
40
41 bool hasTitleBar() const;
42 bool hasDecorations() const;
43 uint currentWindowState() const;
44 uint currentWindowFlags() const;
45
46 void setMaximizedRect(const QRect &rect);
47 QRect maximizedRect() const;
48
49 void setShellSurfaceItem(QWaylandQuickShellSurfaceItem *shellSurfaceItem);
50 QWaylandQuickShellSurfaceItem *shellSurfaceItem() const;
51
52 void setTitleBar(QQuickItem *item);
53 QQuickItem *titleBar() const;
54
55 void setLeftResizeHandle(QQuickItem *item);
56 QQuickItem *leftResizeHandle() const;
57
58 void setRightResizeHandle(QQuickItem *item);
59 QQuickItem *rightResizeHandle() const;
60
61 void setTopResizeHandle(QQuickItem *item);
62 QQuickItem *topResizeHandle() const;
63
64 void setBottomResizeHandle(QQuickItem *item);
65 QQuickItem *bottomResizeHandle() const;
66
67 void setTopLeftResizeHandle(QQuickItem *item);
68 QQuickItem *topLeftResizeHandle() const;
69
70 void setBottomLeftResizeHandle(QQuickItem *item);
71 QQuickItem *bottomLeftResizeHandle() const;
72
73 void setTopRightResizeHandle(QQuickItem *item);
74 QQuickItem *topRightResizeHandle() const;
75
76 void setBottomRightResizeHandle(QQuickItem *item);
77 QQuickItem *bottomRightResizeHandle() const;
78
79 int frameMarginLeft() const;
80 void setFrameMarginLeft(int left);
81
82 int frameMarginRight() const;
83 void setFrameMarginRight(int right);
84
85 int frameMarginTop() const;
86 void setFrameMarginTop(int top);
87
88 int frameMarginBottom() const;
89 void setFrameMarginBottom(int bottom);
90
97
107
108 void activated();
110
113
114public Q_SLOTS:
115 void raise();
116 void lower();
117 void toggleMaximized();
118 void toggleMinimized();
119 void toggleFullScreen();
120 void activate();
121 void deactivate();
122
123private Q_SLOTS:
124 void activateOnGrab(QPointingDevice::GrabTransition transition);
125 void updateSurface();
126 void updateShellSurface();
127 void updateWindowFlags();
128 void updateWindowState();
129 void updateGeometry();
130 void updateDecorations();
131 void updateActiveState();
132 void updateAutomaticPosition();
133 void stopGrab();
134 void leftResize();
135 void rightResize();
136 void topResize();
137 void bottomResize();
138 void topLeftResize();
139 void topRightResize();
140 void bottomLeftResize();
141 void bottomRightResize();
142 void titleBarMove();
143
144protected:
146
147private:
148 void setWindowState(uint nextState);
149 void init();
150 QRect maxContentRect() const;
151};
152
154
155#endif // QWAYLANDQTSHELLSURFACEITEM_H
GrabTransition
This enum represents a transition of exclusive or passive grab from one object (possibly nullptr) to ...
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
\inmodule QtCore\reentrant
Definition qrect.h:30
void currentWindowFlagsChanged()
void bottomResizeHandleChanged()
void bottomLeftResizeHandleChanged()
void bottomRightResizeHandleChanged()
void currentWindowStateChanged()
void topRightResizeHandleChanged()
void topLeftResizeHandleChanged()
\qmltype ShellSurfaceItem \instantiates QWaylandQuickShellSurfaceItem \inherits WaylandQuickItem \inq...
rect
[4]
Combined button and popup list for selecting options.
GLdouble GLdouble GLdouble GLdouble top
GLdouble GLdouble right
GLint left
GLint GLint bottom
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
unsigned int uint
Definition qtypes.h:29
QGraphicsItem * item
w setWindowState(w->windowState() ^ Qt::WindowFullScreen)
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent