text-input-vm.h 923 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "generic-view-module.h"
  3. #include <gui/modules/text_input.h>
  4. class TextInputVM : public GenericViewModule {
  5. public:
  6. TextInputVM();
  7. ~TextInputVM() final;
  8. View* get_view() final;
  9. void clean() final;
  10. /**
  11. * @brief Set text input result callback
  12. *
  13. * @param callback - callback fn
  14. * @param callback_context - callback context
  15. * @param text - text buffer to use
  16. * @param max_text_length - text buffer length
  17. * @param clear_default_text - clears given buffer on OK event
  18. */
  19. void set_result_callback(
  20. TextInputCallback callback,
  21. void* callback_context,
  22. char* text,
  23. uint8_t max_text_length,
  24. bool clear_default_text);
  25. /**
  26. * @brief Set text input header text
  27. *
  28. * @param text - text to be shown
  29. */
  30. void set_header_text(const char* text);
  31. private:
  32. TextInput* text_input;
  33. };