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
qandroidinputcontext.cpp File Reference

(dbd5af6231c9182ef370eca2e06c485591d715b9)

#include <android/log.h>
#include "androiddeadlockprotector.h"
#include "androidjniinput.h"
#include "androidjnimain.h"
#include "qandroideventdispatcher.h"
#include "qandroidinputcontext.h"
#include "qandroidplatformintegration.h"
#include "private/qhighdpiscaling_p.h"
#include <QTextBoundaryFinder>
#include <QTextCharFormat>
#include <QtCore/QJniEnvironment>
#include <QtCore/QJniObject>
#include <qevent.h>
#include <qguiapplication.h>
#include <qinputmethod.h>
#include <qsharedpointer.h>
#include <qthread.h>
#include <qwindow.h>
#include <qpa/qplatformwindow.h>
+ Include dependency graph for qandroidinputcontext.cpp:

Go to the source code of this file.

Classes

class  QT_BEGIN_NAMESPACE::BatchEditLock
 

Namespaces

namespace  QT_BEGIN_NAMESPACE
 Combined button and popup list for selecting options.
 

Functions

static void runOnQtThread (const std::function< void()> &func)
 
static jboolean beginBatchEdit (JNIEnv *, jobject)
 
static jboolean endBatchEdit (JNIEnv *, jobject)
 
static jboolean commitText (JNIEnv *env, jobject, jstring text, jint newCursorPosition)
 
static jboolean deleteSurroundingText (JNIEnv *, jobject, jint leftLength, jint rightLength)
 
static jboolean finishComposingText (JNIEnv *, jobject)
 
static jboolean replaceText (JNIEnv *env, jobject, jint start, jint end, jstring text, jint newCursorPosition)
 
static jint getCursorCapsMode (JNIEnv *, jobject, jint reqModes)
 
static jobject getExtractedText (JNIEnv *env, jobject, int hintMaxChars, int hintMaxLines, jint flags)
 
static jstring getSelectedText (JNIEnv *env, jobject, jint flags)
 
static jstring getTextAfterCursor (JNIEnv *env, jobject, jint length, jint flags)
 
static jstring getTextBeforeCursor (JNIEnv *env, jobject, jint length, jint flags)
 
static jboolean setComposingText (JNIEnv *env, jobject, jstring text, jint newCursorPosition)
 
static jboolean setComposingRegion (JNIEnv *, jobject, jint start, jint end)
 
static jboolean setSelection (JNIEnv *, jobject, jint start, jint end)
 
static jboolean selectAll (JNIEnv *, jobject)
 
static jboolean cut (JNIEnv *, jobject)
 
static jboolean copy (JNIEnv *, jobject)
 
static jboolean copyURL (JNIEnv *, jobject)
 
static jboolean paste (JNIEnv *, jobject)
 
static jboolean updateCursorPosition (JNIEnv *, jobject)
 
static void reportFullscreenMode (JNIEnv *, jobject, jboolean enabled)
 
static jboolean fullscreenMode (JNIEnv *, jobject)
 
static QRect screenInputItemRectangle ()
 
static int getAbsoluteCursorPosition (const QSharedPointer< QInputMethodQueryEvent > &query)
 
static int getBlockPosition (const QSharedPointer< QInputMethodQueryEvent > &query)
 

Variables

static QAndroidInputContextm_androidInputContext = nullptr
 
static char const *const QtNativeInputConnectionClassName = "org/qtproject/qt/android/QtNativeInputConnection"
 
static char const *const QtExtractedTextClassName = "org/qtproject/qt/android/QtExtractedText"
 
static int m_selectHandleWidth = 0
 
static jclass m_extractedTextClass = 0
 
static jmethodID m_classConstructorMethodID = 0
 
static jfieldID m_partialEndOffsetFieldID = 0
 
static jfieldID m_partialStartOffsetFieldID = 0
 
static jfieldID m_selectionEndFieldID = 0
 
static jfieldID m_selectionStartFieldID = 0
 
static jfieldID m_startOffsetFieldID = 0
 
static jfieldID m_textFieldID = 0
 
static JNINativeMethod methods []
 

Function Documentation

◆ beginBatchEdit()

static jboolean beginBatchEdit ( JNIEnv * ,
jobject  )
static

Definition at line 78 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ commitText()

static jboolean commitText ( JNIEnv * env,
jobject ,
jstring text,
jint newCursorPosition )
static

Definition at line 102 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ copy()

static jboolean copy ( JNIEnv * ,
jobject  )
static

Definition at line 288 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ copyURL()

static jboolean copyURL ( JNIEnv * ,
jobject  )
static

Definition at line 299 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ cut()

static jboolean cut ( JNIEnv * ,
jobject  )
static

Definition at line 277 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ deleteSurroundingText()

static jboolean deleteSurroundingText ( JNIEnv * ,
jobject ,
jint leftLength,
jint rightLength )
static

Definition at line 118 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ endBatchEdit()

static jboolean endBatchEdit ( JNIEnv * ,
jobject  )
static

Definition at line 89 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ finishComposingText()

static jboolean finishComposingText ( JNIEnv * ,
jobject  )
static

Definition at line 129 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ fullscreenMode()

static jboolean fullscreenMode ( JNIEnv * ,
jobject  )
static

Definition at line 340 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ getAbsoluteCursorPosition()

static int getAbsoluteCursorPosition ( const QSharedPointer< QInputMethodQueryEvent > & query)
inlinestatic

Definition at line 495 of file qandroidinputcontext.cpp.

◆ getBlockPosition()

static int getBlockPosition ( const QSharedPointer< QInputMethodQueryEvent > & query)
inlinestatic

Definition at line 502 of file qandroidinputcontext.cpp.

◆ getCursorCapsMode()

static jint getCursorCapsMode ( JNIEnv * ,
jobject ,
jint reqModes )
static

Definition at line 157 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ getExtractedText()

static jobject getExtractedText ( JNIEnv * env,
jobject ,
int hintMaxChars,
int hintMaxLines,
jint flags )
static

Definition at line 167 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ getSelectedText()

static jstring getSelectedText ( JNIEnv * env,
jobject ,
jint flags )
static

Definition at line 191 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ getTextAfterCursor()

static jstring getTextAfterCursor ( JNIEnv * env,
jobject ,
jint length,
jint flags )
static

Definition at line 204 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ getTextBeforeCursor()

static jstring getTextBeforeCursor ( JNIEnv * env,
jobject ,
jint length,
jint flags )
static

Definition at line 215 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ paste()

static jboolean paste ( JNIEnv * ,
jobject  )
static

Definition at line 310 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ replaceText()

static jboolean replaceText ( JNIEnv * env,
jobject ,
jint start,
jint end,
jstring text,
jint newCursorPosition )
static

Definition at line 140 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ reportFullscreenMode()

static void reportFullscreenMode ( JNIEnv * ,
jobject ,
jboolean enabled )
static

Definition at line 332 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ runOnQtThread()

static void runOnQtThread ( const std::function< void()> & func)
static

Definition at line 70 of file qandroidinputcontext.cpp.

References AndroidDeadlockProtector::acquire().

+ Here is the call graph for this function:

◆ screenInputItemRectangle()

static QRect screenInputItemRectangle ( )
static

Definition at line 370 of file qandroidinputcontext.cpp.

◆ selectAll()

static jboolean selectAll ( JNIEnv * ,
jobject  )
static

Definition at line 266 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ setComposingRegion()

static jboolean setComposingRegion ( JNIEnv * ,
jobject ,
jint start,
jint end )
static

Definition at line 242 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ setComposingText()

static jboolean setComposingText ( JNIEnv * env,
jobject ,
jstring text,
jint newCursorPosition )
static

Definition at line 226 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ setSelection()

static jboolean setSelection ( JNIEnv * ,
jobject ,
jint start,
jint end )
static

Definition at line 254 of file qandroidinputcontext.cpp.

References m_androidInputContext.

◆ updateCursorPosition()

static jboolean updateCursorPosition ( JNIEnv * ,
jobject  )
static

Definition at line 321 of file qandroidinputcontext.cpp.

References m_androidInputContext, and QAndroidInputContext::updateCursorPosition().

+ Here is the call graph for this function:

Variable Documentation

◆ m_androidInputContext

◆ m_classConstructorMethodID

static jmethodID m_classConstructorMethodID = 0
static

Definition at line 62 of file qandroidinputcontext.cpp.

Referenced by QAndroidInputContext::QAndroidInputContext().

◆ m_extractedTextClass

static jclass m_extractedTextClass = 0
static

◆ m_partialEndOffsetFieldID

static jfieldID m_partialEndOffsetFieldID = 0
static

◆ m_partialStartOffsetFieldID

static jfieldID m_partialStartOffsetFieldID = 0
static

◆ m_selectHandleWidth

static int m_selectHandleWidth = 0
static

◆ m_selectionEndFieldID

static jfieldID m_selectionEndFieldID = 0
static

◆ m_selectionStartFieldID

static jfieldID m_selectionStartFieldID = 0
static

◆ m_startOffsetFieldID

static jfieldID m_startOffsetFieldID = 0
static

◆ m_textFieldID

static jfieldID m_textFieldID = 0
static

◆ methods

static JNINativeMethod methods
static
Initial value:
= {
{"beginBatchEdit", "()Z", (void *)beginBatchEdit},
{"endBatchEdit", "()Z", (void *)endBatchEdit},
{"commitText", "(Ljava/lang/String;I)Z", (void *)commitText},
{"deleteSurroundingText", "(II)Z", (void *)deleteSurroundingText},
{"finishComposingText", "()Z", (void *)finishComposingText},
{"getCursorCapsMode", "(I)I", (void *)getCursorCapsMode},
{"getExtractedText", "(III)Lorg/qtproject/qt/android/QtExtractedText;", (void *)getExtractedText},
{"getSelectedText", "(I)Ljava/lang/String;", (void *)getSelectedText},
{"getTextAfterCursor", "(II)Ljava/lang/String;", (void *)getTextAfterCursor},
{"getTextBeforeCursor", "(II)Ljava/lang/String;", (void *)getTextBeforeCursor},
{"replaceText", "(IILjava/lang/String;I)Z", (void *)replaceText},
{"setComposingText", "(Ljava/lang/String;I)Z", (void *)setComposingText},
{"setComposingRegion", "(II)Z", (void *)setComposingRegion},
{"setSelection", "(II)Z", (void *)setSelection},
{"selectAll", "()Z", (void *)selectAll},
{"cut", "()Z", (void *)cut},
{"copy", "()Z", (void *)copy},
{"copyURL", "()Z", (void *)copyURL},
{"paste", "()Z", (void *)paste},
{"updateCursorPosition", "()Z", (void *)updateCursorPosition},
{"reportFullscreenMode", "(Z)V", (void *)reportFullscreenMode},
{"fullscreenMode", "()Z", (void *)fullscreenMode}
}
static jboolean cut(JNIEnv *, jobject)
static jint getCursorCapsMode(JNIEnv *, jobject, jint reqModes)
static jboolean fullscreenMode(JNIEnv *, jobject)
static jboolean finishComposingText(JNIEnv *, jobject)
static jobject getExtractedText(JNIEnv *env, jobject, int hintMaxChars, int hintMaxLines, jint flags)
static jboolean copy(JNIEnv *, jobject)
static jstring getTextBeforeCursor(JNIEnv *env, jobject, jint length, jint flags)
static jboolean copyURL(JNIEnv *, jobject)
static jboolean commitText(JNIEnv *env, jobject, jstring text, jint newCursorPosition)
static jboolean paste(JNIEnv *, jobject)
static jboolean replaceText(JNIEnv *env, jobject, jint start, jint end, jstring text, jint newCursorPosition)
static jboolean beginBatchEdit(JNIEnv *, jobject)
static jstring getSelectedText(JNIEnv *env, jobject, jint flags)
static jboolean setComposingRegion(JNIEnv *, jobject, jint start, jint end)
static jboolean deleteSurroundingText(JNIEnv *, jobject, jint leftLength, jint rightLength)
static jboolean setComposingText(JNIEnv *env, jobject, jstring text, jint newCursorPosition)
static jboolean updateCursorPosition(JNIEnv *, jobject)
static jstring getTextAfterCursor(JNIEnv *env, jobject, jint length, jint flags)
static void reportFullscreenMode(JNIEnv *, jobject, jboolean enabled)
static jboolean endBatchEdit(JNIEnv *, jobject)
static jboolean setSelection(JNIEnv *, jobject, jint start, jint end)
static jboolean selectAll(JNIEnv *, jobject)

Definition at line 345 of file qandroidinputcontext.cpp.

Referenced by QAndroidInputContext::QAndroidInputContext().

◆ QtExtractedTextClassName

static char const *const QtExtractedTextClassName = "org/qtproject/qt/android/QtExtractedText"
static

Definition at line 59 of file qandroidinputcontext.cpp.

Referenced by QAndroidInputContext::QAndroidInputContext().

◆ QtNativeInputConnectionClassName

static char const *const QtNativeInputConnectionClassName = "org/qtproject/qt/android/QtNativeInputConnection"
static

Definition at line 58 of file qandroidinputcontext.cpp.

Referenced by QAndroidInputContext::QAndroidInputContext().