| 70 | } |
| 71 | |
| 72 | RichTextUserInput::Changes RichTextUserInput::input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) { |
| 73 | RichTextUserInput::Changes toRet{false, false}; |
| 74 | switch(textboxInput.command) { |
| 75 | case CustomEvents::AndroidTextBoxInputEvent::CommandType::COMMIT_ALL: { |
| 76 | #ifdef __ANDROID__ |
| 77 | std::pair<bool, bool> c = AndroidJNICalls::getChangesToCommit(id); |
| 78 | toRet.textEdited = c.first; |
| 79 | toRet.cursorChanged = c.second; |
| 80 | if(toRet.textEdited) |
| 81 | do_textbox_operation_with_undo([&]() { |
| 82 | AndroidJNICalls::commitAll(id, textBox, cursor); |
| 83 | }); |
| 84 | else |
| 85 | AndroidJNICalls::commitAll(id, textBox, cursor); |
| 86 | #else |
| 87 | toRet.textEdited = toRet.cursorChanged = false; |
| 88 | #endif |
| 89 | break; |
| 90 | } |
| 91 | } |
| 92 | return toRet; |
| 93 | } |
| 94 | |
| 95 | void RichTextUserInput::add_text_to_textbox(const std::string& inputText) { |
| 96 | do_textbox_operation_with_undo([&]() { |
nothing calls this directly
no test coverage detected