Some checks failed
ESP-IDF Build / build (esp32c6, release-v5.4) (push) Failing after 4m12s
ESP-IDF Build / build (esp32c6, release-v5.5) (push) Failing after 4m17s
ESP-IDF Build / build (esp32s3, release-v5.4) (push) Failing after 3m49s
ESP-IDF Build / build (esp32s3, release-v5.5) (push) Failing after 4m0s
Signed-off-by: Peter Siegmund <developer@mars3142.org>
68 lines
1.9 KiB
C++
68 lines
1.9 KiB
C++
/**
|
|
* @file MenuOptions.h
|
|
* @brief Menu configuration structure and callback definitions
|
|
* @details This header defines the menu_options_t structure which contains all
|
|
* necessary configuration options and callback functions for menu widgets.
|
|
* It provides the interface between menu widgets and the application's
|
|
* screen management system, display context, and input handling.
|
|
* @author System Control Team
|
|
* @date 2025-06-14
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Standard libraries for function objects and smart pointers
|
|
#include <functional>
|
|
#include <memory>
|
|
|
|
// Project-specific headers
|
|
#include "common/Widget.h"
|
|
#include "persistence_manager.h"
|
|
#include "u8g2.h"
|
|
|
|
class MenuItem;
|
|
|
|
/**
|
|
* @struct menu_options_t
|
|
* @brief Configuration structure for menu widgets containing display context and callbacks
|
|
* @details This structure serves as a configuration container that provides menu widgets
|
|
* with access to the display system, screen management functions, input
|
|
* handling callbacks, and persistent storage.
|
|
*
|
|
* @see Widget
|
|
* @see ButtonType
|
|
* @see IPersistenceManager
|
|
*/
|
|
typedef struct
|
|
{
|
|
/**
|
|
* @brief Pointer to u8g2 display context for graphics output operations
|
|
*/
|
|
u8g2_t *u8g2;
|
|
|
|
/**
|
|
* @brief Callback function to set the current active screen
|
|
*/
|
|
std::function<void(std::shared_ptr<Widget>)> setScreen;
|
|
|
|
/**
|
|
* @brief Callback function to add a new screen to the navigation stack
|
|
*/
|
|
std::function<void(std::shared_ptr<Widget>)> pushScreen;
|
|
|
|
/**
|
|
* @brief Callback function to remove the top screen from the navigation stack
|
|
*/
|
|
std::function<void()> popScreen;
|
|
|
|
/**
|
|
* @brief Callback function to handle button press events
|
|
*/
|
|
std::function<void(ButtonType button)> onButtonClicked;
|
|
|
|
/**
|
|
* @brief Zeiger auf C-Persistence-Manager-Instanz
|
|
*/
|
|
persistence_manager_t *persistenceManager;
|
|
|
|
} menu_options_t; |