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

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

#include <textinput_v1.h>

Inheritance diagram for KWin::TextInputV1Interface:

Signals

void requestShowInputPanel ()
 
void requestHideInputPanel ()
 
void preferredLanguageChanged (const QString &language)
 
void cursorRectangleChanged (const QRect &rect)
 
void contentTypeChanged ()
 
void surroundingTextChanged ()
 
void enabledChanged ()
 
void stateUpdated (quint32 serial)
 
void reset ()
 
void invokeAction (quint32 button, quint32 index)
 

Public Member Functions

 TextInputV1Interface (SeatInterface *seat)
 
 ~TextInputV1Interface () 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 time, quint32 keysym, quint32 modifiers=0)
 
void keysymReleased (quint32 time, quint32 keysym, quint32 modifiers=0)
 
void setInputPanelState (bool visible)
 
void setLanguage (const QString &languageTag)
 
void setModifiersMap (const QByteArray &modifiersMap)
 

Friends

class TextInputManagerV1InterfacePrivate
 
class SeatInterface
 
class SeatInterfacePrivate
 
class TextInputV1InterfacePrivate
 

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

See also
TextInputManagerV1Interface
SeatInterface

Definition at line 62 of file textinput_v1.h.

Constructor & Destructor Documentation

◆ TextInputV1Interface()

KWin::TextInputV1Interface::TextInputV1Interface ( SeatInterface * seat)
explicit

Definition at line 408 of file textinput_v1.cpp.

◆ ~TextInputV1Interface()

KWin::TextInputV1Interface::~TextInputV1Interface ( )
override

Definition at line 414 of file textinput_v1.cpp.

Member Function Documentation

◆ clientSupportsTextInput()

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

Definition at line 545 of file textinput_v1.cpp.

◆ commitString()

void KWin::TextInputV1Interface::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 458 of file textinput_v1.cpp.

◆ contentHints()

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

Definition at line 423 of file textinput_v1.cpp.

◆ contentPurpose()

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

Definition at line 428 of file textinput_v1.cpp.

◆ contentTypeChanged

void KWin::TextInputV1Interface::contentTypeChanged ( )
signal

Emitted when the contentPurpose and/or contentHints changes.

See also
contentPurpose
contentHints

◆ cursorRectangle()

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

Definition at line 532 of file textinput_v1.cpp.

◆ cursorRectangleChanged

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

◆ deleteSurroundingText()

void KWin::TextInputV1Interface::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 473 of file textinput_v1.cpp.

◆ enabledChanged

void KWin::TextInputV1Interface::enabledChanged ( )
signal

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

See also
isEnabled
surface

◆ invokeAction

void KWin::TextInputV1Interface::invokeAction ( quint32 button,
quint32 index )
signal

Emitted whenever TextInputV1Interface request invoke action on preedit

◆ isEnabled()

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

Definition at line 537 of file textinput_v1.cpp.

◆ keysymPressed()

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

Definition at line 463 of file textinput_v1.cpp.

◆ keysymReleased()

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

Definition at line 468 of file textinput_v1.cpp.

◆ preEdit()

void KWin::TextInputV1Interface::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 448 of file textinput_v1.cpp.

◆ preEditStyling()

void KWin::TextInputV1Interface::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 453 of file textinput_v1.cpp.

◆ preferredLanguage()

QString KWin::TextInputV1Interface::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 418 of file textinput_v1.cpp.

◆ preferredLanguageChanged

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

Emitted whenever the preferred language changes.

See also
preferredLanguage

◆ requestHideInputPanel

void KWin::TextInputV1Interface::requestHideInputPanel ( )
signal

Requests input panels (virtual keyboard) to hide.

See also
requestShowInputPanel

◆ requestShowInputPanel

void KWin::TextInputV1Interface::requestShowInputPanel ( )
signal

Requests input panels (virtual keyboard) to show.

See also
requestHideInputPanel

◆ reset

void KWin::TextInputV1Interface::reset ( )
signal

Emitted whenever TextInputV1Interface gets reset.

◆ setCursorPosition()

void KWin::TextInputV1Interface::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 478 of file textinput_v1.cpp.

◆ setInputPanelState()

void KWin::TextInputV1Interface::setInputPanelState ( bool visible)

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 493 of file textinput_v1.cpp.

◆ setLanguage()

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

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

Definition at line 503 of file textinput_v1.cpp.

◆ setModifiersMap()

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

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

Definition at line 513 of file textinput_v1.cpp.

◆ setPreEditCursor()

void KWin::TextInputV1Interface::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 488 of file textinput_v1.cpp.

◆ setTextDirection()

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

Sets the text direction of input text.

Definition at line 483 of file textinput_v1.cpp.

◆ stateUpdated

void KWin::TextInputV1Interface::stateUpdated ( quint32 serial)
signal

Emitted whenever TextInputV1Interface should update the current state.

◆ surface()

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

Definition at line 523 of file textinput_v1.cpp.

◆ surroundingText()

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

Definition at line 433 of file textinput_v1.cpp.

◆ surroundingTextChanged

void KWin::TextInputV1Interface::surroundingTextChanged ( )
signal

◆ surroundingTextCursorPosition()

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

Definition at line 438 of file textinput_v1.cpp.

◆ surroundingTextSelectionAnchor()

qint32 KWin::TextInputV1Interface::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 443 of file textinput_v1.cpp.

Friends And Related Symbol Documentation

◆ SeatInterface

friend class SeatInterface
friend

Definition at line 286 of file textinput_v1.h.

◆ SeatInterfacePrivate

friend class SeatInterfacePrivate
friend

Definition at line 287 of file textinput_v1.h.

◆ TextInputManagerV1InterfacePrivate

Definition at line 285 of file textinput_v1.h.

◆ TextInputV1InterfacePrivate

friend class TextInputV1InterfacePrivate
friend

Definition at line 288 of file textinput_v1.h.


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