diff options
author | crupest <crupest@outlook.com> | 2021-10-26 16:32:13 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-10-26 16:32:13 +0800 |
commit | 9dec93315173999c4fb9ab5a0e57909eb5e7fd8b (patch) | |
tree | 042fff007fc3d0959146f131f425b9626448718e /include/cru/ui/controls/TextHostControlService.hpp | |
parent | 397843cda9e4161d3e92d8797f8012f478ce64f0 (diff) | |
download | cru-9dec93315173999c4fb9ab5a0e57909eb5e7fd8b.tar.gz cru-9dec93315173999c4fb9ab5a0e57909eb5e7fd8b.tar.bz2 cru-9dec93315173999c4fb9ab5a0e57909eb5e7fd8b.zip |
...
Diffstat (limited to 'include/cru/ui/controls/TextHostControlService.hpp')
-rw-r--r-- | include/cru/ui/controls/TextHostControlService.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/cru/ui/controls/TextHostControlService.hpp b/include/cru/ui/controls/TextHostControlService.hpp index 84c226ca..b56374dc 100644 --- a/include/cru/ui/controls/TextHostControlService.hpp +++ b/include/cru/ui/controls/TextHostControlService.hpp @@ -8,7 +8,6 @@ #include "cru/ui/helper/ShortcutHub.hpp" #include <functional> -#include <string> namespace cru::ui::render { class TextRenderObject; @@ -43,9 +42,10 @@ class TextHostControlService : public Object { void SetEditable(bool editable); String GetText() { return this->text_; } + StringView GetTextView() { return this->text_; } void SetText(String text, bool stop_composition = false); - void InsertText(gsl::index position, std::u16string_view text, + void InsertText(gsl::index position, StringView text, bool stop_composition = false); void DeleteChar(gsl::index position, bool stop_composition = false); @@ -76,7 +76,7 @@ class TextHostControlService : public Object { void DeleteSelectedText(); // If some text is selected, then they are deleted first. Then insert text // into caret position. - void ReplaceSelectedText(std::u16string_view text); + void ReplaceSelectedText(StringView text); void ScrollToCaret(); |