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
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
17#include "qibustypes.h"
18
20
22class QDBusVariant;
23
25{
26public:
28 QObject *parent = nullptr,
29 QWindow *window = nullptr,
30 const Qt::KeyboardModifiers modifiers = { },
33 , m_window(window)
34 , m_modifiers(modifiers)
35 , m_arguments(arguments)
36 {}
39
40 inline QWindow *window() const { return m_window; }
41 inline const Qt::KeyboardModifiers modifiers() const { return m_modifiers; }
42 inline const QVariantList arguments() const { return m_arguments; }
43
44private:
45 QPointer<QWindow> m_window;
46 const Qt::KeyboardModifiers m_modifiers;
47 const QVariantList m_arguments;
48};
49
51{
53public:
56
57 bool isValid() const override;
58 void setFocusObject(QObject *object) override;
59
60 void invokeAction(QInputMethod::Action a, int x) override;
61 void reset() override;
62 void commit() override;
63 void update(Qt::InputMethodQueries) override;
64 bool filterEvent(const QEvent *event) override;
65 QLocale locale() const override;
66 bool hasCapability(Capability capability) const override;
67
68public Q_SLOTS:
69 void commitText(const QDBusVariant &text);
70 void updatePreeditText(const QDBusVariant &text, uint cursor_pos, bool visible);
71 void updatePreeditTextWithMode(const QDBusVariant &text, uint cursor_pos, bool visible, uint mode);
73 void cursorRectChanged();
74 void deleteSurroundingText(int offset, uint n_chars);
76 void hidePreeditText();
77 void showPreeditText();
79 void socketChanged(const QString &str);
80 void busRegistered(const QString &str);
81 void busUnregistered(const QString &str);
82 void connectToBus();
83 void globalEngineChanged(const QString &engine_name);
84
85private:
87 bool m_eventFilterUseSynchronousMode;
88#if QT_CONFIG(filesystemwatcher)
89 QFileSystemWatcher m_socketWatcher;
90#endif
91 QTimer m_timer;
92
93 void connectToContextSignals();
94};
95
97
98#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 updatePreeditTextWithMode(const QDBusVariant &text, uint cursor_pos, bool visible, uint mode)
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:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QPlatformInputContext class abstracts the input method dependent data and composing state.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\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]
GLenum mode
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:34
int keycode
Definition qvnc.cpp:140