Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylandtextinput_p.h
Go to the documentation of this file.
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 QWAYLANDTEXTINPUT_P_H
5#define QWAYLANDTEXTINPUT_P_H
6
7#include <QtWaylandCompositor/private/qwaylandcompositorextension_p.h>
8#include <QtWaylandCompositor/private/qwayland-server-text-input-unstable-v2.h>
9#include <QtWaylandCompositor/QWaylandDestroyListener>
10
11#include <QtCore/QObject>
12#include <QtCore/QMap>
13#include <QtCore/QHash>
14#include <QtCore/QRect>
15#include <QtGui/QInputMethod>
16#include <QtWaylandCompositor/QWaylandSurface>
17
18//
19// W A R N I N G
20// -------------
21//
22// This file is not part of the Qt API. It exists purely as an
23// implementation detail. This header file may change from version to
24// version without notice, or even be removed.
25//
26// We mean it.
27//
28
30
32class QKeyEvent;
34class QWaylandView;
35
37public:
39
40 Qt::InputMethodQueries updatedQueries(const QWaylandTextInputClientState &other) const;
41 Qt::InputMethodQueries mergeChanged(const QWaylandTextInputClientState &other);
42
43 Qt::InputMethodHints hints = Qt::ImhNone;
49
50 Qt::InputMethodQueries changedState;
51};
52
53class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandTextInputPrivate : public QWaylandCompositorExtensionPrivate, public QtWaylandServer::zwp_text_input_v2
54{
55 Q_DECLARE_PUBLIC(QWaylandTextInput)
56public:
58
59 void sendInputMethodEvent(QInputMethodEvent *event);
60 void sendKeyEvent(QKeyEvent *event);
61 void sendInputPanelState();
62 void sendTextDirection();
63 void sendLocale();
64 void sendModifiersMap(const QByteArray &modifiersMap);
65
67
68 void setFocus(QWaylandSurface *surface);
69
71
73 Resource *focusResource = nullptr;
75
76 bool inputPanelVisible = false;
77
78 std::unique_ptr<QWaylandTextInputClientState> currentState;
79 std::unique_ptr<QWaylandTextInputClientState> pendingState;
80
81 uint32_t serial = 0;
82
83 QHash<Resource *, QWaylandSurface*> enabledSurfaces;
84
85protected:
86 void zwp_text_input_v2_bind_resource(Resource *resource) override;
87 void zwp_text_input_v2_destroy_resource(Resource *resource) override;
88
89 void zwp_text_input_v2_destroy(Resource *resource) override;
90 void zwp_text_input_v2_enable(Resource *resource, wl_resource *surface) override;
91 void zwp_text_input_v2_disable(Resource *resource, wl_resource *surface) override;
92 void zwp_text_input_v2_show_input_panel(Resource *resource) override;
93 void zwp_text_input_v2_hide_input_panel(Resource *resource) override;
94 void zwp_text_input_v2_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) override;
95 void zwp_text_input_v2_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) override;
96 void zwp_text_input_v2_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override;
97 void zwp_text_input_v2_set_preferred_language(Resource *resource, const QString &language) override;
98 void zwp_text_input_v2_update_state(Resource *resource, uint32_t serial, uint32_t flags) override;
99
100private:
101 quint32 shiftModifierMask = 1;
102 quint32 controlModifierMask = 2;
103 quint32 altModifierMask = 4;
104 quint32 metaModifierMask = 8;
105};
106
108
109#endif // QWAYLANDTEXTINPUT_P_H
\inmodule QtCore
Definition qbytearray.h:57
The QInputMethodEvent class provides parameters for input method events.
Definition qevent.h:625
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
Qt::InputMethodQueries updatedQueries(const QWaylandTextInputClientState &other) const
Qt::InputMethodQueries changedState
Qt::InputMethodQueries mergeChanged(const QWaylandTextInputClientState &other)
QHash< Resource *, QWaylandSurface * > enabledSurfaces
QWaylandDestroyListener focusDestroyListener
std::unique_ptr< QWaylandTextInputClientState > pendingState
std::unique_ptr< QWaylandTextInputClientState > currentState
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
QString text
bool focus
[0]
QCursor cursor
Combined button and popup list for selecting options.
InputMethodQuery
@ ImhNone
static QOpenGLCompositor * compositor
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLint GLsizei width
GLbitfield flags
GLint y
struct _cl_event * event
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
unsigned int quint32
Definition qtypes.h:50
const char property[13]
Definition qwizard.cpp:101
QSharedPointer< T > other(t)
[5]
QDBusArgument argument