31 void init(
const char* title,
const char* text);
36 void setHint(
const char* hint) { customHint_ = hint; }
46 callbackUserData_ = userData;
56 menuUserData_ = userData;
60 void render(
bool partial)
override;
63 const char*
getName()
const override {
return "InfoView"; }
67 static constexpr uint16_t MAX_TITLE_LEN = 64;
69 char titleBuf_[MAX_TITLE_LEN];
74 const char* customHint_ =
nullptr;
75 uint16_t scrollLine_ = 0;
76 uint16_t totalLines_ = 0;
79 void* callbackUserData_ =
nullptr;
81 void* menuUserData_ =
nullptr;
83 void scroll(
bool down);
84 uint16_t countLines()
const;
103InfoView*
showInfo(
const char* title,
const char* text,
const char* hint =
nullptr);
Shared RAII wrappers for firmware resources.
void setOnMenu(MenuCallback onMenu, void *userData=nullptr)
static constexpr uint16_t MAX_TEXT_LEN
InputResult onKey(char key) override
Handles key input for scrolling and optional callbacks.
void(*)(void *userData) YesNoCallback
static constexpr uint8_t VISIBLE_LINES
InputResult onLongPress(char key) override
Long-press jumps to the first (KEY_UP) or last (KEY_DOWN) page.
static constexpr uint8_t LINE_HEIGHT
const char * getName() const override
void init(const char *title, const char *text)
const char * getFooterHint() const override
Returns the footer hint text.
void(*)(void *userData) MenuCallback
void setHint(const char *hint)
void setYesNoCallbacks(YesNoCallback onYes, YesNoCallback onNo, void *userData=nullptr)
std::unique_ptr< T[], CapsFreeDeleter > PsramUniquePtr
Centralized key-code constants for cdc_views.
InfoView * showInfo(const char *title, const char *text, const char *hint=nullptr)
Shows a shared info view instance and pushes it onto the view stack.