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
qcomposeplatforminputcontext.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QCOMPOSEPLATFORMINPUTCONTEXT_H
6#define QCOMPOSEPLATFORMINPUTCONTEXT_H
7
8#include <QtCore/QLoggingCategory>
9
10#include <qpa/qplatforminputcontext.h>
11
12#include <xkbcommon/xkbcommon-compose.h>
13
14Q_DECLARE_OPAQUE_POINTER(xkb_context *)
15QT_BEGIN_NAMESPACE
16
17Q_DECLARE_LOGGING_CATEGORY(lcXkbCompose)
18
19class QEvent;
20
22{
24public:
27
28 bool isValid() const override;
29 void setFocusObject(QObject *object) override;
30 void reset() override;
31 void update(Qt::InputMethodQueries) override;
32
33 bool filterEvent(const QEvent *event) override;
34
35 // This invokable is called from QXkbCommon::setXkbContext().
36 Q_INVOKABLE void setXkbContext(struct xkb_context *context) { m_XkbContext = context; }
37
38protected:
39 void ensureInitialized();
40
41private:
42 bool m_initialized = false;
43 xkb_compose_table *m_composeTable = nullptr;
44 xkb_compose_state *m_composeState = nullptr;
45 QObject *m_focusObject = nullptr;
46 struct xkb_context *m_XkbContext = nullptr;
47};
48
49QT_END_NAMESPACE
50
51#endif // QCOMPOSEPLATFORMINPUTCONTEXT_H
void reset() override
Method to be called when input method needs to be reset.
bool filterEvent(const QEvent *event) override
This function can be reimplemented to filter input events.
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
Q_INVOKABLE void setXkbContext(struct xkb_context *context)
bool isValid() const override
Returns input context validity.
void update(Qt::InputMethodQueries) override
Notification on editor updates.
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")