6#ifndef ANDROIDINPUTCONTEXT_H
7#define ANDROIDINPUTCONTEXT_H
9#include <qpa/qplatforminputcontext.h>
14#include <QtCore/qpointer.h>
24 CAP_MODE_CHARACTERS = 0x00001000,
25 CAP_MODE_SENTENCES = 0x00004000,
26 CAP_MODE_WORDS = 0x00002000
72 void update(Qt::InputMethodQueries queries)
override;
73 void invokeAction(QInputMethod::Action action,
int cursorPosition)
override;
89 jboolean commitText(
const QString &text, jint newCursorPosition);
97 jboolean replaceText(jint start, jint end,
const QString text, jint newCursorPosition);
98 jboolean setComposingText(
const QString &text, jint newCursorPosition);
123 bool isImhNoEditMenuSet();
124 bool isImhNoTextHandlesSet();
125 void sendInputMethodEvent(QInputMethodEvent *event);
126 QSharedPointer<QInputMethodQueryEvent> focusObjectInputMethodQuery(Qt::InputMethodQueries queries = Qt::ImQueryAll);
127 bool focusObjectIsComposing()
const;
128 void focusObjectStartComposing();
129 bool focusObjectStopComposing();
132 ExtractedText m_extractedText;
133 QString m_composingText;
134 int m_composingTextStart;
135 int m_composingCursor;
136 QMetaObject::Connection m_updateCursorPosConnection;
137 HandleModes m_handleMode;
138 int m_batchEditNestingLevel;
139 QPointer<QObject> m_focusObject;
140 QTimer m_hideCursorHandleTimer;
141 bool m_fullScreenMode;
jboolean beginBatchEdit()
jboolean setSelection(jint start, jint end)
void touchDown(int x, int y)
void longPress(int x, int y)
jboolean finishComposingText()
bool isValid() const override
Returns input context validity.
jint getCursorCapsMode(jint reqModes)
QString getSelectedText(jint flags)
bool isAnimating() const override
This function can be reimplemented to return true whenever input method is animating shown or hidden.
void hideSelectionHandles()
QString getTextAfterCursor(jint length, jint flags)
void reportFullscreenMode(jboolean enabled)
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 hideInputPanel() override
Request to hide input panel.
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
jboolean setComposingRegion(jint start, jint end)
static QAndroidInputContext * androidInputContext()
void updateSelectionHandles()
void update(Qt::InputMethodQueries queries) override
Notification on editor updates.
QString getTextBeforeCursor(jint length, jint flags)
void sendShortcut(const QKeySequence &)
void invokeAction(QInputMethod::Action action, int cursorPosition) override
Called when the word currently being composed in the input item is tapped by the user.
void updateCursorPosition()
jboolean deleteSurroundingText(jint leftLength, jint rightLength)
void handleLocationChanged(int handleId, int x, int y)
void showInputPanel() override
Request to show input panel.
const ExtractedText & getExtractedText(jint hintMaxChars, jint hintMaxLines, jint flags)
bool isInputPanelVisible() const override
Returns input panel visibility status.
jboolean fullscreenMode()
Combined button and popup list for selecting options.