mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-24 05:48:08 +03:00
0b14db4fb3
* 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
68 lines
1.7 KiB
C++
68 lines
1.7 KiB
C++
#pragma once
|
|
#include "generic-view-module.h"
|
|
#include <gui/modules/popup.h>
|
|
|
|
class PopupVM : public GenericViewModule {
|
|
public:
|
|
PopupVM();
|
|
~PopupVM() final;
|
|
View* get_view() final;
|
|
void clean() final;
|
|
|
|
/**
|
|
* Set popup header text
|
|
* @param text - text to be shown
|
|
*/
|
|
void set_callback(PopupCallback callback);
|
|
|
|
/**
|
|
* Set popup context
|
|
* @param context - context pointer, will be passed to result callback
|
|
*/
|
|
void set_context(void* context);
|
|
|
|
/**
|
|
* Set popup header text
|
|
* If text is null, popup header will not be rendered
|
|
* @param text - text to be shown, can be multiline
|
|
* @param x, y - text position
|
|
* @param horizontal, vertical - text aligment
|
|
*/
|
|
void set_header(const char* text, uint8_t x, uint8_t y, Align horizontal, Align vertical);
|
|
|
|
/**
|
|
* Set popup text
|
|
* If text is null, popup text will not be rendered
|
|
* @param text - text to be shown, can be multiline
|
|
* @param x, y - text position
|
|
* @param horizontal, vertical - text aligment
|
|
*/
|
|
void set_text(const char* text, uint8_t x, uint8_t y, Align horizontal, Align vertical);
|
|
|
|
/**
|
|
* Set popup icon
|
|
* If icon position is negative, popup icon will not be rendered
|
|
* @param x, y - icon position
|
|
* @param name - icon to be shown
|
|
*/
|
|
void set_icon(int8_t x, int8_t y, IconName name);
|
|
|
|
/**
|
|
* Set popup timeout
|
|
* @param timeout_in_ms - popup timeout value in milliseconds
|
|
*/
|
|
void set_timeout(uint32_t timeout_in_ms);
|
|
|
|
/**
|
|
* Enable popup timeout
|
|
*/
|
|
void enable_timeout();
|
|
|
|
/**
|
|
* Disable popup timeout
|
|
*/
|
|
void disable_timeout();
|
|
|
|
private:
|
|
Popup* popup;
|
|
}; |