KWayland::Server::TextInputInterface
#include <textinput_interface.h>

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 } |
Signals | |
void | contentTypeChanged () |
void | cursorRectangleChanged (const QRect &rect) |
void | enabledChanged () |
void | preferredLanguageChanged (const QByteArray &language) |
void | requestHideInputPanel () |
void | requestReset () |
void | requestShowInputPanel () |
void | surroundingTextChanged () |
![]() | |
void | aboutToBeUnbound () |
void | unbound () |
Public Member Functions | |
void | commit (const QByteArray &text) |
ContentHints | contentHints () const |
ContentPurpose | contentPurpose () const |
QRect | cursorRectangle () const |
void | deleteSurroundingText (quint32 beforeLength, quint32 afterLength) |
TextInputInterfaceVersion | interfaceVersion () const |
bool | isEnabled () const |
void | keysymPressed (quint32 keysym, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
void | keysymReleased (quint32 keysym, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
void | preEdit (const QByteArray &text, const QByteArray &commitText) |
QByteArray | preferredLanguage () const |
void | setCursorPosition (qint32 index, qint32 anchor) |
void | setInputPanelState (bool visible, const QRect &overlappedSurfaceArea) |
void | setLanguage (const QByteArray &languageTag) |
void | setPreEditCursor (qint32 index) |
void | setTextDirection (Qt::LayoutDirection direction) |
QPointer< SurfaceInterface > | surface () const |
QByteArray | surroundingText () const |
qint32 | surroundingTextCursorPosition () const |
qint32 | surroundingTextSelectionAnchor () const |
![]() | |
ClientConnection * | client () |
void | create (ClientConnection *client, quint32 version, quint32 id) |
Global * | global () |
quint32 | id () const |
wl_resource * | parentResource () const |
wl_resource * | resource () |
![]() | |
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 | |
TextInputInterface (Private *p, QObject *parent=nullptr) | |
![]() | |
Resource (Private *d, 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) |
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 |
![]() | |
QScopedPointer< Private > | d |
Detailed Description
Represents a generic Resource for a text input object.
This class does not directly correspond to a Wayland resource, but is a generic contract for any interface which implements a text input, e.g. the unstable wl_text_input interface.
It does not expose the actual interface to cover up the fact that the interface is unstable and might change. If one needs to know the actual used protocol, use the method interfaceVersion.
A TextInputInterface gets created by the TextInputManagerInterface. The individual instances are not exposed directly. The SeatInterface provides access to the currently active TextInputInterface. This is evaluated automatically based on which SurfaceInterface has keyboard focus.
- Since
- 5.23
Definition at line 90 of file textinput_interface.h.
Member Enumeration Documentation
◆ ContentHint
|
strong |
ContentHint allows to modify the behavior of the text input.
Definition at line 99 of file textinput_interface.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 153 of file textinput_interface.h.
Member Function Documentation
◆ commit()
void KWayland::Server::TextInputInterface::commit | ( | const QByteArray & | text | ) |
Notify when text
should be inserted into the editor widget.
The text to commit could be either just a single character after a key press or the result of some composing (preEdit). It could be also an empty text when some text should be removed (see deleteSurroundingText) or when the input cursor should be moved (see cursorPosition).
Any previously set composing text should be removed.
- Parameters
-
text The utf8-encoded text to be inserted into the editor widget
- See also
- preEdit
- deleteSurroundingText
Definition at line 137 of file textinput_interface.cpp.
◆ contentHints()
TextInputInterface::ContentHints KWayland::Server::TextInputInterface::contentHints | ( | ) | const |
- See also
- contentTypeChanged
Definition at line 101 of file textinput_interface.cpp.
◆ contentPurpose()
TextInputInterface::ContentPurpose KWayland::Server::TextInputInterface::contentPurpose | ( | ) | const |
- See also
- contentTypeChanged
Definition at line 107 of file textinput_interface.cpp.
◆ contentTypeChanged
|
signal |
Emitted when the contentPurpose and/or contentHints changes.
- See also
- contentPurpose
- contentHints
◆ cursorRectangle()
QRect KWayland::Server::TextInputInterface::cursorRectangle | ( | ) | const |
- See also
- cursorRectangleChanged
Definition at line 215 of file textinput_interface.cpp.
◆ cursorRectangleChanged
|
signal |
- See also
- cursorRectangle
◆ deleteSurroundingText()
void KWayland::Server::TextInputInterface::deleteSurroundingText | ( | quint32 | beforeLength, |
quint32 | afterLength | ||
) |
Notify when the text around the current cursor position should be deleted.
The Client processes this event together with the commit string
- Parameters
-
beforeLength length of text before current cursor position. afterLength length of text after current cursor position.
- See also
- commit
Definition at line 156 of file textinput_interface.cpp.
◆ enabledChanged
|
signal |
Emitted whenever this TextInputInterface gets enabled or disabled for a SurfaceInterface.
◆ interfaceVersion()
TextInputInterfaceVersion KWayland::Server::TextInputInterface::interfaceVersion | ( | ) | const |
- Returns
- The interface version used by this TextInputInterface
Definition at line 203 of file textinput_interface.cpp.
◆ isEnabled()
bool KWayland::Server::TextInputInterface::isEnabled | ( | ) | const |
- Returns
- Whether the TextInputInterface is currently enabled for a SurfaceInterface.
- See also
- surface
- enabledChanged
Definition at line 221 of file textinput_interface.cpp.
◆ preEdit()
void KWayland::Server::TextInputInterface::preEdit | ( | const QByteArray & | text, |
const QByteArray & | commitText | ||
) |
Notify when a new composing text
(pre-edit) should be set around the current cursor position.
Any previously set composing text should be removed.
The commitText
can be used to replace the preedit text on reset (for example on unfocus).
- Parameters
-
text The new utf8-encoded pre-edit text commitText Utf8-encoded text to replace preedit text on reset
- See also
- commit
- preEditCursor
Definition at line 131 of file textinput_interface.cpp.
◆ preferredLanguage()
QByteArray KWayland::Server::TextInputInterface::preferredLanguage | ( | ) | const |
The preferred language as a RFC-3066 format language tag.
This can be used by the server to show a language specific virtual keyboard layout.
- See also
- preferredLanguageChanged
Definition at line 95 of file textinput_interface.cpp.
◆ preferredLanguageChanged
|
signal |
Emitted whenever the preferred language
changes.
- See also
- preferredLanguage
◆ requestHideInputPanel
|
signal |
Requests input panels (virtual keyboard) to hide.
- See also
- requestShowInputPanel
◆ requestReset
|
signal |
Invoked by the client when the input state should be reset, for example after the text was changed outside of the normal input method flow.
◆ requestShowInputPanel
|
signal |
Requests input panels (virtual keyboard) to show.
- See also
- requestHideInputPanel
◆ setCursorPosition()
void KWayland::Server::TextInputInterface::setCursorPosition | ( | qint32 | index, |
qint32 | anchor | ||
) |
Notify when the cursor index
or anchor
position should be modified.
The Client applies this together with the commit string.
Definition at line 162 of file textinput_interface.cpp.
◆ setInputPanelState()
void KWayland::Server::TextInputInterface::setInputPanelState | ( | bool | visible, |
const QRect & | overlappedSurfaceArea | ||
) |
Informs the client about changes in the visibility of the input panel (virtual keyboard).
The overlappedSurfaceArea
defines the area overlapped by the input panel (virtual keyboard) on the SurfaceInterface having the text focus in surface local coordinates.
- Parameters
-
visible Whether the input panel is currently visible overlappedSurfaceArea The overlapping area in surface local coordinates
Definition at line 180 of file textinput_interface.cpp.
◆ setLanguage()
void KWayland::Server::TextInputInterface::setLanguage | ( | const QByteArray & | languageTag | ) |
Sets the language of the input text.
The languageTag
is a RFC-3066 format language tag.
Definition at line 192 of file textinput_interface.cpp.
◆ setPreEditCursor()
void KWayland::Server::TextInputInterface::setPreEditCursor | ( | qint32 | index | ) |
Sets the cursor position inside the composing text (as byte offset) relative to the start of the composing text.
When index
is a negative number no cursor is shown.
The Client applies the index
together with preEdit.
- Parameters
-
index The cursor position relative to the start of the composing text
- See also
- preEdit
Definition at line 174 of file textinput_interface.cpp.
◆ setTextDirection()
void KWayland::Server::TextInputInterface::setTextDirection | ( | Qt::LayoutDirection | direction | ) |
Sets the text direction
of input text.
Definition at line 168 of file textinput_interface.cpp.
◆ surface()
QPointer< SurfaceInterface > KWayland::Server::TextInputInterface::surface | ( | ) | const |
- Returns
- The surface the TextInputInterface is enabled on
- See also
- isEnabled
- enabledChanged
Definition at line 209 of file textinput_interface.cpp.
◆ surroundingText()
QByteArray KWayland::Server::TextInputInterface::surroundingText | ( | ) | const |
- Returns
- The plain surrounding text around the input position.
Definition at line 113 of file textinput_interface.cpp.
◆ surroundingTextChanged
|
signal |
Emitted when the surroundingText, surroundingTextCursorPosition and/or surroundingTextSelectionAnchor changed.
◆ surroundingTextCursorPosition()
qint32 KWayland::Server::TextInputInterface::surroundingTextCursorPosition | ( | ) | const |
- Returns
- The byte offset of current cursor position within the surroundingText
Definition at line 119 of file textinput_interface.cpp.
◆ surroundingTextSelectionAnchor()
qint32 KWayland::Server::TextInputInterface::surroundingTextSelectionAnchor | ( | ) | const |
The byte offset of the selection anchor within the surroundingText.
If there is no selected text this is the same as cursor.
- Returns
- The byte offset of the selection anchor
Definition at line 125 of file textinput_interface.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 03:55:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.