40 lines
934 B
C++
40 lines
934 B
C++
#pragma once
|
|
|
|
#include "ui/ui_app.h"
|
|
#include "ui/app_registry.h"
|
|
|
|
/**
|
|
* @brief Shutdown application - displays shutdown message
|
|
*
|
|
* Shown when the system is about to enter deep sleep or power off.
|
|
* Displays a message and optionally a spinner animation.
|
|
*/
|
|
class ShutdownApp : public UIApp {
|
|
public:
|
|
ShutdownApp(std::string message = "");
|
|
virtual ~ShutdownApp() = default;
|
|
|
|
esp_err_t init(lv_obj_t* container) override;
|
|
esp_err_t deinit(void) override;
|
|
std::string get_name(void) const override;
|
|
|
|
private:
|
|
std::string _message;
|
|
lv_obj_t* _label_message = nullptr;
|
|
};
|
|
|
|
/**
|
|
* @brief AppDescriptor for ShutdownApp
|
|
*
|
|
* Note: Shutdown app is typically not shown in the navigation bar
|
|
* as it's only used during system shutdown.
|
|
*/
|
|
class ShutdownAppDescriptor : public AppDescriptor {
|
|
public:
|
|
ShutdownAppDescriptor();
|
|
void draw_icon(lv_obj_t* parent) override;
|
|
|
|
private:
|
|
static ShutdownApp* _app_instance;
|
|
};
|