Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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;
42 QList<QInputMethodEvent::Attribute> m_preeditStyles;
43};
44
46 uint32_t hint = 0;
47 uint32_t purpose = 0;
48
49 static QWaylandInputMethodContentType convert(Qt::InputMethodHints hints);
50 static QWaylandInputMethodContentType convertV3(Qt::InputMethodHints hints);
51};
52
53
55
56#endif // QWAYLANDINPUTMETHODEVENTBUILDER_H
The QInputMethodEvent class provides parameters for input method events.
Definition qevent.h:625
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
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.
GLuint index
[2]
GLenum GLuint GLenum GLsizei length
static const uint base
Definition qurlidna.cpp:20
static QWaylandInputMethodContentType convert(Qt::InputMethodHints hints)
static QWaylandInputMethodContentType convertV3(Qt::InputMethodHints hints)