#pragma once #include #include #include "settings.h" namespace roro { // What the Settings App lists: one row per user-facing setting (plus sub-pages), with readable // values, choice lists and validation messages. Rendering and navigation live in the App. class SettingsMenu { public: enum class Row { LongName, ShortName, Region, Timezone, Brightness, DimTimeout, OffTimeout, Sound, Gnss, GnssQuiet, Coordinates, ProbeMacs, Wifi, CheckUpdates, Firmware, DebugConsole, About }; enum class Kind { Text, Choice, Toggle, Slider, Page }; explicit SettingsMenu(Settings& settings) : settings_(settings) {} int count() const; Row row(int i) const; Kind kind(int i) const; std::string label(int i) const; std::string value(int i) const; // Choice rows std::vector choices(int i) const; int currentChoice(int i) const; // -1 if the current value isn't one of the choices std::string choose(int i, int choice); // empty on success, otherwise why it was refused // Toggle and Slider rows void toggle(int i); void adjust(int i, int direction); // Text rows int maxBytes(int i) const; std::string setText(int i, const std::string& text); // empty on success, otherwise why private: Settings& settings_; }; } // namespace roro