feat: Add dictionary word lookup feature with cached index
Implements StarDict-based dictionary lookup from the reader menu, adapted from upstream PR #857 with /.dictionary/ folder path, std::vector compatibility (PR #802), HTML definition rendering, orientation-aware button hints, side button hints with CCW text rotation, sparse index caching to SD card, pronunciation line filtering, and reorganized reader menu with bookmark stubs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
15
src/util/LookupHistory.h
Normal file
15
src/util/LookupHistory.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class LookupHistory {
|
||||
public:
|
||||
static std::vector<std::string> load(const std::string& cachePath);
|
||||
static void addWord(const std::string& cachePath, const std::string& word);
|
||||
static void removeWord(const std::string& cachePath, const std::string& word);
|
||||
static bool hasHistory(const std::string& cachePath);
|
||||
|
||||
private:
|
||||
static std::string filePath(const std::string& cachePath);
|
||||
static constexpr int MAX_ENTRIES = 500;
|
||||
};
|
||||
Reference in New Issue
Block a user