Something went wrong. Try again.
A fork of https://github.com/crosspoint-reader/crosspoint-reader
Something went wrong. Try again.
1.2 kB · 34 lines
C
at master
1234567891011121314151617181920212223242526272829303132333435#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 isBmpFile(const std::string& path);
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; }};