Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandtextinputv2_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
5#ifndef QWAYLANDINPUTV2_P_H
6#define QWAYLANDINPUTV2_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20#include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h>
21#include <qwaylandinputmethodeventbuilder_p.h>
22
23struct wl_callback;
24struct wl_callback_listener;
25
26QT_BEGIN_NAMESPACE
27
28namespace QtWaylandClient {
29
30class QWaylandDisplay;
31
33{
34public:
35 QWaylandTextInputv2(QWaylandDisplay *display, struct ::zwp_text_input_v2 *text_input);
36 ~QWaylandTextInputv2() override;
37
38 void reset() override;
39 void commit() override;
40 void updateState(Qt::InputMethodQueries queries, uint32_t flags) override;
41
42 void setCursorInsidePreedit(int cursor) override;
43
44 bool isInputPanelVisible() const override;
45 QRectF keyboardRect() const override;
46
47 QLocale locale() const override;
48 Qt::LayoutDirection inputDirection() const override;
49
50 void showInputPanel() override;
51 void hideInputPanel() override;
52 void enableSurface(::wl_surface *surface) override;
53 void disableSurface(::wl_surface *surface) override;
54
55protected:
56 void zwp_text_input_v2_enter(uint32_t serial, struct ::wl_surface *surface) override;
57 void zwp_text_input_v2_leave(uint32_t serial, struct ::wl_surface *surface) override;
58 void zwp_text_input_v2_modifiers_map(wl_array *map) override;
59 void zwp_text_input_v2_input_panel_state(uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height) override;
60 void zwp_text_input_v2_preedit_string(const QString &text, const QString &commit) override;
61 void zwp_text_input_v2_preedit_styling(uint32_t index, uint32_t length, uint32_t style) override;
62 void zwp_text_input_v2_preedit_cursor(int32_t index) override;
63 void zwp_text_input_v2_commit_string(const QString &text) override;
64 void zwp_text_input_v2_cursor_position(int32_t index, int32_t anchor) override;
65 void zwp_text_input_v2_delete_surrounding_text(uint32_t before_length, uint32_t after_length) override;
66 void zwp_text_input_v2_keysym(uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) override;
67 void zwp_text_input_v2_language(const QString &language) override;
68 void zwp_text_input_v2_text_direction(uint32_t direction) override;
69 void zwp_text_input_v2_input_method_changed(uint32_t serial, uint32_t flags) override;
70
71private:
72 Qt::KeyboardModifiers modifiersToQtModifiers(uint32_t modifiers);
73
74 QWaylandDisplay *m_display = nullptr;
75 QWaylandInputMethodEventBuilder m_builder;
76
77 QList<Qt::KeyboardModifier> m_modifiersMap;
78
79 uint32_t m_serial = 0;
80 struct ::wl_surface *m_surface = nullptr;
81
82 QString m_preeditCommit;
83
84 bool m_inputPanelVisible = false;
85 QRectF m_keyboardRectangle;
86 QLocale m_locale;
87 Qt::LayoutDirection m_inputDirection = Qt::LayoutDirectionAuto;
88
89 struct ::wl_callback *m_resetCallback = nullptr;
90 static const wl_callback_listener callbackListener;
91 static void resetCallback(void *data, struct wl_callback *wl_callback, uint32_t time);
92};
93
94}
95
96QT_END_NAMESPACE
97
98#endif // QWAYLANDTEXTINPUTV2_P_H
virtual void enableSurface(::wl_surface *surface)=0
virtual bool isInputPanelVisible() const =0
virtual QRectF keyboardRect() const =0
virtual void setCursorInsidePreedit(int cursor)=0
virtual void disableSurface(::wl_surface *surface)=0
virtual Qt::LayoutDirection inputDirection() const =0
virtual void updateState(Qt::InputMethodQueries queries, uint32_t flags)=0
void zwp_text_input_v1_language(uint32_t serial, const QString &language) override
void zwp_text_input_v1_keysym(uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) override
void zwp_text_input_v1_enter(struct ::wl_surface *surface) override
void zwp_text_input_v1_input_panel_state(uint32_t state) override
Qt::LayoutDirection inputDirection() const override
void disableSurface(::wl_surface *surface) override
void zwp_text_input_v1_cursor_position(int32_t index, int32_t anchor) override
void zwp_text_input_v1_modifiers_map(wl_array *map) override
void zwp_text_input_v1_preedit_string(uint32_t serial, const QString &text, const QString &commit) override
void enableSurface(::wl_surface *surface) override
void zwp_text_input_v1_commit_string(uint32_t serial, const QString &text) override
void zwp_text_input_v1_delete_surrounding_text(int32_t before_length, uint32_t after_length) override
void updateState(Qt::InputMethodQueries queries, uint32_t flags) override
void zwp_text_input_v1_preedit_cursor(int32_t index) override
void zwp_text_input_v1_text_direction(uint32_t serial, uint32_t direction) override
void zwp_text_input_v1_preedit_styling(uint32_t index, uint32_t length, uint32_t style) override
void setCursorInsidePreedit(int cursor) override
void zwp_text_input_v2_keysym(uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) override
void zwp_text_input_v2_preedit_styling(uint32_t index, uint32_t length, uint32_t style) override
void updateState(Qt::InputMethodQueries queries, uint32_t flags) override
void enableSurface(::wl_surface *surface) override
void zwp_text_input_v2_delete_surrounding_text(uint32_t before_length, uint32_t after_length) override
void setCursorInsidePreedit(int cursor) override
void disableSurface(::wl_surface *surface) override
void zwp_text_input_v2_preedit_string(const QString &text, const QString &commit) override
void zwp_text_input_v2_input_method_changed(uint32_t serial, uint32_t flags) override
void zwp_text_input_v2_language(const QString &language) override
Qt::LayoutDirection inputDirection() const override
void zwp_text_input_v2_enter(uint32_t serial, struct ::wl_surface *surface) override
void zwp_text_input_v2_text_direction(uint32_t direction) override
void zwp_text_input_v2_modifiers_map(wl_array *map) override
void zwp_text_input_v2_commit_string(const QString &text) override
void zwp_text_input_v2_cursor_position(int32_t index, int32_t anchor) override
void zwp_text_input_v2_input_panel_state(uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height) override
void zwp_text_input_v2_preedit_cursor(int32_t index) override
void zwp_text_input_v2_leave(uint32_t serial, struct ::wl_surface *surface) override
Q_LOGGING_CATEGORY(lcQpaWayland, "qt.qpa.wayland")