#pragma once #include #include #include #include #include #include "../ActivityWithSubactivity.h" #include "util/ButtonNavigator.h" class EpubReaderMenuActivity final : public ActivityWithSubactivity { public: // Menu actions available from the reader menu. enum class MenuAction { SELECT_CHAPTER, FOOTNOTES, GO_TO_PERCENT, ROTATE_SCREEN, SCREENSHOT, DISPLAY_QR, GO_HOME, SYNC, DELETE_CACHE }; explicit EpubReaderMenuActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, const std::string& title, const int currentPage, const int totalPages, const int bookProgressPercent, const uint8_t currentOrientation, const bool hasFootnotes, const std::function& onBack, const std::function& onAction); void onEnter() override; void onExit() override; void loop() override; void render(Activity::RenderLock&&) override; private: struct MenuItem { MenuAction action; StrId labelId; }; static std::vector buildMenuItems(bool hasFootnotes); // Fixed menu layout const std::vector menuItems; int selectedIndex = 0; ButtonNavigator buttonNavigator; std::string title = "Reader Menu"; uint8_t pendingOrientation = 0; const std::vector orientationLabels = {StrId::STR_PORTRAIT, StrId::STR_LANDSCAPE_CW, StrId::STR_INVERTED, StrId::STR_LANDSCAPE_CCW}; int currentPage = 0; int totalPages = 0; int bookProgressPercent = 0; const std::function onBack; const std::function onAction; };