1// Copyright (C) 2017 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 QWAYLANDINPUTMETHODCONTROL_H
5#define QWAYLANDINPUTMETHODCONTROL_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtCore/QObject>
9
10QT_BEGIN_NAMESPACE
11
12class QWaylandCompositor;
13class QWaylandInputMethodControlPrivate;
14class QWaylandSurface;
15class QInputMethodEvent;
16class QWaylandTextInput;
17
18class QWaylandInputMethodControl : public QObject
19{
20 Q_OBJECT
21 Q_DECLARE_PRIVATE(QWaylandInputMethodControl)
22 Q_DISABLE_COPY(QWaylandInputMethodControl)
23
24 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
25public:
26 explicit QWaylandInputMethodControl(QWaylandSurface *surface);
27
28 QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
29
30 void inputMethodEvent(QInputMethodEvent *event);
31
32 bool enabled() const;
33 void setEnabled(bool enabled);
34
35 void setSurface(QWaylandSurface *surface);
36 void updateTextInput();
37
38Q_SIGNALS:
39 void enabledChanged(bool enabled);
40 void updateInputMethod(Qt::InputMethodQueries queries);
41
42private:
43 void defaultSeatChanged();
44 void surfaceEnabled(QWaylandSurface *surface);
45 void surfaceDisabled(QWaylandSurface *surface);
46};
47
48QT_END_NAMESPACE
49
50#endif // QWAYLANDINPUTMETHODCONTROL_H
51

source code of qtwayland/src/compositor/compositor_api/qwaylandinputmethodcontrol.h