KWin
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Friends | List of all members
KWin::TextInputV2Interface Class Reference

Represents a generic Resource for a text input object. More...

#include <textinput_v2.h>

Inheritance diagram for KWin::TextInputV2Interface:

Public Types

enum class  UpdateReason : uint32_t { StateChange = 0 , StateFull = 1 , StateReset = 2 , StateEnter = 3 }
 

Signals

void requestShowInputPanel ()
 
void requestHideInputPanel ()
 
void preferredLanguageChanged (const QString &language)
 
void cursorRectangleChanged (const QRect &rect)
 
void contentTypeChanged ()
 
void surroundingTextChanged ()
 
void enabledChanged ()
 
void stateUpdated (uint32_t serial, UpdateReason reason)
 

Public Member Functions

 ~TextInputV2Interface () override
 
QString preferredLanguage () const
 
QRect cursorRectangle () const
 
TextInputContentPurpose contentPurpose () const
 
TextInputContentHints contentHints () const
 
QString surroundingText () const
 
qint32 surroundingTextCursorPosition () const
 
qint32 surroundingTextSelectionAnchor () const
 
QPointer< SurfaceInterfacesurface () const
 
bool clientSupportsTextInput (ClientConnection *client) const
 
bool isEnabled () const
 
void preEdit (const QString &text, const QString &commitText)
 
void commitString (const QString &text)
 
void setPreEditCursor (qint32 index)
 
void preEditStyling (uint32_t index, uint32_t length, uint32_t style)
 
void deleteSurroundingText (quint32 beforeLength, quint32 afterLength)
 
void setCursorPosition (qint32 index, qint32 anchor)
 
void setTextDirection (Qt::LayoutDirection direction)
 
void keysymPressed (quint32 keysym, quint32 modifiers=0)
 
void keysymReleased (quint32 keysym, quint32 modifiers=0)
 
void setInputPanelState (bool visible, const QRect &overlappedSurfaceArea)
 
void setLanguage (const QString &languageTag)
 
void setModifiersMap (const QByteArray &modifiersMap)
 

Friends

class TextInputManagerV2InterfacePrivate
 
class SeatInterface
 
class SeatInterfacePrivate
 
class TextInputV2InterfacePrivate
 

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 TextInputV2Interface gets created by the TextInputManagerV2Interface. The individual instances are not exposed directly. The SeatInterface provides access to the currently active TextInputV2Interface. This is evaluated automatically based on which SurfaceInterface has keyboard focus.

See also
TextInputManagerV2Interface
SeatInterface

Definition at line 62 of file textinput_v2.h.

Member Enumeration Documentation

◆ UpdateReason

enum class KWin::TextInputV2Interface::UpdateReason : uint32_t
strong
Enumerator
StateChange 
StateFull 
StateReset 
StateEnter 

Definition at line 68 of file textinput_v2.h.

Constructor & Destructor Documentation

◆ ~TextInputV2Interface()

KWin::TextInputV2Interface::~TextInputV2Interface ( )
overridedefault

Member Function Documentation

◆ clientSupportsTextInput()

bool KWin::TextInputV2Interface::clientSupportsTextInput ( ClientConnection * client) const
Returns
whether client supports text-input-v2

Definition at line 555 of file textinput_v2.cpp.

◆ commitString()

void KWin::TextInputV2Interface::commitString ( const QString & 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 466 of file textinput_v2.cpp.

◆ contentHints()

TextInputContentHints KWin::TextInputV2Interface::contentHints ( ) const
See also
contentTypeChanged

Definition at line 431 of file textinput_v2.cpp.

◆ contentPurpose()

TextInputContentPurpose KWin::TextInputV2Interface::contentPurpose ( ) const
See also
contentTypeChanged

Definition at line 436 of file textinput_v2.cpp.

◆ contentTypeChanged

void KWin::TextInputV2Interface::contentTypeChanged ( )
signal

Emitted when the contentPurpose and/or contentHints changes.

See also
contentPurpose
contentHints

◆ cursorRectangle()

QRect KWin::TextInputV2Interface::cursorRectangle ( ) const
See also
cursorRectangleChanged

Definition at line 545 of file textinput_v2.cpp.

◆ cursorRectangleChanged

void KWin::TextInputV2Interface::cursorRectangleChanged ( const QRect & rect)
signal
See also
cursorRectangle

◆ deleteSurroundingText()

void KWin::TextInputV2Interface::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 481 of file textinput_v2.cpp.

◆ enabledChanged

void KWin::TextInputV2Interface::enabledChanged ( )
signal

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

See also
isEnabled
surface

◆ isEnabled()

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

Definition at line 550 of file textinput_v2.cpp.

◆ keysymPressed()

void KWin::TextInputV2Interface::keysymPressed ( quint32 keysym,
quint32 modifiers = 0 )

Definition at line 471 of file textinput_v2.cpp.

◆ keysymReleased()

void KWin::TextInputV2Interface::keysymReleased ( quint32 keysym,
quint32 modifiers = 0 )

Definition at line 476 of file textinput_v2.cpp.

◆ preEdit()

void KWin::TextInputV2Interface::preEdit ( const QString & text,
const QString & 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 456 of file textinput_v2.cpp.

◆ preEditStyling()

void KWin::TextInputV2Interface::preEditStyling ( uint32_t index,
uint32_t length,
uint32_t style )

Sets the style for a range of text for the composing text (as byte offset).

The Client applies the index together with preEdit.

Parameters
indexThe position relative to the start of the composing text
lengthThe length of the style to apply on
stylestyle flag
See also
preEdit

Definition at line 461 of file textinput_v2.cpp.

◆ preferredLanguage()

QString KWin::TextInputV2Interface::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 426 of file textinput_v2.cpp.

◆ preferredLanguageChanged

void KWin::TextInputV2Interface::preferredLanguageChanged ( const QString & language)
signal

Emitted whenever the preferred language changes.

See also
preferredLanguage

◆ requestHideInputPanel

void KWin::TextInputV2Interface::requestHideInputPanel ( )
signal

Requests input panels (virtual keyboard) to hide.

See also
requestShowInputPanel

◆ requestShowInputPanel

void KWin::TextInputV2Interface::requestShowInputPanel ( )
signal

Requests input panels (virtual keyboard) to show.

See also
requestHideInputPanel

◆ setCursorPosition()

void KWin::TextInputV2Interface::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 486 of file textinput_v2.cpp.

◆ setInputPanelState()

void KWin::TextInputV2Interface::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 501 of file textinput_v2.cpp.

◆ setLanguage()

void KWin::TextInputV2Interface::setLanguage ( const QString & languageTag)

Sets the language of the input text. The languageTag is a RFC-3066 format language tag.

Definition at line 512 of file textinput_v2.cpp.

◆ setModifiersMap()

void KWin::TextInputV2Interface::setModifiersMap ( const QByteArray & modifiersMap)

Sets the modifiers map to use when modifiers are included in a key event.

Definition at line 522 of file textinput_v2.cpp.

◆ setPreEditCursor()

void KWin::TextInputV2Interface::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 496 of file textinput_v2.cpp.

◆ setTextDirection()

void KWin::TextInputV2Interface::setTextDirection ( Qt::LayoutDirection direction)

Sets the text direction of input text.

Definition at line 491 of file textinput_v2.cpp.

◆ stateUpdated

void KWin::TextInputV2Interface::stateUpdated ( uint32_t serial,
UpdateReason reason )
signal

Emitted whenever TextInputInterface should update the current state.

◆ surface()

QPointer< SurfaceInterface > KWin::TextInputV2Interface::surface ( ) const
Returns
The surface the TextInputV2Interface is enabled on
See also
isEnabled
enabledChanged

Definition at line 532 of file textinput_v2.cpp.

◆ surroundingText()

QString KWin::TextInputV2Interface::surroundingText ( ) const
Returns
The plain surrounding text around the input position.
See also
surroundingTextChanged
surroundingTextCursorPosition
surroundingTextSelectionAnchor

Definition at line 441 of file textinput_v2.cpp.

◆ surroundingTextChanged

void KWin::TextInputV2Interface::surroundingTextChanged ( )
signal

◆ surroundingTextCursorPosition()

qint32 KWin::TextInputV2Interface::surroundingTextCursorPosition ( ) const
Returns
The byte offset of current cursor position within the surroundingText
See also
surroundingText
surroundingTextChanged

Definition at line 446 of file textinput_v2.cpp.

◆ surroundingTextSelectionAnchor()

qint32 KWin::TextInputV2Interface::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 451 of file textinput_v2.cpp.

Friends And Related Symbol Documentation

◆ SeatInterface

friend class SeatInterface
friend

Definition at line 284 of file textinput_v2.h.

◆ SeatInterfacePrivate

friend class SeatInterfacePrivate
friend

Definition at line 285 of file textinput_v2.h.

◆ TextInputManagerV2InterfacePrivate

Definition at line 283 of file textinput_v2.h.

◆ TextInputV2InterfacePrivate

friend class TextInputV2InterfacePrivate
friend

Definition at line 286 of file textinput_v2.h.


The documentation for this class was generated from the following files: