#pragma once #include #include #include #include #include "../Activity.h" #include "util/ButtonNavigator.h" class EpubReaderMenuActivity final : public Activity { public: // Menu actions available from the reader menu. enum class MenuAction { SELECT_CHAPTER, FOOTNOTES, GO_TO_PERCENT, AUTO_PAGE_TURN, ROTATE_SCREEN, SCREENSHOT, DISPLAY_QR, GO_HOME, SYNC, DELETE_CACHE, // Mod-specific actions ADD_BOOKMARK, REMOVE_BOOKMARK, LOOKUP_WORD, LOOKUP_HISTORY, GO_TO_BOOKMARK, TABLE_OF_CONTENTS, TOGGLE_ORIENTATION, TOGGLE_FONT_SIZE, CLOSE_BOOK, DELETE_DICT_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, bool isBookmarked = false, uint8_t currentFontSize = 0); void onEnter() override; void onExit() override; void loop() override; void render(RenderLock&&) override; private: struct MenuItem { MenuAction action; StrId labelId; }; static std::vector buildMenuItems(bool hasFootnotes, bool isBookmarked); // Fixed menu layout const std::vector menuItems; int selectedIndex = 0; ButtonNavigator buttonNavigator; std::string title = "Reader Menu"; uint8_t pendingOrientation = 0; uint8_t pendingFontSize = 0; uint8_t selectedPageTurnOption = 0; const std::vector orientationLabels = {StrId::STR_PORTRAIT, StrId::STR_LANDSCAPE_CW, StrId::STR_INVERTED, StrId::STR_LANDSCAPE_CCW}; const std::vector fontSizeLabels = {StrId::STR_SMALL, StrId::STR_MEDIUM, StrId::STR_LARGE, StrId::STR_X_LARGE}; const std::vector pageTurnLabels = {I18N.get(StrId::STR_STATE_OFF), "1", "3", "6", "12"}; int currentPage = 0; int totalPages = 0; int bookProgressPercent = 0; };