Files
Crosspoint/src/ThemeInstaller.h
T
Justin Mitchell 48aa3c8e02 Add SD theme system
Adds installable SD-card themes with manifest downloads, theme registry parsing, themed home/chrome/settings/file browser support, FreeInk layout integration, theme documentation, and layout tests.
2026-06-28 01:44:38 -04:00

31 lines
784 B
C++

#pragma once
#include <cstddef>
#include "components/themes/SdCardThemeRegistry.h"
class ThemeInstaller {
public:
enum class Error {
OK,
INVALID_THEME_ID,
INVALID_FILE,
SD_WRITE_ERROR,
};
explicit ThemeInstaller(SdCardThemeRegistry& registry);
static bool isValidThemeId(const char* id);
static bool isValidRelativePath(const char* path);
bool ensureThemeDir(const char* themeId);
bool ensureParentDirs(const char* fullPath);
bool validateThemeFile(const char* path);
static bool buildThemePath(const char* themeId, const char* relativePath, char* outBuf, size_t outBufSize);
Error deleteTheme(const char* themeId);
void refreshRegistry();
bool isThemeInstalled(const char* themeId) const;
private:
SdCardThemeRegistry& registry_;
};