5#ifndef ANDROIDINPUTCONTEXT_H
6#define ANDROIDINPUTCONTEXT_H
8#include <qpa/qplatforminputcontext.h>
13#include <QtCore/qpointer.h>
23 CAP_MODE_CHARACTERS = 0x00001000,
24 CAP_MODE_SENTENCES = 0x00004000,
25 CAP_MODE_WORDS = 0x00002000
71 void update(Qt::InputMethodQueries queries)
override;
72 void invokeAction(QInputMethod::Action action,
int cursorPosition)
override;
88 jboolean commitText(
const QString &text, jint newCursorPosition);
96 jboolean replaceText(jint start, jint end,
const QString text, jint newCursorPosition);
97 jboolean setComposingText(
const QString &text, jint newCursorPosition);
122 bool isImhNoTextHandlesSet();
123 void sendInputMethodEvent(QInputMethodEvent *event);
124 QSharedPointer<QInputMethodQueryEvent> focusObjectInputMethodQuery(Qt::InputMethodQueries queries = Qt::ImQueryAll);
125 bool focusObjectIsComposing()
const;
126 void focusObjectStartComposing();
127 bool focusObjectStopComposing();
130 ExtractedText m_extractedText;
131 QString m_composingText;
132 int m_composingTextStart;
133 int m_composingCursor;
134 QMetaObject::Connection m_updateCursorPosConnection;
135 HandleModes m_handleMode;
136 int m_batchEditNestingLevel;
137 QPointer<QObject> m_focusObject;
138 QTimer m_hideCursorHandleTimer;
139 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()