6 #include "textinput_p.h" 13 TextInput::Private::Private(Seat *seat)
16 currentCommit.deleteSurrounding.afterLength = 0;
17 currentCommit.deleteSurrounding.beforeLength = 0;
18 pendingCommit.deleteSurrounding.afterLength = 0;
19 pendingCommit.deleteSurrounding.beforeLength = 0;
28 TextInput::~TextInput() =
default;
30 void TextInput::setEventQueue(EventQueue *queue)
35 EventQueue *TextInput::eventQueue()
const 40 bool TextInput::isValid()
const 45 Surface *TextInput::enteredSurface()
const 47 return d->enteredSurface;
50 bool TextInput::isInputPanelVisible()
const 52 return d->inputPanelVisible;
65 void TextInput::showInputPanel()
70 void TextInput::hideInputPanel()
75 void TextInput::reset()
80 void TextInput::setSurroundingText(
const QString &text, quint32 cursor, quint32 anchor)
82 d->setSurroundingText(text, cursor, anchor);
87 d->setContentType(hint, purpose);
90 void TextInput::setCursorRectangle(
const QRect &rect)
92 d->setCursorRectangle(rect);
95 void TextInput::setPreferredLanguage(
const QString &language)
97 d->setPreferredLanguage(language);
102 return d->textDirection;
110 qint32 TextInput::composingTextCursorPosition()
const 112 return d->currentPreEdit.cursor;
117 return d->currentPreEdit.text;
122 return d->currentPreEdit.commitText;
125 qint32 TextInput::anchorPosition()
const 127 return d->currentCommit.anchor;
130 qint32 TextInput::cursorPosition()
const 132 return d->currentCommit.cursor;
137 return d->currentCommit.deleteSurrounding;
142 return d->currentCommit.text;
145 TextInputManager::TextInputManager(Private *p,
QObject *
parent)
151 TextInputManager::~TextInputManager() =
default;
153 void TextInputManager::setup(wl_text_input_manager *textinputmanagerunstablev0)
155 d->setupV0(textinputmanagerunstablev0);
158 void TextInputManager::setup(zwp_text_input_manager_v2 *textinputmanagerunstablev2)
160 d->setupV2(textinputmanagerunstablev2);
163 void TextInputManager::release()
168 void TextInputManager::destroy()
183 TextInputManager::operator wl_text_input_manager*()
188 TextInputManager::operator wl_text_input_manager*()
const 193 TextInputManager::operator zwp_text_input_manager_v2*()
198 TextInputManager::operator zwp_text_input_manager_v2*()
const 203 bool TextInputManager::isValid()
const 210 return d->createTextInput(seat, parent);
ContentPurpose
The ContentPurpose allows to specify the primary purpose of a text input.
Holds the length before and after the cursor position to be deleted.
Wrapper class for wl_event_queue interface.
Wrapper for the wl_seat interface.
Wrapper for the wl_surface interface.
TextInput represents a Wayland interface for text input.
QObject * parent() const const