Files
Crosspoint/src/activities/reader/ReaderActivity.h
T

36 lines
1.3 KiB
C++

#pragma once
#include <memory>
#include "../Activity.h"
#include "activities/home/FileBrowserActivity.h"
class Epub;
class Xtc;
class Txt;
class ReaderActivity final : public Activity {
std::string initialBookPath;
std::string currentBookPath; // Track current book path for navigation
static std::unique_ptr<Epub> loadEpub(const std::string& path);
static std::unique_ptr<Xtc> loadXtc(const std::string& path);
static std::unique_ptr<Txt> loadTxt(const std::string& path);
static bool isXtcFile(const std::string& path);
static bool isTxtFile(const std::string& path);
static bool isImageFile(const std::string& path);
static std::string extractFolderPath(const std::string& filePath);
void goToLibrary(const std::string& fromBookPath = "");
void onGoToEpubReader(std::unique_ptr<Epub> epub);
void onGoToXtcReader(std::unique_ptr<Xtc> xtc);
void onGoToTxtReader(std::unique_ptr<Txt> txt);
void onGoToBmpViewer(const std::string& path);
void onGoBack();
public:
explicit ReaderActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::string initialBookPath)
: Activity("Reader", renderer, mappedInput), initialBookPath(std::move(initialBookPath)) {}
void onEnter() override;
bool isReaderActivity() const override { return true; }
};