4#ifndef QWAYLANDINPUTMETHODEVENTBUILDER_H
5#define QWAYLANDINPUTMETHODEVENTBUILDER_H
7#include <QInputMethodEvent>
8#include <private/qglobal_p.h>
12class QWaylandInputMethodEventBuilder
15 QWaylandInputMethodEventBuilder() =
default;
16 ~QWaylandInputMethodEventBuilder();
20 void setCursorPosition(int32_t index, int32_t anchor);
21 void setDeleteSurroundingText(uint32_t beforeLength, uint32_t afterLength);
23 void addPreeditStyling(uint32_t index, uint32_t length, uint32_t style);
24 void setPreeditCursor(int32_t index);
26 QInputMethodEvent *buildCommit(
const QString &text);
27 QInputMethodEvent *buildPreedit(
const QString &text);
29 static int indexFromWayland(
const QString &text,
int length,
int base = 0);
30 static int indexToWayland(
const QString &text,
int length,
int base = 0);
32 static int trimmedIndexFromWayland(
const QString &text,
int length,
int base = 0);
34 QPair<
int,
int> replacementForDeleteSurrounding();
38 uint32_t m_deleteBefore = 0;
39 uint32_t m_deleteAfter = 0;
41 int32_t m_preeditCursor = 0;
42 QList<QInputMethodEvent::Attribute> m_preeditStyles;
static QWaylandInputMethodContentType convert(Qt::InputMethodHints hints)
static QWaylandInputMethodContentType convertV3(Qt::InputMethodHints hints)