1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDQTTEXTINPUTMETHOD_H
5#define QWAYLANDQTTEXTINPUTMETHOD_H
6
7#include <QtWaylandCompositor/qwaylandcompositorextension.h>
8
9struct wl_client;
10
11QT_BEGIN_NAMESPACE
12
13class QWaylandSurface;
14class QWaylandQtTextInputMethodPrivate;
15class QInputMethodEvent;
16class QKeyEvent;
17
18class QWaylandQtTextInputMethod : public QWaylandCompositorExtensionTemplate<QWaylandQtTextInputMethod>
19{
20 Q_OBJECT
21 Q_DECLARE_PRIVATE(QWaylandQtTextInputMethod)
22public:
23 explicit QWaylandQtTextInputMethod(QWaylandObject *container, QWaylandCompositor *compositor);
24 ~QWaylandQtTextInputMethod() override;
25
26 QWaylandSurface *focusedSurface() const;
27 void setFocus(QWaylandSurface *surface);
28
29 bool isSurfaceEnabled(QWaylandSurface *surface) const;
30
31 void add(::wl_client *client, uint32_t id, int version);
32
33 static const struct wl_interface *interface();
34 static QByteArray interfaceName();
35
36 QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const;
37 void sendInputMethodEvent(QInputMethodEvent *event);
38 void sendKeyEvent(QKeyEvent *event);
39
40Q_SIGNALS:
41 void updateInputMethod(Qt::InputMethodQueries queries);
42 void surfaceEnabled(QWaylandSurface *surface);
43 void surfaceDisabled(QWaylandSurface *surface);
44
45private Q_SLOTS:
46 void sendVisibleChanged();
47 void sendKeyboardRectangleChanged();
48 void sendInputDirectionChanged();
49 void sendLocaleChanged();
50 void focusSurfaceDestroyed();
51};
52
53QT_END_NAMESPACE
54
55#endif // QWAYLANDQTTEXTINPUTMETHOD_H
56

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