| 1 | // Copyright (C) 2021 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QWAYLANDTEXTINPUTV3_H |
| 5 | #define QWAYLANDTEXTINPUTV3_H |
| 6 | |
| 7 | #include <QtWaylandCompositor/QWaylandCompositorExtension> |
| 8 | |
| 9 | struct wl_client; |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QWaylandTextInputV3Private; |
| 14 | |
| 15 | class QInputMethodEvent; |
| 16 | class QKeyEvent; |
| 17 | class QWaylandSurface; |
| 18 | |
| 19 | class QWaylandTextInputV3 : public QWaylandCompositorExtensionTemplate<QWaylandTextInputV3> |
| 20 | { |
| 21 | Q_OBJECT |
| 22 | Q_DECLARE_PRIVATE(QWaylandTextInputV3) |
| 23 | public: |
| 24 | explicit QWaylandTextInputV3(QWaylandObject *container, QWaylandCompositor *compositor); |
| 25 | ~QWaylandTextInputV3() 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 | Q_SIGNALS: |
| 42 | void updateInputMethod(Qt::InputMethodQueries queries); |
| 43 | void surfaceEnabled(QWaylandSurface *surface); |
| 44 | void surfaceDisabled(QWaylandSurface *surface); |
| 45 | |
| 46 | private: |
| 47 | void focusSurfaceDestroyed(void *); |
| 48 | }; |
| 49 | |
| 50 | QT_END_NAMESPACE |
| 51 | |
| 52 | #endif // QWAYLANDTEXTINPUTV3_H |
| 53 |
