Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorTheme::PaletteStore Class Reference

#include <PhosphorTheme/PaletteStore.h>

Inheritance diagram for PhosphorTheme::PaletteStore:
[legend]

Signals

void paletteChanged ()
void sourcePathChanged ()
void loadError (const QString &path, const QString &reason)

Public Member Functions

 PaletteStore (QObject *parent=nullptr)
 ~PaletteStore () override
QVariantMap palette () const override
QColor token (const QString &name) const override
bool loadFromJson (const QByteArray &json) override
bool loadFromFile (const QString &path) override
void applyTokens (const QVariantMap &tokens) override
void resetToDefaults () override
QString sourcePath () const
void setDebounceIntervalForTest (int ms)
 Test-only: override the hot-reload debounce interval (default 80 ms).
Public Member Functions inherited from PhosphorTheme::IThemeService
virtual ~IThemeService ()=default

Static Public Member Functions

static QVariantMap defaultPalette ()

Constructor & Destructor Documentation

◆ PaletteStore()

PhosphorTheme::PaletteStore::PaletteStore ( QObject * parent = nullptr)
explicit

◆ ~PaletteStore()

PhosphorTheme::PaletteStore::~PaletteStore ( )
override

Member Function Documentation

◆ applyTokens()

void PhosphorTheme::PaletteStore::applyTokens ( const QVariantMap & tokens)
overridevirtual

◆ defaultPalette()

QVariantMap PhosphorTheme::PaletteStore::defaultPalette ( )
staticnodiscard

◆ loadError

void PhosphorTheme::PaletteStore::loadError ( const QString & path,
const QString & reason )
signal

◆ loadFromFile()

bool PhosphorTheme::PaletteStore::loadFromFile ( const QString & path)
overridevirtual

◆ loadFromJson()

bool PhosphorTheme::PaletteStore::loadFromJson ( const QByteArray & json)
overridevirtual

◆ palette()

QVariantMap PhosphorTheme::PaletteStore::palette ( ) const
nodiscardoverridevirtual

◆ paletteChanged

void PhosphorTheme::PaletteStore::paletteChanged ( )
signal

◆ resetToDefaults()

void PhosphorTheme::PaletteStore::resetToDefaults ( )
overridevirtual

◆ setDebounceIntervalForTest()

void PhosphorTheme::PaletteStore::setDebounceIntervalForTest ( int ms)

Test-only: override the hot-reload debounce interval (default 80 ms).

Lets test_palettestore_hotreload.cpp resolve QTRY-style polling in O(milliseconds) instead of waiting on the production 80 ms window for every event. Values less than 1 ms are clamped to 1.

CONTRACT: the ForTest suffix is convention only — there is no build-time guard preventing production code from calling this. Production consumers MUST NOT touch this method; doing so breaks the documented 80 ms coalescing behaviour relied on by downstream shells. The method stays public (rather than friend class Test...) because the test TU is built as a separate executable and friend-class extension across CMake targets is brittle. The ForTest suffix is the project convention for this trade-off (see DirectoryLoader:: setDebounceIntervalForTest, etc.).

◆ sourcePath()

QString PhosphorTheme::PaletteStore::sourcePath ( ) const
nodiscard

◆ sourcePathChanged

void PhosphorTheme::PaletteStore::sourcePathChanged ( )
signal

◆ token()

QColor PhosphorTheme::PaletteStore::token ( const QString & name) const
nodiscardoverridevirtual

The documentation for this class was generated from the following file: