text-input-vm.h 823 B

1234567891011121314151617181920212223242526272829303132333435
  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. */
  18. void set_result_callback(
  19. TextInputCallback callback,
  20. void* callback_context,
  21. char* text,
  22. uint8_t max_text_length);
  23. /**
  24. * @brief Set text input header text
  25. *
  26. * @param text - text to be shown
  27. */
  28. void set_header_text(const char* text);
  29. private:
  30. TextInput* text_input;
  31. };