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
qwaylandqttextinputmethod_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QWAYLANDQTTEXTINPUTMETHOD_P_H
6#define QWAYLANDQTTEXTINPUTMETHOD_P_H
7
8
10
11#include <QtWaylandCompositor/private/qwaylandcompositorextension_p.h>
12#include <QtWaylandCompositor/private/qwayland-server-qt-text-input-method-unstable-v1.h>
13#include <QtWaylandCompositor/qwaylanddestroylistener.h>
14
15#include <QtCore/qrect.h>
16#include <QtCore/qhash.h>
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
31class QWaylandCompositor;
32class QWaylandSurface;
33
34class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQtTextInputMethodPrivate : public QWaylandCompositorExtensionPrivate, public QtWaylandServer::qt_text_input_method_v1
35{
36 Q_DECLARE_PUBLIC(QWaylandQtTextInputMethod)
37public:
38 explicit QWaylandQtTextInputMethodPrivate(QWaylandCompositor *compositor);
39
40 QWaylandCompositor *compositor;
41 QWaylandSurface *focusedSurface = nullptr;
42 Resource *resource = nullptr;
43 QHash<Resource * , QWaylandSurface *> enabledSurfaces;
44 QWaylandDestroyListener focusDestroyListener;
45 bool inputPanelVisible = false;
46 bool waitingForSync = false;
47
48 Qt::InputMethodQueries updatingQueries;
49 Qt::InputMethodHints hints;
50 QString surroundingText;
51 QString preferredLanguage;
52 QRect cursorRectangle;
53 int cursorPosition = 0;
54 int anchorPosition = 0;
55 int absolutePosition = 0;
56 int surroundingTextOffset = 0;
57
58private:
59 void text_input_method_v1_enable(Resource *resource, struct ::wl_resource *surface) override;
60 void text_input_method_v1_disable(Resource *resource, struct ::wl_resource *surface) override;
61 void text_input_method_v1_destroy(Resource *resource) override;
62 void text_input_method_v1_reset(Resource *resource) override;
63 void text_input_method_v1_commit(Resource *resource) override;
64 void text_input_method_v1_show_input_panel(Resource *resource) override;
65 void text_input_method_v1_hide_input_panel(Resource *resource) override;
66 void text_input_method_v1_update_hints(Resource *resource, int32_t hints) override;
67 void text_input_method_v1_update_surrounding_text(Resource *resource, const QString &surroundingText, int32_t surroundingTextOffset) override;
68 void text_input_method_v1_update_anchor_position(Resource *resource, int32_t anchorPosition) override;
69 void text_input_method_v1_update_cursor_position(Resource *resource, int32_t cursorPosition) override;
70 void text_input_method_v1_update_absolute_position(Resource *resource, int32_t absolutePosition) override;
71 void text_input_method_v1_invoke_action(Resource *resource, int32_t type, int32_t cursorPosition) override;
72 void text_input_method_v1_update_preferred_language(Resource *resource, const QString &preferredLanguage) override;
73 void text_input_method_v1_update_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override;
74 void text_input_method_v1_start_update(Resource *resource, int32_t queries) override;
75 void text_input_method_v1_end_update(Resource *resource) override;
76 void text_input_method_v1_acknowledge_input_method(Resource *resource) override;
77};
78
79QT_END_NAMESPACE
80
81#endif // QWAYLANDQTTEXTINPUTMETHOD_P_H
static const struct wl_interface * interface()
bool isSurfaceEnabled(QWaylandSurface *surface) const
void setFocus(QWaylandSurface *surface)
void add(::wl_client *client, uint32_t id, int version)
QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const
QWaylandSurface * focusedSurface() const
void sendInputMethodEvent(QInputMethodEvent *event)
Combined button and popup list for selecting options.