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
qwaylandclient.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 QWAYLANDCLIENT_H
6#define QWAYLANDCLIENT_H
7
8#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
9#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
10
11#include <QtCore/QObject>
12
13#include <signal.h>
14
15struct wl_client;
16
17QT_BEGIN_NAMESPACE
18
19class QWaylandClientPrivate;
20class QWaylandCompositor;
21
22class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandClient : public QObject
23{
24 Q_OBJECT
25 Q_DECLARE_PRIVATE(QWaylandClient)
26
27 Q_PROPERTY(QWaylandCompositor *compositor READ compositor CONSTANT)
28 Q_PROPERTY(qint64 userId READ userId CONSTANT)
29 Q_PROPERTY(qint64 groupId READ groupId CONSTANT)
30 Q_PROPERTY(qint64 processId READ processId CONSTANT)
31 Q_MOC_INCLUDE("qwaylandcompositor.h")
32
33 QML_NAMED_ELEMENT(WaylandClient)
34 QML_ADDED_IN_VERSION(1, 0)
35 QML_UNCREATABLE("")
36public:
37 ~QWaylandClient() override;
38
39 enum TextInputProtocol {
40 NoProtocol = 0,
41 QtTextInputMethodV1 = 1,
42 TextInputV2 = 2,
43 TextInputV3 = 4,
44
45 TextInputV4 = TextInputV3, // TextInputV4 was an experimental API that is now deprecated
46
47 QtTextInputMethod = QtTextInputMethodV1,
48 TextInput = TextInputV2
49 };
50 Q_DECLARE_FLAGS(TextInputProtocols, TextInputProtocol)
51
52 TextInputProtocols textInputProtocols() const;
53 void setTextInputProtocols(TextInputProtocols p);
54
55 static QWaylandClient *fromWlClient(QWaylandCompositor *compositor, wl_client *wlClient);
56
57 QWaylandCompositor *compositor() const;
58
59 wl_client *client() const;
60
61 qint64 userId() const;
62 qint64 groupId() const;
63
64 qint64 processId() const;
65
66 Q_INVOKABLE void kill(int signal = SIGTERM);
67
68public Q_SLOTS:
69 void close();
70
71private:
72 explicit QWaylandClient(QWaylandCompositor *compositor, wl_client *client);
73};
74
75QT_END_NAMESPACE
76
77#endif // QWAYLANDCLIENT_H
\qmltype WaylandClient \nativetype QWaylandClient \inqmlmodule QtWayland.Compositor