31 lines
692 B
C
Raw Normal View History

2025-12-03 22:00:29 +11:00
#pragma once
#include "Epub.h"
class Page;
class EpdRenderer;
class Section {
Epub* epub;
const int spineIndex;
2025-12-06 12:56:39 +11:00
EpdRenderer& renderer;
2025-12-03 22:00:29 +11:00
std::string cachePath;
void onPageComplete(const Page* page);
public:
int pageCount = 0;
int currentPage = 0;
2025-12-06 12:56:39 +11:00
explicit Section(Epub* epub, const int spineIndex, EpdRenderer& renderer)
2025-12-03 22:00:29 +11:00
: epub(epub), spineIndex(spineIndex), renderer(renderer) {
cachePath = epub->getCachePath() + "/" + std::to_string(spineIndex);
}
~Section() = default;
2025-12-06 22:04:59 +11:00
void writeCacheMetadata() const;
bool loadCacheMetadata();
2025-12-03 22:00:29 +11:00
void setupCacheDir() const;
void clearCache() const;
bool persistPageDataToSD();
Page* loadPageFromSD() const;
2025-12-03 22:00:29 +11:00
};