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.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#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_;
|
||||
};
|
||||
Reference in New Issue
Block a user