Files
Crosspoint/src/activities/reader/EpubReaderChapterSelectionActivity.h
T
Zach Nelson 6f7f4c592a refactor: Eliminated relative path includes (#1961)
## Summary

Relative includes can hide inappropriate dependency relationships. In
this case, I found that lib/KOReaderSync/KOReaderCredentialStore.cpp was
dependent on src/JsonSettingsIO.h -- a lib -> app dependency, the
opposite direction dependencies should flow in this project.

This change replaces all relative includes with root-relative includes,
and corrects the KOReaderCredentialStore dependency by moving its JSON
settings serialization local to the KOReaderSync library.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**PARTIALLY**_
2026-05-13 08:26:30 -05:00

36 lines
1.1 KiB
C++

#pragma once
#include <Epub.h>
#include <memory>
#include "activities/Activity.h"
#include "util/ButtonNavigator.h"
class EpubReaderChapterSelectionActivity final : public Activity {
std::shared_ptr<Epub> 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>& 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;
};