#pragma once #include "menu_option.h" #include #include #include class ActionListOption : public MenuOption { public: using ValueGetter = std::function; using ValueSetter = std::function; using ActionExecutor = std::function; ActionListOption( const std::string& caption, ServiceMenu::SettingsGroup group, std::vector options, ValueGetter getter, ValueSetter setter, ActionExecutor action_executor, bool hidden = false ); // Implementaciones de MenuOption [[nodiscard]] auto getBehavior() const -> Behavior override; [[nodiscard]] auto getValueAsString() const -> std::string override; [[nodiscard]] auto getMaxValueWidth(Text* text) const -> int override; void adjustValue(bool up) override; void executeAction() override; void sync(); //override; private: std::vector options_; ValueGetter value_getter_; ValueSetter value_setter_; ActionExecutor action_executor_; size_t current_index_; void updateCurrentIndex(); [[nodiscard]] auto findCurrentIndex() const -> size_t; };