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 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | class QWaylandCompositor; |
13 | class QWaylandInputMethodControlPrivate; |
14 | class QWaylandSurface; |
15 | class QInputMethodEvent; |
16 | class QWaylandTextInput; |
17 | |
18 | class 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) |
25 | public: |
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 | |
38 | Q_SIGNALS: |
39 | void enabledChanged(bool enabled); |
40 | void updateInputMethod(Qt::InputMethodQueries queries); |
41 | |
42 | private: |
43 | void defaultSeatChanged(); |
44 | void surfaceEnabled(QWaylandSurface *surface); |
45 | void surfaceDisabled(QWaylandSurface *surface); |
46 | }; |
47 | |
48 | QT_END_NAMESPACE |
49 | |
50 | #endif // QWAYLANDINPUTMETHODCONTROL_H |
51 |