Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qibusplatforminputcontext.h
Go to the documentation of this file.
1// Copyright (C) 2016 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#ifndef QIBUSPLATFORMINPUTCONTEXT_H
4#define QIBUSPLATFORMINPUTCONTEXT_H
5
6#include <qpa/qplatforminputcontext.h>
7
8#include <QtCore/qpointer.h>
9#include <QtCore/QLocale>
10#include <QtDBus/qdbuspendingreply.h>
11#if QT_CONFIG(filesystemwatcher)
12#include <QFileSystemWatcher>
13#endif
14#include <QTimer>
15#include <QWindow>
16
18
20class QDBusVariant;
21
23{
24public:
26 QObject *parent = nullptr,
27 QWindow *window = nullptr,
28 const Qt::KeyboardModifiers modifiers = { },
31 , m_window(window)
32 , m_modifiers(modifiers)
33 , m_arguments(arguments)
34 {}
36 {}
37
38 inline QWindow *window() const { return m_window; }
39 inline const Qt::KeyboardModifiers modifiers() const { return m_modifiers; }
40 inline const QVariantList arguments() const { return m_arguments; }
41
42private:
43 QPointer<QWindow> m_window;
44 const Qt::KeyboardModifiers m_modifiers;
45 const QVariantList m_arguments;
46};
47
49{
51public:
54
55 bool isValid() const override;
56 void setFocusObject(QObject *object) override;
57
58 void invokeAction(QInputMethod::Action a, int x) override;
59 void reset() override;
60 void commit() override;
61 void update(Qt::InputMethodQueries) override;
62 bool filterEvent(const QEvent *event) override;
63 QLocale locale() const override;
64 bool hasCapability(Capability capability) const override;
65
66public Q_SLOTS:
67 void commitText(const QDBusVariant &text);
68 void updatePreeditText(const QDBusVariant &text, uint cursor_pos, bool visible);
69 void forwardKeyEvent(uint keyval, uint keycode, uint state);
70 void cursorRectChanged();
71 void deleteSurroundingText(int offset, uint n_chars);
73 void hidePreeditText();
74 void showPreeditText();
76 void socketChanged(const QString &str);
77 void busRegistered(const QString &str);
78 void busUnregistered(const QString &str);
79 void connectToBus();
80 void globalEngineChanged(const QString &engine_name);
81
82private:
84 bool m_eventFilterUseSynchronousMode;
85#if QT_CONFIG(filesystemwatcher)
86 QFileSystemWatcher m_socketWatcher;
87#endif
88 QTimer m_timer;
89
90 void connectToContextSignals();
91};
92
94
95#endif
\inmodule QtDBus
\inmodule QtDBus
\inmodule QtCore
Definition qcoreevent.h:45
QIBusFilterEventWatcher(const QDBusPendingCall &call, QObject *parent=nullptr, QWindow *window=nullptr, const Qt::KeyboardModifiers modifiers={ }, const QVariantList arguments=QVariantList())
const QVariantList arguments() const
const Qt::KeyboardModifiers modifiers() const
void invokeAction(QInputMethod::Action a, int x) override
Called when the word currently being composed in the input item is tapped by the user.
void commitText(const QDBusVariant &text)
void busUnregistered(const QString &str)
bool filterEvent(const QEvent *event) override
This function can be reimplemented to filter input events.
void globalEngineChanged(const QString &engine_name)
void filterEventFinished(QDBusPendingCallWatcher *call)
void update(Qt::InputMethodQueries) override
Notification on editor updates.
bool hasCapability(Capability capability) const override
Returns whether the implementation supports capability.
void socketChanged(const QString &str)
bool isValid() const override
Returns input context validity.
void forwardKeyEvent(uint keyval, uint keycode, uint state)
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
void updatePreeditText(const QDBusVariant &text, uint cursor_pos, bool visible)
void reset() override
Method to be called when input method needs to be reset.
void busRegistered(const QString &str)
void deleteSurroundingText(int offset, uint n_chars)
Action
Indicates the kind of action performed by the user.
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
The QPlatformInputContext class abstracts the input method dependent data and composing state.
\inmodule QtCore
Definition qpointer.h:18
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qtimer.h:20
\inmodule QtGui
Definition qwindow.h:63
EGLImageKHR int int EGLuint64KHR * modifiers
QString str
[2]
QString text
else opt state
[0]
Combined button and popup list for selecting options.
QList< QVariant > QVariantList
Definition qjsonarray.h:15
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr offset
struct _cl_event * event
#define Q_OBJECT
#define Q_SLOTS
unsigned int uint
Definition qtypes.h:29