2022-01-05 16:10:18 +00:00
|
|
|
#include "text_input_vm.h"
|
2021-06-15 11:01:56 +00:00
|
|
|
|
|
|
|
TextInputVM::TextInputVM() {
|
|
|
|
text_input = text_input_alloc();
|
|
|
|
}
|
|
|
|
|
|
|
|
TextInputVM::~TextInputVM() {
|
|
|
|
text_input_free(text_input);
|
|
|
|
}
|
|
|
|
|
|
|
|
View* TextInputVM::get_view() {
|
|
|
|
return text_input_get_view(text_input);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TextInputVM::clean() {
|
2022-01-21 17:32:03 +00:00
|
|
|
text_input_reset(text_input);
|
2021-06-15 11:01:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TextInputVM::set_result_callback(
|
|
|
|
TextInputCallback callback,
|
|
|
|
void* callback_context,
|
|
|
|
char* text,
|
2021-07-25 11:34:54 +00:00
|
|
|
uint8_t max_text_length,
|
|
|
|
bool clear_default_text) {
|
2022-01-05 16:10:18 +00:00
|
|
|
text_input_set_result_callback(
|
|
|
|
text_input, callback, callback_context, text, max_text_length, clear_default_text);
|
2021-06-15 11:01:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TextInputVM::set_header_text(const char* text) {
|
|
|
|
text_input_set_header_text(text_input, text);
|
|
|
|
}
|
2022-01-29 09:39:10 +00:00
|
|
|
|
|
|
|
void TextInputVM::set_validator(TextInputValidatorCallback callback, void* callback_context) {
|
|
|
|
text_input_set_validator(text_input, callback, callback_context);
|
|
|
|
}
|
|
|
|
|
|
|
|
void* TextInputVM::get_validator_callback_context() {
|
|
|
|
return text_input_get_validator_callback_context(text_input);
|
|
|
|
}
|