2025-12-17 23:32:18 +11:00
|
|
|
#pragma once
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
#include "../ActivityWithSubactivity.h"
|
|
|
|
|
|
|
|
|
|
class Epub;
|
|
|
|
|
|
|
|
|
|
class ReaderActivity final : public ActivityWithSubactivity {
|
|
|
|
|
std::string initialEpubPath;
|
2025-12-26 02:15:16 +09:00
|
|
|
std::string currentEpubPath; // Track current book path for navigation
|
2025-12-17 23:32:18 +11:00
|
|
|
const std::function<void()> onGoBack;
|
|
|
|
|
static std::unique_ptr<Epub> loadEpub(const std::string& path);
|
|
|
|
|
|
2025-12-26 02:15:16 +09:00
|
|
|
static std::string extractFolderPath(const std::string& filePath);
|
2025-12-17 23:32:18 +11:00
|
|
|
void onSelectEpubFile(const std::string& path);
|
2025-12-26 02:15:16 +09:00
|
|
|
void onGoToFileSelection(const std::string& fromEpubPath = "");
|
2025-12-17 23:32:18 +11:00
|
|
|
void onGoToEpubReader(std::unique_ptr<Epub> epub);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit ReaderActivity(GfxRenderer& renderer, InputManager& inputManager, std::string initialEpubPath,
|
|
|
|
|
const std::function<void()>& onGoBack)
|
2025-12-21 21:17:00 +11:00
|
|
|
: ActivityWithSubactivity("Reader", renderer, inputManager),
|
2025-12-17 23:32:18 +11:00
|
|
|
initialEpubPath(std::move(initialEpubPath)),
|
|
|
|
|
onGoBack(onGoBack) {}
|
|
|
|
|
void onEnter() override;
|
|
|
|
|
};
|