KWaylandServer::TextInputInterface

KWaylandServer::TextInputInterface Class Reference

#include <textinput_interface.h>

Inheritance diagram for KWaylandServer::TextInputInterface:

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< ContentHintContentHints
 
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 stateCommitted (uint32_t serial)
 
void surroundingTextChanged ()
 
- Signals inherited from KWaylandServer::Resource
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< SurfaceInterfacesurface () const
 
QByteArray surroundingText () const
 
qint32 surroundingTextCursorPosition () const
 
qint32 surroundingTextSelectionAnchor () const
 
- Public Member Functions inherited from KWaylandServer::Resource
ClientConnectionclient ()
 
void create (ClientConnection *client, quint32 version, quint32 id)
 
Globalglobal ()
 
quint32 id () const
 
wl_resource * parentResource () const
 
wl_resource * resource ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () 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< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, 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 QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () 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
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const 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)
 
QThreadthread () const const
 

Protected Member Functions

 TextInputInterface (Private *p, QObject *parent=nullptr)
 
- Protected Member Functions inherited from KWaylandServer::Resource
 Resource (Private *d, QObject *parent=nullptr)
 
- Protected Member Functions inherited from QObject
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
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
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 *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
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, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Attributes inherited from KWaylandServer::Resource
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.

See also
TextInputManagerInterface
SeatInterface
Since
5.23

Definition at line 89 of file textinput_interface.h.

Member Enumeration Documentation

ContentHint allows to modify the behavior of the text input.

Enumerator
None 

no special behaviour

AutoCompletion 

suggest word completions

AutoCorrection 

suggest word corrections

AutoCapitalization 

switch to uppercase letters at the start of a sentence

LowerCase 

prefer lowercase letters

UpperCase 

prefer uppercase letters

TitleCase 

prefer casing for titles and headings (can be language dependent)

HiddenText 

characters should be hidden

SensitiveData 

typed text should not be stored

Latin 

just latin characters should be entered

MultiLine 

the text input is multi line

Definition at line 98 of file textinput_interface.h.

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.

Enumerator
Normal 

default input, allowing all characters

Alpha 

allow only alphabetic characters

Digits 

allow only digits

Number 

input a number (including decimal separator and sign)

Phone 

input a phone number

Url 

input an URL

Email 

input an email address

Name 

input a name of a person

Password 

input a password

Date 

input a date

Time 

input a time

DateTime 

input a date and time

Terminal 

input for a terminal

Definition at line 152 of file textinput_interface.h.

Member Function Documentation

void KWaylandServer::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
textThe utf8-encoded text to be inserted into the editor widget
See also
preEdit
deleteSurroundingText

Definition at line 136 of file textinput_interface.cpp.

TextInputInterface::ContentHints KWaylandServer::TextInputInterface::contentHints ( ) const
See also
contentTypeChanged

Definition at line 100 of file textinput_interface.cpp.

TextInputInterface::ContentPurpose KWaylandServer::TextInputInterface::contentPurpose ( ) const
See also
contentTypeChanged

Definition at line 106 of file textinput_interface.cpp.

void KWaylandServer::TextInputInterface::contentTypeChanged ( )
signal

Emitted when the contentPurpose and/or contentHints changes.

See also
contentPurpose
contentHints
QRect KWaylandServer::TextInputInterface::cursorRectangle ( ) const
See also
cursorRectangleChanged

Definition at line 214 of file textinput_interface.cpp.

void KWaylandServer::TextInputInterface::cursorRectangleChanged ( const QRect rect)
signal
See also
cursorRectangle
void KWaylandServer::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
beforeLengthlength of text before current cursor position.
afterLengthlength of text after current cursor position.
See also
commit

Definition at line 155 of file textinput_interface.cpp.

void KWaylandServer::TextInputInterface::enabledChanged ( )
signal

Emitted whenever this TextInputInterface gets enabled or disabled for a SurfaceInterface.

See also
isEnabled
surface
TextInputInterfaceVersion KWaylandServer::TextInputInterface::interfaceVersion ( ) const
Returns
The interface version used by this TextInputInterface

Definition at line 202 of file textinput_interface.cpp.

bool KWaylandServer::TextInputInterface::isEnabled ( ) const
Returns
Whether the TextInputInterface is currently enabled for a SurfaceInterface.
See also
surface
enabledChanged

Definition at line 220 of file textinput_interface.cpp.

void KWaylandServer::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
textThe new utf8-encoded pre-edit text
commitTextUtf8-encoded text to replace preedit text on reset
See also
commit
preEditCursor

Definition at line 130 of file textinput_interface.cpp.

QByteArray KWaylandServer::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 94 of file textinput_interface.cpp.

void KWaylandServer::TextInputInterface::preferredLanguageChanged ( const QByteArray language)
signal

Emitted whenever the preferred language changes.

See also
preferredLanguage
void KWaylandServer::TextInputInterface::requestHideInputPanel ( )
signal

Requests input panels (virtual keyboard) to hide.

See also
requestShowInputPanel
void KWaylandServer::TextInputInterface::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.

void KWaylandServer::TextInputInterface::requestShowInputPanel ( )
signal

Requests input panels (virtual keyboard) to show.

See also
requestHideInputPanel
void KWaylandServer::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 161 of file textinput_interface.cpp.

void KWaylandServer::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
visibleWhether the input panel is currently visible
overlappedSurfaceAreaThe overlapping area in surface local coordinates

Definition at line 179 of file textinput_interface.cpp.

void KWaylandServer::TextInputInterface::setLanguage ( const QByteArray languageTag)

Sets the language of the input text.

The languageTag is a RFC-3066 format language tag.

Definition at line 191 of file textinput_interface.cpp.

void KWaylandServer::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
indexThe cursor position relative to the start of the composing text
See also
preEdit

Definition at line 173 of file textinput_interface.cpp.

void KWaylandServer::TextInputInterface::setTextDirection ( Qt::LayoutDirection  direction)

Sets the text direction of input text.

Definition at line 167 of file textinput_interface.cpp.

void KWaylandServer::TextInputInterface::stateCommitted ( uint32_t  serial)
signal

Emitted whenever TextInputInterface should commit the current state.

See also
requestReset
QPointer< SurfaceInterface > KWaylandServer::TextInputInterface::surface ( ) const
Returns
The surface the TextInputInterface is enabled on
See also
isEnabled
enabledChanged

Definition at line 208 of file textinput_interface.cpp.

QByteArray KWaylandServer::TextInputInterface::surroundingText ( ) const
Returns
The plain surrounding text around the input position.
See also
surroundingTextChanged
surroundingTextCursorPosition
surroundingTextSelectionAnchor

Definition at line 112 of file textinput_interface.cpp.

void KWaylandServer::TextInputInterface::surroundingTextChanged ( )
signal
qint32 KWaylandServer::TextInputInterface::surroundingTextCursorPosition ( ) const
Returns
The byte offset of current cursor position within the surroundingText
See also
surroundingText
surroundingTextChanged

Definition at line 118 of file textinput_interface.cpp.

qint32 KWaylandServer::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
See also
surroundingText
surroundingTextChanged

Definition at line 124 of file textinput_interface.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Sep 18 2020 23:06:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.