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
qwaylandinputcontext_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 QWAYLANDINPUTCONTEXT_H
6#define QWAYLANDINPUTCONTEXT_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
19#include <qpa/qplatforminputcontext.h>
20
21#include <QPointer>
22
25#if QT_CONFIG(xkbcommon)
26#include <xkbcommon/xkbcommon-compose.h>
27#endif
28
29struct wl_callback;
30struct wl_callback_listener;
31
33
34namespace QtWaylandClient {
35
36class QWaylandDisplay;
37
39{
41public:
43 ~QWaylandInputContext() override;
44
45 bool isValid() const override;
46
47 void reset() override;
48 void commit() override;
49 void update(Qt::InputMethodQueries) override;
50
51 void invokeAction(QInputMethod::Action, int cursorPosition) override;
52
53 void showInputPanel() override;
54 void hideInputPanel() override;
55 bool isInputPanelVisible() const override;
56 QRectF keyboardRect() const override;
57
58 QLocale locale() const override;
59 Qt::LayoutDirection inputDirection() const override;
60
61 void setFocusObject(QObject *object) override;
62
63#if QT_CONFIG(xkbcommon)
64 bool filterEvent(const QEvent *event) override;
65
66 // This invokable is called from QXkbCommon::setXkbContext().
67 Q_INVOKABLE void setXkbContext(struct xkb_context *context) { m_XkbContext = context; }
68#endif
69
70private:
71 QWaylandTextInputInterface *textInput() const;
72
73 QWaylandDisplay *mDisplay = nullptr;
74 QPointer<QWindow> mCurrentWindow;
75
76#if QT_CONFIG(xkbcommon)
77 void ensureInitialized();
78
79 bool m_initialized = false;
80 QObject *m_focusObject = nullptr;
81 xkb_compose_table *m_composeTable = nullptr;
82 xkb_compose_state *m_composeState = nullptr;
83 struct xkb_context *m_XkbContext = nullptr;
84#endif
85};
86
87}
88
90
91#endif // QWAYLANDINPUTCONTEXT_H
\inmodule QtCore
Definition qcoreevent.h:45
Action
Indicates the kind of action performed by the user.
\inmodule QtCore
Definition qobject.h:103
The QPlatformInputContext class abstracts the input method dependent data and composing state.
virtual bool filterEvent(const QEvent *event)
This function can be reimplemented to filter input events.
\inmodule QtCore\reentrant
Definition qrect.h:484
void hideInputPanel() override
Request to hide input panel.
QRectF keyboardRect() const override
This function can be reimplemented to return virtual keyboard rectangle in currently active window co...
void reset() override
Method to be called when input method needs to be reset.
void showInputPanel() override
Request to show input panel.
Qt::LayoutDirection inputDirection() const override
void invokeAction(QInputMethod::Action, int cursorPosition) override
Called when the word currently being composed in the input item is tapped by the user.
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
bool isValid() const override
Returns input context validity.
bool isInputPanelVisible() const override
Returns input panel visibility status.
void update(Qt::InputMethodQueries) override
Notification on editor updates.
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
LayoutDirection
static void * context
static void ensureInitialized()
struct _cl_event * event
#define Q_OBJECT
#define Q_INVOKABLE