Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwaylandinputmethodeventbuilder_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWAYLANDINPUTMETHODEVENTBUILDER_H
5#define QWAYLANDINPUTMETHODEVENTBUILDER_H
6
7#include <QInputMethodEvent>
8#include <private/qglobal_p.h>
9
11
13{
14public:
17
18 void reset();
19
20 void setCursorPosition(int32_t index, int32_t anchor);
21 void setDeleteSurroundingText(uint32_t beforeLength, uint32_t afterLength);
22
23 void addPreeditStyling(uint32_t index, uint32_t length, uint32_t style);
24 void setPreeditCursor(int32_t index);
25
28
29 static int indexFromWayland(const QString &text, int length, int base = 0);
30 static int indexToWayland(const QString &text, int length, int base = 0);
31
32 static int trimmedIndexFromWayland(const QString &text, int length, int base = 0);
33private:
34 QPair<int, int> replacementForDeleteSurrounding();
35
36 int32_t m_anchor = 0;
37 int32_t m_cursor = 0;
38 uint32_t m_deleteBefore = 0;
39 uint32_t m_deleteAfter = 0;
40
41 int32_t m_preeditCursor = 0;
43};
44
46 uint32_t hint = 0;
47 uint32_t purpose = 0;
48
49 static QWaylandInputMethodContentType convert(Qt::InputMethodHints hints);
50 static QWaylandInputMethodContentType convertV4(Qt::InputMethodHints hints);
51};
52
53
55
56#endif // QWAYLANDINPUTMETHODEVENTBUILDER_H
The QInputMethodEvent class provides parameters for input method events.
Definition qevent.h:624
Definition qlist.h:74
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
static int indexFromWayland(const QString &text, int length, int base=0)
void addPreeditStyling(uint32_t index, uint32_t length, uint32_t style)
QInputMethodEvent * buildCommit(const QString &text)
QInputMethodEvent * buildPreedit(const QString &text)
void setDeleteSurroundingText(uint32_t beforeLength, uint32_t afterLength)
void setCursorPosition(int32_t index, int32_t anchor)
static int trimmedIndexFromWayland(const QString &text, int length, int base=0)
static int indexToWayland(const QString &text, int length, int base=0)
QString text
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
GLuint index
[2]
GLenum GLuint GLenum GLsizei length
static QWaylandInputMethodContentType convertV4(Qt::InputMethodHints hints)
static QWaylandInputMethodContentType convert(Qt::InputMethodHints hints)