22class QWasmInputContext :
public QPlatformInputContext
24 Q_DISABLE_COPY(QWasmInputContext)
27 explicit QWasmInputContext();
28 ~QWasmInputContext() override;
30 bool isValid()
const override {
return true; }
31 void update(Qt::InputMethodQueries) override;
32 void showInputPanel() override;
33 void hideInputPanel() override;
34 void setFocusObject(QObject *object) override;
36 const QString preeditString() {
return m_preeditString; }
37 void setPreeditString(QString preeditStr);
38 void insertPreedit(
int repalcementLength = 0);
39 void commitPreeditAndClear();
41 void commitText(
const QString &text,
int replaceFrom = 0,
int replaceLength = 0);
43 void focusOnFocusWindow(QWasmWindow::FocusTarget target);
45 void inputCallback(emscripten::val event);
46 void compositionEndCallback(emscripten::val event);
47 void compositionStartCallback(emscripten::val event);
48 void compositionUpdateCallback(emscripten::val event);
49 void beforeInputCallback(emscripten::val event);
51 bool isActive() {
return inputMethodAccepted(); }
52 bool m_ignoreNextInput =
false;
55 void updateInputElement();
57 struct CompositionRange
64 CompositionRange getFirstRange()
const;
69 int replaceLength = 0;
72 ResolvedRange resolveRange(
const CompositionRange &range)
const;
74 QString m_preeditString;
76 QObject *m_focusObject =
nullptr;
77 emscripten::val m_inputElement = emscripten::val::null();
78 emscripten::val m_compositionRange = emscripten::val::null();