KWin
|
Represents a generic Resource for a text input object. More...
#include <textinput_v2.h>
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< SurfaceInterface > | surface () 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 |
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.
Definition at line 62 of file textinput_v2.h.
|
strong |
Enumerator | |
---|---|
StateChange | |
StateFull | |
StateReset | |
StateEnter |
Definition at line 68 of file textinput_v2.h.
|
overridedefault |
bool KWin::TextInputV2Interface::clientSupportsTextInput | ( | ClientConnection * | client | ) | const |
client
supports text-input-v2 Definition at line 555 of file textinput_v2.cpp.
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.
text | The utf8-encoded text to be inserted into the editor widget |
Definition at line 466 of file textinput_v2.cpp.
TextInputContentHints KWin::TextInputV2Interface::contentHints | ( | ) | const |
Definition at line 431 of file textinput_v2.cpp.
TextInputContentPurpose KWin::TextInputV2Interface::contentPurpose | ( | ) | const |
Definition at line 436 of file textinput_v2.cpp.
|
signal |
Emitted when the contentPurpose
and/or contentHints
changes.
QRect KWin::TextInputV2Interface::cursorRectangle | ( | ) | const |
Definition at line 545 of file textinput_v2.cpp.
|
signal |
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
beforeLength | length of text before current cursor position. |
afterLength | length of text after current cursor position. |
Definition at line 481 of file textinput_v2.cpp.
|
signal |
Emitted whenever this TextInputV2Interface gets enabled or disabled for a SurfaceInterface.
bool KWin::TextInputV2Interface::isEnabled | ( | ) | const |
Definition at line 550 of file textinput_v2.cpp.
void KWin::TextInputV2Interface::keysymPressed | ( | quint32 | keysym, |
quint32 | modifiers = 0 ) |
Definition at line 471 of file textinput_v2.cpp.
void KWin::TextInputV2Interface::keysymReleased | ( | quint32 | keysym, |
quint32 | modifiers = 0 ) |
Definition at line 476 of file textinput_v2.cpp.
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).
text | The new utf8-encoded pre-edit text |
commitText | Utf8-encoded text to replace preedit text on reset |
Definition at line 456 of file textinput_v2.cpp.
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
.
index | The position relative to the start of the composing text |
length | The length of the style to apply on |
style | style flag |
Definition at line 461 of file textinput_v2.cpp.
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.
Definition at line 426 of file textinput_v2.cpp.
|
signal |
Emitted whenever the preferred language
changes.
|
signal |
Requests input panels (virtual keyboard) to hide.
|
signal |
Requests input panels (virtual keyboard) to show.
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.
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.
visible | Whether the input panel is currently visible |
overlappedSurfaceArea | The overlapping area in surface local coordinates |
Definition at line 501 of file textinput_v2.cpp.
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.
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.
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
.
index | The cursor position relative to the start of the composing text |
Definition at line 496 of file textinput_v2.cpp.
void KWin::TextInputV2Interface::setTextDirection | ( | Qt::LayoutDirection | direction | ) |
Sets the text direction
of input text.
Definition at line 491 of file textinput_v2.cpp.
|
signal |
Emitted whenever TextInputInterface should update the current state.
QPointer< SurfaceInterface > KWin::TextInputV2Interface::surface | ( | ) | const |
Definition at line 532 of file textinput_v2.cpp.
QString KWin::TextInputV2Interface::surroundingText | ( | ) | const |
Definition at line 441 of file textinput_v2.cpp.
|
signal |
Emitted when the surroundingText
, surroundingTextCursorPosition
and/or surroundingTextSelectionAnchor
changed.
qint32 KWin::TextInputV2Interface::surroundingTextCursorPosition | ( | ) | const |
surroundingText
Definition at line 446 of file textinput_v2.cpp.
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.
Definition at line 451 of file textinput_v2.cpp.
|
friend |
Definition at line 284 of file textinput_v2.h.
|
friend |
Definition at line 285 of file textinput_v2.h.
|
friend |
Definition at line 283 of file textinput_v2.h.
|
friend |
Definition at line 286 of file textinput_v2.h.