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
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// Qt-Security score:significant reason:default
4
5#ifndef QIBUSPLATFORMINPUTCONTEXT_H
6#define QIBUSPLATFORMINPUTCONTEXT_H
7
8#include <qpa/qplatforminputcontext.h>
9
10#include <QtCore/qpointer.h>
11#include <QtCore/QLocale>
12#include <QtCore/QLoggingCategory>
13#include <QtDBus/qdbuspendingreply.h>
14#if QT_CONFIG(filesystemwatcher)
15#include <QFileSystemWatcher>
16#endif
17#include <QTimer>
18#include <QWindow>
19
20#include "qibustypes.h"
21
22QT_BEGIN_NAMESPACE
23
24Q_DECLARE_LOGGING_CATEGORY(lcQpaInputMethods);
25
27class QDBusVariant;
28
30{
31public:
32 explicit QIBusFilterEventWatcher(const QDBusPendingCall &call,
33 QObject *parent = nullptr,
34 QWindow *window = nullptr,
35 const Qt::KeyboardModifiers modifiers = { },
36 const QVariantList arguments = QVariantList())
41 {}
44
45 inline QWindow *window() const { return m_window; }
46 inline const Qt::KeyboardModifiers modifiers() const { return m_modifiers; }
47 inline const QVariantList arguments() const { return m_arguments; }
48
49private:
50 QPointer<QWindow> m_window;
51 const Qt::KeyboardModifiers m_modifiers;
52 const QVariantList m_arguments;
53};
54
56{
58public:
61
62 bool isValid() const override;
63 void setFocusObject(QObject *object) override;
64
65 void invokeAction(QInputMethod::Action a, int x) override;
66 void reset() override;
67 void commit() override;
68 void update(Qt::InputMethodQueries) override;
69 bool filterEvent(const QEvent *event) override;
70 QLocale locale() const override;
71 bool hasCapability(Capability capability) const override;
72
73public Q_SLOTS:
74 void commitText(const QDBusVariant &text);
75 void updatePreeditText(const QDBusVariant &text, uint cursor_pos, bool visible);
76 void updatePreeditTextWithMode(const QDBusVariant &text, uint cursor_pos, bool visible, uint mode);
77 void forwardKeyEvent(uint keyval, uint keycode, uint state);
78 void cursorRectChanged();
79 void deleteSurroundingText(int offset, uint n_chars);
81 void hidePreeditText();
82 void showPreeditText();
83 void filterEventFinished(QDBusPendingCallWatcher *call);
84 void socketChanged(const QString &str);
85 void busRegistered(const QString &str);
86 void busUnregistered(const QString &str);
87 void connectToBus();
88 void globalEngineChanged(const QString &engine_name);
89
90private:
92 bool m_eventFilterUseSynchronousMode;
93#if QT_CONFIG(filesystemwatcher)
95#endif
96 QTimer m_timer;
97
98 void connectToContextSignals();
99};
100
101QT_END_NAMESPACE
102
103#endif
\inmodule QtDBus
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 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)