1// Copyright (C) 2017-2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDTEXTINPUT_H
5#define QWAYLANDTEXTINPUT_H
6
7#include <QtWaylandCompositor/QWaylandCompositorExtension>
8
9struct wl_client;
10
11QT_BEGIN_NAMESPACE
12
13class QWaylandTextInputPrivate;
14
15class QInputMethodEvent;
16class QKeyEvent;
17class QWaylandSurface;
18
19class QWaylandTextInput : public QWaylandCompositorExtensionTemplate<QWaylandTextInput>
20{
21 Q_OBJECT
22 Q_DECLARE_PRIVATE(QWaylandTextInput)
23public:
24 explicit QWaylandTextInput(QWaylandObject *container, QWaylandCompositor *compositor);
25 ~QWaylandTextInput() override;
26
27 void sendInputMethodEvent(QInputMethodEvent *event);
28 void sendKeyEvent(QKeyEvent *event);
29
30 QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const;
31
32 QWaylandSurface *focus() const;
33 void setFocus(QWaylandSurface *surface);
34
35 bool isSurfaceEnabled(QWaylandSurface *surface) const;
36
37 void add(::wl_client *client, uint32_t id, int version);
38 static const struct wl_interface *interface();
39 static QByteArray interfaceName();
40
41 void sendModifiersMap(const QByteArray &modifiersMap);
42
43Q_SIGNALS:
44 void updateInputMethod(Qt::InputMethodQueries queries);
45 void surfaceEnabled(QWaylandSurface *surface);
46 void surfaceDisabled(QWaylandSurface *surface);
47
48private:
49 void focusSurfaceDestroyed(void *);
50 void sendInputPanelState();
51 void sendTextDirection();
52 void sendLocale();
53};
54
55QT_END_NAMESPACE
56
57#endif // QWAYLANDTEXTINPUT_H
58

source code of qtwayland/src/compositor/extensions/qwaylandtextinput.h