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
qwaylandtextinputv3_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:critical reason:network-protocol
4
5#ifndef QWAYLANDTEXTINPUTV3_P_H
6#define QWAYLANDTEXTINPUTV3_P_H
7
8#include <QtWaylandCompositor/private/qwaylandcompositorextension_p.h>
9#include <QtWaylandCompositor/private/qwayland-server-text-input-unstable-v3.h>
10#include <QtWaylandCompositor/QWaylandDestroyListener>
11
12#include <QtCore/QObject>
13#include <QtCore/QRect>
14#include <QtGui/QInputMethod>
15#include <QtWaylandCompositor/QWaylandSurface>
16
17#include <QtCore/qhash.h>
18
19//
20// W A R N I N G
21// -------------
22//
23// This file is not part of the Qt API. It exists purely as an
24// implementation detail. This header file may change from version to
25// version without notice, or even be removed.
26//
27// We mean it.
28//
29
31
32class QInputMethodEvent;
33class QKeyEvent;
34class QWaylandCompositor;
35class QWaylandView;
36
52
53class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandTextInputV3Private : public QWaylandCompositorExtensionPrivate, public QtWaylandServer::zwp_text_input_v3
54{
55 Q_DECLARE_PUBLIC(QWaylandTextInputV3)
56public:
57 explicit QWaylandTextInputV3Private(QWaylandCompositor *compositor);
58
59 void sendInputMethodEvent(QInputMethodEvent *event);
60 void sendKeyEvent(QKeyEvent *event);
61
62 QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const;
63
64 void setFocus(QWaylandSurface *surface);
65
66 QWaylandCompositor *compositor = nullptr;
67
68 QWaylandSurface *focus = nullptr;
69 Resource *focusResource = nullptr;
70 QWaylandDestroyListener focusDestroyListener;
71
72 bool inputPanelVisible = false;
73
74 QString currentPreeditString;
75
76 QScopedPointer<QWaylandTextInputV3ClientState> currentState;
77 QScopedPointer<QWaylandTextInputV3ClientState> pendingState;
78
79 QHash<Resource *, uint32_t> serials;
80 QHash<Resource *, QWaylandSurface *> enabledSurfaces;
81
82protected:
83 void zwp_text_input_v3_bind_resource(Resource *resource) override;
84 void zwp_text_input_v3_destroy_resource(Resource *resource) override;
85
86 void zwp_text_input_v3_destroy(Resource *resource) override;
87 void zwp_text_input_v3_enable(Resource *resource) override;
88 void zwp_text_input_v3_disable(Resource *resource) override;
89 void zwp_text_input_v3_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) override;
90 void zwp_text_input_v3_set_text_change_cause(Resource *resource, uint32_t cause) override;
91 void zwp_text_input_v3_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) override;
92 void zwp_text_input_v3_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override;
93 void zwp_text_input_v3_commit(Resource *resource) override;
94};
95
96QT_END_NAMESPACE
97
98#endif // QWAYLANDTEXTINPUTV3_P_H
Qt::InputMethodQueries mergeChanged(const QWaylandTextInputV3ClientState &other)
Qt::InputMethodQueries updatedQueries(const QWaylandTextInputV3ClientState &other) const
static const struct wl_interface * interface()
void surfaceEnabled(QWaylandSurface *surface)
QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const
void sendInputMethodEvent(QInputMethodEvent *event)
void surfaceDisabled(QWaylandSurface *surface)
static QByteArray interfaceName()
void setFocus(QWaylandSurface *surface)
void add(::wl_client *client, uint32_t id, int version)
QWaylandSurface * focus() const
void sendKeyEvent(QKeyEvent *event)
bool isSurfaceEnabled(QWaylandSurface *surface) const
Combined button and popup list for selecting options.