#include <text_input_model.h>
Public Member Functions | |
TextInputModel () | |
virtual | ~TextInputModel () |
bool | SetText (const std::string &text, const TextRange &selection=TextRange(0), const TextRange &composing_range=TextRange(0)) |
bool | SetSelection (const TextRange &range) |
bool | SetComposingRange (const TextRange &range, size_t cursor_offset) |
void | BeginComposing () |
void | UpdateComposingText (const std::u16string &text, const TextRange &selection) |
void | UpdateComposingText (const std::u16string &text) |
void | UpdateComposingText (const std::string &text) |
void | CommitComposing () |
void | EndComposing () |
void | AddCodePoint (char32_t c) |
void | AddText (const std::u16string &text) |
void | AddText (const std::string &text) |
bool | Delete () |
bool | DeleteSurrounding (int offset_from_cursor, int count) |
bool | Backspace () |
bool | MoveCursorBack () |
bool | MoveCursorForward () |
bool | MoveCursorToBeginning () |
bool | MoveCursorToEnd () |
bool | SelectToBeginning () |
bool | SelectToEnd () |
std::string | GetText () const |
int | GetCursorOffset () const |
TextRange | text_range () const |
TextRange | selection () const |
TextRange | composing_range () const |
bool | composing () const |
Definition at line 18 of file text_input_model.h.
|
default |
|
virtualdefault |
void flutter::TextInputModel::AddCodePoint | ( | char32_t | c | ) |
void flutter::TextInputModel::AddText | ( | const std::string & | text | ) |
void flutter::TextInputModel::AddText | ( | const std::u16string & | text | ) |
Definition at line 136 of file text_input_model.cc.
References flutter::TextRange::length(), flutter::TextRange::position(), flutter::TextRange::set_end(), flutter::TextRange::start(), and text.
Referenced by AddCodePoint(), and AddText().
bool flutter::TextInputModel::Backspace | ( | ) |
Definition at line 153 of file text_input_model.cc.
References flutter::TextRange::end(), flutter::TextRange::position(), and flutter::TextRange::set_end().
void flutter::TextInputModel::BeginComposing | ( | ) |
Definition at line 67 of file text_input_model.cc.
References flutter::TextRange::start().
void flutter::TextInputModel::CommitComposing | ( | ) |
Definition at line 94 of file text_input_model.cc.
References flutter::TextRange::collapsed(), and flutter::TextRange::end().
|
inline |
Definition at line 209 of file text_input_model.h.
|
inline |
Definition at line 206 of file text_input_model.h.
Referenced by SetText().
bool flutter::TextInputModel::Delete | ( | ) |
Definition at line 171 of file text_input_model.cc.
References flutter::TextRange::end(), flutter::TextRange::position(), and flutter::TextRange::set_end().
bool flutter::TextInputModel::DeleteSurrounding | ( | int | offset_from_cursor, |
int | count | ||
) |
Definition at line 188 of file text_input_model.cc.
References flutter::TextRange::end(), flutter::TextRange::extent(), flutter::TextRange::set_end(), and flutter::TextRange::start().
void flutter::TextInputModel::EndComposing | ( | ) |
Definition at line 103 of file text_input_model.cc.
int flutter::TextInputModel::GetCursorOffset | ( | ) | const |
std::string flutter::TextInputModel::GetText | ( | ) | const |
Definition at line 297 of file text_input_model.cc.
bool flutter::TextInputModel::MoveCursorBack | ( | ) |
Definition at line 281 of file text_input_model.cc.
References flutter::TextRange::collapsed(), flutter::TextRange::position(), and flutter::TextRange::start().
bool flutter::TextInputModel::MoveCursorForward | ( | ) |
Definition at line 265 of file text_input_model.cc.
References flutter::TextRange::collapsed(), flutter::TextRange::end(), and flutter::TextRange::position().
bool flutter::TextInputModel::MoveCursorToBeginning | ( | ) |
Definition at line 229 of file text_input_model.cc.
References flutter::TextRange::collapsed(), flutter::TextRange::position(), and flutter::TextRange::start().
bool flutter::TextInputModel::MoveCursorToEnd | ( | ) |
Definition at line 238 of file text_input_model.cc.
References flutter::TextRange::collapsed(), flutter::TextRange::end(), and flutter::TextRange::position().
|
inline |
Definition at line 201 of file text_input_model.h.
Referenced by SetText(), and UpdateComposingText().
bool flutter::TextInputModel::SelectToBeginning | ( | ) |
Definition at line 247 of file text_input_model.cc.
References flutter::TextRange::base(), flutter::TextRange::collapsed(), flutter::TextRange::position(), and flutter::TextRange::start().
bool flutter::TextInputModel::SelectToEnd | ( | ) |
Definition at line 256 of file text_input_model.cc.
References flutter::TextRange::base(), flutter::TextRange::collapsed(), flutter::TextRange::end(), and flutter::TextRange::position().
bool flutter::TextInputModel::SetComposingRange | ( | const TextRange & | range, |
size_t | cursor_offset | ||
) |
Definition at line 57 of file text_input_model.cc.
References flutter::TextRange::start(), and text_range().
bool flutter::TextInputModel::SetSelection | ( | const TextRange & | range | ) |
bool flutter::TextInputModel::SetText | ( | const std::string & | text, |
const TextRange & | selection = TextRange(0) , |
||
const TextRange & | composing_range = TextRange(0) |
||
) |
Definition at line 31 of file text_input_model.cc.
References flutter::TextRange::collapsed(), composing_range(), selection(), text, and text_range().
|
inline |
Definition at line 198 of file text_input_model.h.
Referenced by SetComposingRange(), and SetText().
void flutter::TextInputModel::UpdateComposingText | ( | const std::string & | text | ) |
Definition at line 90 of file text_input_model.cc.
References text, and UpdateComposingText().
void flutter::TextInputModel::UpdateComposingText | ( | const std::u16string & | text | ) |
Definition at line 86 of file text_input_model.cc.
References text, and UpdateComposingText().
void flutter::TextInputModel::UpdateComposingText | ( | const std::u16string & | text, |
const TextRange & | selection | ||
) |
Definition at line 72 of file text_input_model.cc.
References flutter::TextRange::collapsed(), flutter::TextRange::extent(), flutter::TextRange::length(), selection(), flutter::TextRange::set_end(), flutter::TextRange::start(), and text.
Referenced by UpdateComposingText().