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
qwaylandshellsurface.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDSHELLSURFACE_H
6#define QWAYLANDSHELLSURFACE_H
7
8#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
9#include <QtWaylandCompositor/qwaylandcompositorextension.h>
10
11QT_BEGIN_NAMESPACE
12
13class QWaylandQuickShellIntegration;
14class QWaylandQuickShellSurfaceItem;
15class QWaylandShellSurfacePrivate;
16
17class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandShellSurface : public QWaylandCompositorExtension
18{
19 Q_OBJECT
20 Q_DECLARE_PRIVATE(QWaylandShellSurface)
21
22 Q_PROPERTY(Qt::WindowType windowType READ windowType NOTIFY windowTypeChanged)
23 Q_PROPERTY(bool modal READ isModal NOTIFY modalChanged FINAL REVISION(6, 8))
24 QML_NAMED_ELEMENT(ShellSurface)
25 QML_UNCREATABLE("")
26 QML_ADDED_IN_VERSION(1, 0)
27public:
28#if QT_CONFIG(wayland_compositor_quick)
29 virtual QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) = 0;
30#endif
31 QWaylandShellSurface(QWaylandObject *waylandObject);
32 virtual Qt::WindowType windowType() const { return Qt::WindowType::Window; }
33
34 bool isModal() const;
35
36protected:
37 QWaylandShellSurface(QWaylandShellSurfacePrivate &dd);
38 QWaylandShellSurface(QWaylandObject *container, QWaylandShellSurfacePrivate &dd);
39 void setModal(bool newModal);
40
41Q_SIGNALS:
42 void windowTypeChanged();
43 Q_REVISION(6, 8) void modalChanged();
44};
45
46template <typename T>
48{
49public:
50 QWaylandShellSurfaceTemplate(QWaylandObject *container = nullptr)
51 : QWaylandShellSurface(container)
52 { }
53
54 const struct wl_interface *extensionInterface() const override
55 {
56 return T::interface();
57 }
58
59 static T *findIn(QWaylandObject *container)
60 {
61 if (!container) return nullptr;
62 return qobject_cast<T *>(container->extension(T::interfaceName()));
63 }
64
65protected:
66 QWaylandShellSurfaceTemplate(QWaylandShellSurfacePrivate &dd)
67 : QWaylandShellSurface(dd)
68 { }
69
70 QWaylandShellSurfaceTemplate(QWaylandObject *container, QWaylandShellSurfacePrivate &dd)
71 : QWaylandShellSurface(container,dd)
72 { }
73};
74
75QT_END_NAMESPACE
76
77#endif // QWAYLANDSHELLSURFACE_H
\inmodule QtWaylandCompositor
\qmltype ShellSurface \nativetype QWaylandShellSurface \inqmlmodule QtWayland.Compositor
Combined button and popup list for selecting options.