KWin
|
Represents a generic Resource for a text input object. More...
#include <textinput_v1.h>
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< 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 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 |
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.
Definition at line 62 of file textinput_v1.h.
|
explicit |
Definition at line 408 of file textinput_v1.cpp.
|
override |
Definition at line 414 of file textinput_v1.cpp.
bool KWin::TextInputV1Interface::clientSupportsTextInput | ( | ClientConnection * | client | ) | const |
client
supports text-input-v1 Definition at line 545 of file textinput_v1.cpp.
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.
text | The utf8-encoded text to be inserted into the editor widget |
Definition at line 458 of file textinput_v1.cpp.
TextInputContentHints KWin::TextInputV1Interface::contentHints | ( | ) | const |
Definition at line 423 of file textinput_v1.cpp.
TextInputContentPurpose KWin::TextInputV1Interface::contentPurpose | ( | ) | const |
Definition at line 428 of file textinput_v1.cpp.
|
signal |
Emitted when the contentPurpose
and/or contentHints
changes.
QRect KWin::TextInputV1Interface::cursorRectangle | ( | ) | const |
Definition at line 532 of file textinput_v1.cpp.
|
signal |
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
beforeLength | length of text before current cursor position. |
afterLength | length of text after current cursor position. |
Definition at line 473 of file textinput_v1.cpp.
|
signal |
Emitted whenever this TextInputV1Interface gets enabled or disabled for a SurfaceInterface.
|
signal |
Emitted whenever TextInputV1Interface request invoke action on preedit
bool KWin::TextInputV1Interface::isEnabled | ( | ) | const |
Definition at line 537 of file textinput_v1.cpp.
void KWin::TextInputV1Interface::keysymPressed | ( | quint32 | time, |
quint32 | keysym, | ||
quint32 | modifiers = 0 ) |
Definition at line 463 of file textinput_v1.cpp.
void KWin::TextInputV1Interface::keysymReleased | ( | quint32 | time, |
quint32 | keysym, | ||
quint32 | modifiers = 0 ) |
Definition at line 468 of file textinput_v1.cpp.
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).
text | The new utf8-encoded pre-edit text |
commitText | Utf8-encoded text to replace preedit text on reset |
Definition at line 448 of file textinput_v1.cpp.
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
.
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 453 of file textinput_v1.cpp.
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.
Definition at line 418 of file textinput_v1.cpp.
|
signal |
Emitted whenever the preferred language
changes.
|
signal |
Requests input panels (virtual keyboard) to hide.
|
signal |
Requests input panels (virtual keyboard) to show.
|
signal |
Emitted whenever TextInputV1Interface gets reset.
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.
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.
visible | Whether the input panel is currently visible |
overlappedSurfaceArea | The overlapping area in surface local coordinates |
Definition at line 493 of file textinput_v1.cpp.
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.
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.
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
.
index | The cursor position relative to the start of the composing text |
Definition at line 488 of file textinput_v1.cpp.
void KWin::TextInputV1Interface::setTextDirection | ( | Qt::LayoutDirection | direction | ) |
Sets the text direction
of input text.
Definition at line 483 of file textinput_v1.cpp.
|
signal |
Emitted whenever TextInputV1Interface should update the current state.
QPointer< SurfaceInterface > KWin::TextInputV1Interface::surface | ( | ) | const |
Definition at line 523 of file textinput_v1.cpp.
QString KWin::TextInputV1Interface::surroundingText | ( | ) | const |
Definition at line 433 of file textinput_v1.cpp.
|
signal |
Emitted when the surroundingText
, surroundingTextCursorPosition
and/or surroundingTextSelectionAnchor
changed.
qint32 KWin::TextInputV1Interface::surroundingTextCursorPosition | ( | ) | const |
surroundingText
Definition at line 438 of file textinput_v1.cpp.
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.
Definition at line 443 of file textinput_v1.cpp.
|
friend |
Definition at line 286 of file textinput_v1.h.
|
friend |
Definition at line 287 of file textinput_v1.h.
|
friend |
Definition at line 285 of file textinput_v1.h.
|
friend |
Definition at line 288 of file textinput_v1.h.