unleashed-firmware/lib/app-scened-template/view-modules/text-input-vm.cpp
SG 0b14db4fb3
C++ apps: templated scene controller (#517)
* C++ apps: templated scene controller
* templated app: fix type names
* templated app: text store component
* Applications: add "Templated Scene" application
* templated app: refractoring
* Gui module byte input: fix docs
* templated app: new byte input scene
* templated app: dialog ex view module
* templated app: popup view module
* templated app: dialog-ex view module, fix docs
* templated app: text input view module
* Gui module text input: fix docs
* Furi: duplicated include
* templated app: record holder (controller) class
* templated app: view modules can now be accessed via cast
* templated app: remove unused includes
* templated app: fix return code
2021-06-15 14:01:56 +03:00

31 lines
698 B
C++

#include "text-input-vm.h"
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() {
set_result_callback(NULL, NULL, NULL, 0);
set_header_text("");
}
void TextInputVM::set_result_callback(
TextInputCallback callback,
void* callback_context,
char* text,
uint8_t max_text_length) {
text_input_set_result_callback(text_input, callback, callback_context, text, max_text_length);
}
void TextInputVM::set_header_text(const char* text) {
text_input_set_header_text(text_input, text);
}