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
qwaylandshell.h
Go to the documentation of this file.
1// Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDSHELL_H
6#define QWAYLANDSHELL_H
7
8#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
9#include <QtWaylandCompositor/qwaylandcompositorextension.h>
10
11QT_BEGIN_NAMESPACE
12
13class QWaylandShellPrivate;
14
15class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandShell : public QWaylandCompositorExtension
16{
17 Q_OBJECT
18 Q_DECLARE_PRIVATE(QWaylandShell)
19 Q_PROPERTY(FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy NOTIFY focusPolicyChanged)
20
21 QML_NAMED_ELEMENT(Shell)
22 QML_UNCREATABLE("")
23 QML_ADDED_IN_VERSION(1, 0)
24public:
25 enum FocusPolicy {
26 AutomaticFocus,
27 ManualFocus
28 };
29 Q_ENUM(FocusPolicy)
30
31 QWaylandShell();
32 QWaylandShell(QWaylandObject *waylandObject);
33
34 FocusPolicy focusPolicy() const;
35 void setFocusPolicy(FocusPolicy focusPolicy);
36
37Q_SIGNALS:
38 void focusPolicyChanged();
39
40protected:
41 explicit QWaylandShell(QWaylandShellPrivate &dd);
42 explicit QWaylandShell(QWaylandObject *container, QWaylandShellPrivate &dd);
43};
44
45template <typename T>
47{
48public:
49 QWaylandShellTemplate()
50 : QWaylandShell()
51 { }
52
53 QWaylandShellTemplate(QWaylandObject *container)
54 : QWaylandShell(container)
55 { }
56
57 const struct wl_interface *extensionInterface() const override
58 {
59 return T::interface();
60 }
61
62 static T *findIn(QWaylandObject *container)
63 {
64 if (!container) return nullptr;
65 return qobject_cast<T *>(container->extension(T::interfaceName()));
66 }
67
68protected:
69 QWaylandShellTemplate(QWaylandShellPrivate &dd)
70 : QWaylandShell(dd)
71 { }
72
73 QWaylandShellTemplate(QWaylandObject *container, QWaylandShellPrivate &dd)
74 : QWaylandShell(container,dd)
75 { }
76};
77
78QT_END_NAMESPACE
79
80#endif // QWAYLANDSHELL_H
\inmodule QtWaylandCompositor \abstract
Combined button and popup list for selecting options.