#include <text_input_plugin.h>
Definition at line 28 of file text_input_plugin.h.
◆ TextInputPlugin()
Definition at line 107 of file text_input_plugin.cc.
114 active_model_(
nullptr) {
115 channel_->SetMethodCallHandler(
119 HandleMethodCall(call, std::move(result));
◆ ~TextInputPlugin()
flutter::TextInputPlugin::~TextInputPlugin |
( |
| ) |
|
|
virtualdefault |
◆ ComposeBeginHook()
void flutter::TextInputPlugin::ComposeBeginHook |
( |
| ) |
|
|
virtual |
Definition at line 125 of file text_input_plugin.cc.
126 if (active_model_ ==
nullptr) {
129 active_model_->BeginComposing();
130 if (enable_delta_model) {
131 std::string
text = active_model_->GetText();
132 TextRange selection = active_model_->selection();
133 TextEditingDelta delta = TextEditingDelta(
text);
134 SendStateUpdateWithDelta(*active_model_, &delta);
136 SendStateUpdate(*active_model_);
References text.
Referenced by flutter::testing::TEST_F().
◆ ComposeChangeHook()
void flutter::TextInputPlugin::ComposeChangeHook |
( |
const std::u16string & |
text, |
|
|
int |
cursor_pos |
|
) |
| |
|
virtual |
Definition at line 192 of file text_input_plugin.cc.
194 if (active_model_ ==
nullptr) {
197 std::string text_before_change = active_model_->GetText();
198 TextRange composing_before_change = active_model_->composing_range();
199 active_model_->AddText(
text);
200 active_model_->UpdateComposingText(
text, TextRange(cursor_pos, cursor_pos));
201 std::string text_after_change = active_model_->GetText();
202 if (enable_delta_model) {
203 TextEditingDelta delta = TextEditingDelta(
204 fml::Utf8ToUtf16(text_before_change), composing_before_change,
text);
205 SendStateUpdateWithDelta(*active_model_, &delta);
207 SendStateUpdate(*active_model_);
References text.
Referenced by flutter::testing::TEST_F().
◆ ComposeCommitHook()
void flutter::TextInputPlugin::ComposeCommitHook |
( |
| ) |
|
|
virtual |
Definition at line 140 of file text_input_plugin.cc.
141 if (active_model_ ==
nullptr) {
144 std::string text_before_change = active_model_->GetText();
145 TextRange selection_before_change = active_model_->selection();
146 TextRange composing_before_change = active_model_->composing_range();
147 std::string composing_text_before_change = text_before_change.substr(
148 composing_before_change.start(), composing_before_change.length());
149 active_model_->CommitComposing();
References flutter::TextRange::length(), and flutter::TextRange::start().
Referenced by flutter::testing::TEST_F().
◆ ComposeEndHook()
void flutter::TextInputPlugin::ComposeEndHook |
( |
| ) |
|
|
virtual |
Definition at line 175 of file text_input_plugin.cc.
176 if (active_model_ ==
nullptr) {
179 std::string text_before_change = active_model_->GetText();
180 TextRange selection_before_change = active_model_->selection();
181 active_model_->CommitComposing();
182 active_model_->EndComposing();
183 if (enable_delta_model) {
184 std::string
text = active_model_->GetText();
185 TextEditingDelta delta = TextEditingDelta(
text);
186 SendStateUpdateWithDelta(*active_model_, &delta);
188 SendStateUpdate(*active_model_);
References text.
Referenced by flutter::testing::TEST_F().
◆ 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 67 of file text_input_plugin.cc.
68 if (active_model_ ==
nullptr) {
71 std::u16string text_before_change =
72 fml::Utf8ToUtf16(active_model_->GetText());
73 TextRange selection_before_change = active_model_->selection();
74 active_model_->AddText(
text);
76 if (enable_delta_model) {
77 TextEditingDelta delta =
78 TextEditingDelta(text_before_change, selection_before_change,
text);
79 SendStateUpdateWithDelta(*active_model_, &delta);
81 SendStateUpdate(*active_model_);
References text.
The documentation for this class was generated from the following files: