#include <text_input_plugin.h>
Definition at line 28 of file text_input_plugin.h.
◆ TextInputPlugin()
Definition at line 106 of file text_input_plugin.cc.
113 active_model_(
nullptr) {
114 channel_->SetMethodCallHandler(
118 HandleMethodCall(call, std::move(result));
◆ ~TextInputPlugin()
flutter::TextInputPlugin::~TextInputPlugin |
( |
| ) |
|
|
virtualdefault |
◆ ComposeBeginHook()
void flutter::TextInputPlugin::ComposeBeginHook |
( |
| ) |
|
|
virtual |
Definition at line 124 of file text_input_plugin.cc.
125 if (active_model_ ==
nullptr) {
128 active_model_->BeginComposing();
129 if (enable_delta_model) {
130 std::string
text = active_model_->GetText();
131 TextRange selection = active_model_->selection();
132 TextEditingDelta delta = TextEditingDelta(
text);
133 SendStateUpdateWithDelta(*active_model_, &delta);
135 SendStateUpdate(*active_model_);
References text.
Referenced by flutter::testing::TEST().
◆ ComposeChangeHook()
void flutter::TextInputPlugin::ComposeChangeHook |
( |
const std::u16string & |
text, |
|
|
int |
cursor_pos |
|
) |
| |
|
virtual |
Definition at line 191 of file text_input_plugin.cc.
193 if (active_model_ ==
nullptr) {
196 std::string text_before_change = active_model_->GetText();
197 TextRange composing_before_change = active_model_->composing_range();
198 active_model_->AddText(
text);
199 cursor_pos += active_model_->composing_range().start();
200 active_model_->UpdateComposingText(
text);
201 active_model_->SetSelection(TextRange(cursor_pos, cursor_pos));
202 std::string text_after_change = active_model_->GetText();
203 if (enable_delta_model) {
204 TextEditingDelta delta = TextEditingDelta(
205 fml::Utf8ToUtf16(text_before_change), composing_before_change,
text);
206 SendStateUpdateWithDelta(*active_model_, &delta);
208 SendStateUpdate(*active_model_);
References text.
Referenced by flutter::testing::TEST().
◆ ComposeCommitHook()
void flutter::TextInputPlugin::ComposeCommitHook |
( |
| ) |
|
|
virtual |
Definition at line 139 of file text_input_plugin.cc.
140 if (active_model_ ==
nullptr) {
143 std::string text_before_change = active_model_->GetText();
144 TextRange selection_before_change = active_model_->selection();
145 TextRange composing_before_change = active_model_->composing_range();
146 std::string composing_text_before_change = text_before_change.substr(
147 composing_before_change.start(), composing_before_change.length());
148 active_model_->CommitComposing();
References flutter::TextRange::length(), and flutter::TextRange::start().
Referenced by flutter::testing::TEST().
◆ ComposeEndHook()
void flutter::TextInputPlugin::ComposeEndHook |
( |
| ) |
|
|
virtual |
Definition at line 174 of file text_input_plugin.cc.
175 if (active_model_ ==
nullptr) {
178 std::string text_before_change = active_model_->GetText();
179 TextRange selection_before_change = active_model_->selection();
180 active_model_->CommitComposing();
181 active_model_->EndComposing();
182 if (enable_delta_model) {
183 std::string
text = active_model_->GetText();
184 TextEditingDelta delta = TextEditingDelta(
text);
185 SendStateUpdateWithDelta(*active_model_, &delta);
187 SendStateUpdate(*active_model_);
References text.
Referenced by flutter::testing::TEST().
◆ KeyboardHook()
void flutter::TextInputPlugin::KeyboardHook |
( |
int |
key, |
|
|
int |
scancode, |
|
|
int |
action, |
|
|
char32_t |
character, |
|
|
bool |
extended, |
|
|
bool |
was_down |
|
) |
| |
|
virtual |
◆ TextHook()
void flutter::TextInputPlugin::TextHook |
( |
const std::u16string & |
text | ) |
|
|
virtual |
Definition at line 66 of file text_input_plugin.cc.
67 if (active_model_ ==
nullptr) {
70 std::u16string text_before_change =
71 fml::Utf8ToUtf16(active_model_->GetText());
72 TextRange selection_before_change = active_model_->selection();
73 active_model_->AddText(
text);
75 if (enable_delta_model) {
76 TextEditingDelta delta =
77 TextEditingDelta(text_before_change, selection_before_change,
text);
78 SendStateUpdateWithDelta(*active_model_, &delta);
80 SendStateUpdate(*active_model_);
References text.
The documentation for this class was generated from the following files: