| 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 | |
| 9 | struct wl_client; |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QWaylandTextInputPrivate; |
| 14 | |
| 15 | class QInputMethodEvent; |
| 16 | class QKeyEvent; |
| 17 | class QWaylandSurface; |
| 18 | |
| 19 | class QWaylandTextInput : public QWaylandCompositorExtensionTemplate<QWaylandTextInput> |
| 20 | { |
| 21 | Q_OBJECT |
| 22 | Q_DECLARE_PRIVATE(QWaylandTextInput) |
| 23 | public: |
| 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 | |
| 43 | Q_SIGNALS: |
| 44 | void updateInputMethod(Qt::InputMethodQueries queries); |
| 45 | void surfaceEnabled(QWaylandSurface *surface); |
| 46 | void surfaceDisabled(QWaylandSurface *surface); |
| 47 | |
| 48 | private: |
| 49 | void focusSurfaceDestroyed(void *); |
| 50 | void sendInputPanelState(); |
| 51 | void sendTextDirection(); |
| 52 | void sendLocale(); |
| 53 | }; |
| 54 | |
| 55 | QT_END_NAMESPACE |
| 56 | |
| 57 | #endif // QWAYLANDTEXTINPUT_H |
| 58 |
