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
74 void update(Qt::InputMethodQueries queries)
override;
75 void invokeAction(QInputMethod::Action action,
int cursorPosition)
override;
84 void setFocusObject(QObject *object)
override;
91 jboolean commitText(
const QString &text, jint newCursorPosition);
99 jboolean replaceText(jint start, jint end,
const QString text, jint newCursorPosition);
100 jboolean setComposingText(
const QString &text, jint newCursorPosition);
125 bool isImhNoEditMenuSet();
126 bool isImhNoTextHandlesSet();
127 void sendInputMethodEvent(QInputMethodEvent *event);
128 QSharedPointer<QInputMethodQueryEvent> focusObjectInputMethodQuery(Qt::InputMethodQueries queries = Qt::ImQueryAll);
129 bool focusObjectIsComposing()
const;
130 void focusObjectStartComposing();
131 bool focusObjectStopComposing();
134 ExtractedText m_extractedText;
135 QString m_composingText;
136 int m_composingTextStart;
137 int m_composingCursor;
138 QMetaObject::Connection m_updateCursorPosConnection;
139 HandleModes m_handleMode;
140 int m_batchEditNestingLevel;
141 QPointer<QObject> m_focusObject;
142 QTimer m_hideCursorHandleTimer;
143 bool m_fullScreenMode;
144 bool m_accessibilityFocusInProgress =
false;
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.
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 setAccessibilityFocusInProgress(bool inProgress)
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.