#pragma once #include #include #include "../Activity.h" #include "util/ButtonNavigator.h" class EpubReaderChapterSelectionActivity final : public Activity { std::shared_ptr epub; std::string epubPath; ButtonNavigator buttonNavigator; int currentSpineIndex = 0; int selectorIndex = 0; // Number of items that fit on a page, derived from logical screen height. // This adapts automatically when switching between portrait and landscape. int getPageItems() const; // Total TOC items count int getTotalItems() const; public: explicit EpubReaderChapterSelectionActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, const std::shared_ptr& epub, const std::string& epubPath, const int currentSpineIndex) : Activity("EpubReaderChapterSelection", renderer, mappedInput), epub(epub), epubPath(epubPath), currentSpineIndex(currentSpineIndex) {} void onEnter() override; void onExit() override; void loop() override; void render(RenderLock&&) override; };