KWayland::Client::TextInput
#include <textinput.h>

Classes | |
struct | DeleteSurroundingText |
Public Types | |
enum | ContentHint : uint32_t { ContentHint::None = 0, ContentHint::AutoCompletion = 1 << 0, ContentHint::AutoCorrection = 1 << 1, ContentHint::AutoCapitalization = 1 << 2, ContentHint::LowerCase = 1 << 3, ContentHint::UpperCase = 1 << 4, ContentHint::TitleCase = 1 << 5, ContentHint::HiddenText = 1 << 6, ContentHint::SensitiveData = 1 << 7, ContentHint::Latin = 1 << 8, ContentHint::MultiLine = 1 << 9 } |
typedef QFlags< ContentHint > | ContentHints |
enum | ContentPurpose : uint32_t { ContentPurpose::Normal, ContentPurpose::Alpha, ContentPurpose::Digits, ContentPurpose::Number, ContentPurpose::Phone, ContentPurpose::Url, ContentPurpose::Email, ContentPurpose::Name, ContentPurpose::Password, ContentPurpose::Date, ContentPurpose::Time, ContentPurpose::DateTime, ContentPurpose::Terminal } |
enum | KeyState { Pressed, Released } |
Signals | |
void | committed () |
void | composingTextChanged () |
void | entered () |
void | inputPanelStateChanged () |
void | keyEvent (quint32 xkbKeySym, KWayland::Client::TextInput::KeyState state, Qt::KeyboardModifiers modifiers, quint32 time) |
void | languageChanged () |
void | left () |
void | textDirectionChanged () |
Public Member Functions | |
qint32 | anchorPosition () const |
QByteArray | commitText () const |
QByteArray | composingFallbackText () const |
QByteArray | composingText () const |
qint32 | composingTextCursorPosition () const |
qint32 | cursorPosition () const |
DeleteSurroundingText | deleteSurroundingText () const |
void | disable (Surface *surface) |
void | enable (Surface *surface) |
Surface * | enteredSurface () const |
EventQueue * | eventQueue () const |
void | hideInputPanel () |
bool | isInputPanelVisible () const |
bool | isValid () const |
QByteArray | language () const |
void | reset () |
void | setContentType (ContentHints hints, ContentPurpose purpose) |
void | setCursorRectangle (const QRect &rect) |
void | setEventQueue (EventQueue *queue) |
void | setPreferredLanguage (const QString &language) |
void | setSurroundingText (const QString &text, quint32 cursor, quint32 anchor) |
void | showInputPanel () |
Qt::LayoutDirection | textDirection () const |
![]() | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () |
void | dumpObjectInfo () const const |
void | dumpObjectTree () |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Protected Member Functions | |
TextInput (Private *p, QObject *parent=nullptr) | |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
QScopedPointer< Private > | d |
Additional Inherited Members | |
![]() | |
objectName | |
![]() | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
typedef | QObjectList |
Detailed Description
TextInput represents a Wayland interface for text input.
The TextInput allows to have text composed by the Compositor and be sent to the client.
Depending on the interface the TextInputManager got created for this class encapsulates one of the following interfaces:
- wl_text_input
- zwp_text_input_v2
- Since
- 5.23
Definition at line 38 of file textinput.h.
Member Enumeration Documentation
◆ ContentHint
|
strong |
ContentHint allows to modify the behavior of the text input.
Definition at line 121 of file textinput.h.
◆ ContentPurpose
|
strong |
The ContentPurpose allows to specify the primary purpose of a text input.
This allows an input method to show special purpose input panels with extra characters or to disallow some characters.
Definition at line 175 of file textinput.h.
◆ KeyState
|
strong |
Member Function Documentation
◆ anchorPosition()
qint32 KWayland::Client::TextInput::anchorPosition | ( | ) | const |
The text between anchorPosition and cursorPosition should be selected.
- See also
- cursorPosition
- committed
Definition at line 124 of file textinput.cpp.
◆ committed
|
signal |
Emitted when the currently composing text got committed.
The commitText should get inserted at the cursorPosition and the text around deleteSurroundingText should be deleted.
◆ commitText()
QByteArray KWayland::Client::TextInput::commitText | ( | ) | const |
The commit text to be inserted.
The commit text might be empty if only text should be deleted or the cursor be moved.
Definition at line 139 of file textinput.cpp.
◆ composingFallbackText()
QByteArray KWayland::Client::TextInput::composingFallbackText | ( | ) | const |
The fallback text can be used to replace the composingText in some cases (for example when losing focus).
- See also
- composingText
- composingTextChanged
Definition at line 119 of file textinput.cpp.
◆ composingText()
QByteArray KWayland::Client::TextInput::composingText | ( | ) | const |
The currently being composed text around the composingTextCursorPosition.
Definition at line 114 of file textinput.cpp.
◆ composingTextChanged
|
signal |
Emitted whenever the composing text and related states changed.
◆ composingTextCursorPosition()
qint32 KWayland::Client::TextInput::composingTextCursorPosition | ( | ) | const |
The cursor position inside the composingText (as byte offset) relative to the start of the composingText.
If index is a negative number no cursor is shown.
- See also
- composingText
- composingTextChanged
Definition at line 109 of file textinput.cpp.
◆ cursorPosition()
qint32 KWayland::Client::TextInput::cursorPosition | ( | ) | const |
The cursor position in bytes at which the commitText should be inserted.
- See also
- committed
Definition at line 129 of file textinput.cpp.
◆ deleteSurroundingText()
TextInput::DeleteSurroundingText KWayland::Client::TextInput::deleteSurroundingText | ( | ) | const |
- Returns
- The length in bytes which should be deleted around the cursor position
- See also
- committed
Definition at line 134 of file textinput.cpp.
◆ disable()
void KWayland::Client::TextInput::disable | ( | Surface * | surface | ) |
Disable text input in a surface
(typically when there is no focus on any text entry inside the surface).
- See also
- enable
Definition at line 59 of file textinput.cpp.
◆ enable()
void KWayland::Client::TextInput::enable | ( | Surface * | surface | ) |
Enable text input in a surface
(usually when a text entry inside of it has focus).
This can be called before or after a surface gets text (or keyboard) focus via the enter event. Text input to a surface is only active when it has the current text (or keyboard) focus and is enabled.
- See also
- deactivate
Definition at line 54 of file textinput.cpp.
◆ entered
|
signal |
Emitted whenever a Surface is focused on this TextInput.
- See also
- enteredSurface
- left
◆ enteredSurface()
Surface * KWayland::Client::TextInput::enteredSurface | ( | ) | const |
◆ hideInputPanel()
void KWayland::Client::TextInput::hideInputPanel | ( | ) |
Requests input panels (virtual keyboard) to hide.
- See also
- showInputPanel
Definition at line 69 of file textinput.cpp.
◆ inputPanelStateChanged
|
signal |
Emitted whenever the state of the input panel (virtual keyboard changes).
- See also
- isInputPanelVisible
◆ isInputPanelVisible()
bool KWayland::Client::TextInput::isInputPanelVisible | ( | ) | const |
- Returns
- whether the input panel (virtual keyboard) is currently visible on the screen
- See also
- inputPanelStateChanged
Definition at line 49 of file textinput.cpp.
◆ isValid()
bool KWayland::Client::TextInput::isValid | ( | ) | const |
- Returns
true
if managing a resource.
Definition at line 39 of file textinput.cpp.
◆ keyEvent
|
signal |
Emitted when a key event was sent.
Key events are not used for normal text input operations, but for specific key symbols which are not composable through text.
- Parameters
-
xkbKeySym The XKB key symbol, not a key code state Whether the event represents a press or release event modifiers The hold modifiers on this event time Timestamp of this event
◆ language()
QByteArray KWayland::Client::TextInput::language | ( | ) | const |
The language of the input text.
As long as the server has not emitted the language, the code will be empty.
- Returns
- a RFC-3066 format language tag in utf-8.
- See also
- languageChanged
Definition at line 104 of file textinput.cpp.
◆ languageChanged
|
signal |
Emitted whenever the language changes.
- See also
- language
◆ left
|
signal |
Emitted whenever a Surface loses the focus on this TextInput.
- See also
- enteredSurface
- entered
◆ reset()
void KWayland::Client::TextInput::reset | ( | ) |
Should be called by an editor widget when the input state should be reset, for example after the text was changed outside of the normal input method flow.
Definition at line 74 of file textinput.cpp.
◆ setContentType()
void KWayland::Client::TextInput::setContentType | ( | ContentHints | hints, |
ContentPurpose | purpose | ||
) |
Sets the content purpose
and content hints
.
While the purpose
is the basic purpose of an input field, the hints
flags allow to modify some of the behavior.
Definition at line 84 of file textinput.cpp.
◆ setCursorRectangle()
void KWayland::Client::TextInput::setCursorRectangle | ( | const QRect & | rect | ) |
Sets the cursor outline rect
in surface local coordinates.
Allows the compositor to e.g. put a window with word suggestions near the cursor.
Definition at line 89 of file textinput.cpp.
◆ setPreferredLanguage()
void KWayland::Client::TextInput::setPreferredLanguage | ( | const QString & | language | ) |
Sets a specific language
.
This allows for example a virtual keyboard to show a language specific layout. The language
argument is a RFC-3066 format language tag.
Definition at line 94 of file textinput.cpp.
◆ setSurroundingText()
void KWayland::Client::TextInput::setSurroundingText | ( | const QString & | text, |
quint32 | cursor, | ||
quint32 | anchor | ||
) |
Sets the plain surrounding text around the input position.
- Parameters
-
text The text surrounding the cursor position cursor Index in the text describing the cursor position anchor Index of the selection anchor, if no selection same as cursor
Definition at line 79 of file textinput.cpp.
◆ showInputPanel()
void KWayland::Client::TextInput::showInputPanel | ( | ) |
Requests input panels (virtual keyboard) to show.
- See also
- hideInputPanel
Definition at line 64 of file textinput.cpp.
◆ textDirection()
Qt::LayoutDirection KWayland::Client::TextInput::textDirection | ( | ) | const |
The text direction of input text.
It is mainly needed for showing input cursor on correct side of the editor when there is no input yet done and making sure neutral direction text is laid out properly.
- See also
- textDirectionChnaged
Definition at line 99 of file textinput.cpp.
◆ textDirectionChanged
|
signal |
Emitted whenever the text direction changes.
- See also
- textDirection
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Feb 5 2023 03:56:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.