Abstract contract for a tiling-algorithm registry. More...
#include <phosphor-tiles/include/PhosphorTiles/ITileAlgorithmRegistry.h>
Signals | |
| void | algorithmRegistered (const QString &id) |
| An algorithm has been registered. | |
| void | algorithmUnregistered (const QString &id, bool replacing) |
| An algorithm has been unregistered or is being replaced. | |
| void | previewParamsChanged () |
Preview parameters changed via setPreviewParams. | |
Signals inherited from PhosphorLayout::ILayoutSourceRegistry | |
| void | contentsChanged () |
| Emitted when the set of layouts this registry produces changes in any way that invalidates cached previews — entries added, removed, renamed, or re-parameterised. | |
Public Member Functions | |
| ITileAlgorithmRegistry (QObject *parent=nullptr) | |
| ~ITileAlgorithmRegistry () override | |
| virtual TilingAlgorithm * | algorithm (const QString &id) const =0 |
| Resolve an algorithm by its stable id. | |
| virtual QStringList | availableAlgorithms () const =0 |
| All registered algorithm ids, in registration order. | |
| virtual QList< TilingAlgorithm * > | allAlgorithms () const =0 |
| Every registered algorithm pointer. | |
| virtual bool | hasAlgorithm (const QString &id) const =0 |
Whether an algorithm is registered under id. | |
| virtual TilingAlgorithm * | defaultAlgorithm () const =0 |
| Convenience: the registry's recommended default algorithm. | |
| virtual QString | defaultAlgorithmId () const =0 |
| Stable id of the registry's recommended default algorithm. | |
| virtual void | registerAlgorithm (const QString &id, TilingAlgorithm *algorithm)=0 |
Register an algorithm under id. | |
| virtual bool | unregisterAlgorithm (const QString &id)=0 |
Unregister and delete the algorithm with id. | |
| virtual void | setPreviewParams (const AlgorithmPreviewParams ¶ms)=0 |
| Apply the user-configured tiling parameters. | |
| virtual const AlgorithmPreviewParams & | previewParams () const noexcept=0 |
| The currently-configured preview parameters. | |
Public Member Functions inherited from PhosphorLayout::ILayoutSourceRegistry | |
| ILayoutSourceRegistry (QObject *parent=nullptr) | |
| ~ILayoutSourceRegistry () override | |
Abstract contract for a tiling-algorithm registry.
Symmetric with PhosphorZones::IZoneLayoutRegistry — the two provider libraries expose the same shape: an ILayoutSourceRegistry-derived interface plus one concrete implementation. Fixture tests stub this contract rather than the concrete AlgorithmRegistry; the upcoming AutotileLayoutSourceFactory binds to this interface so dependency injection can hand in alternative implementations (per-process instances, test fakes, future scripted-engine registries).
Inherits PhosphorLayout::ILayoutSourceRegistry for the unified contentsChanged signal that AutotileLayoutSource self-wires to invalidate its preview cache on any registry change. The three finer-grained signals declared here (algorithmRegistered, algorithmUnregistered, previewParamsChanged) stay available for callers that need to discriminate between cause types — e.g. UI code that animates only on preview-param changes.
|
explicit |
|
override |
|
pure virtual |
Resolve an algorithm by its stable id.
Returns nullptr when no algorithm with that id is registered.
Implemented in PhosphorTiles::AlgorithmRegistry.
|
signal |
An algorithm has been registered.
On replacement (re-registration of an existing id), algorithmUnregistered(id, true) fires first, then algorithmRegistered(id). The new algorithm is already queryable via algorithm(id) when either signal fires.
|
signal |
An algorithm has been unregistered or is being replaced.
replacing is true when a new algorithm has already been registered under id; false when the algorithm was explicitly removed.
|
pure virtual |
Every registered algorithm pointer.
Ownership stays with the registry.
Implemented in PhosphorTiles::AlgorithmRegistry.
|
pure virtual |
All registered algorithm ids, in registration order.
Implemented in PhosphorTiles::AlgorithmRegistry.
|
pure virtual |
Convenience: the registry's recommended default algorithm.
Resolves defaultAlgorithmId() via algorithm() and falls back to the first-registered algorithm if the configured default isn't present. Concrete registries override defaultAlgorithmId to publish their policy id; tests can override either to inject a fake.
Implemented in PhosphorTiles::AlgorithmRegistry.
|
pure virtual |
Stable id of the registry's recommended default algorithm.
Virtual so test fakes that derive from this interface can publish their own policy id without taking on AlgorithmRegistry's concrete implementation. The concrete AlgorithmRegistry override returns "bsp"; downstream callers (settings' validate-default check, daemon's algorithm-fallback) should ask the registry rather than hard-coding the id.
Implemented in PhosphorTiles::AlgorithmRegistry.
|
pure virtual |
Whether an algorithm is registered under id.
Implemented in PhosphorTiles::AlgorithmRegistry.
|
pure virtualnoexcept |
The currently-configured preview parameters.
Implemented in PhosphorTiles::AlgorithmRegistry.
|
signal |
Preview parameters changed via setPreviewParams.
Preview caches (e.g. AutotileLayoutSource) invalidate on this so the next preview render picks up the new master-count / split-ratio / per-algorithm saved values.
|
pure virtual |
Register an algorithm under id.
Ownership transfers to the registry. Re-registering an existing id replaces the old algorithm; algorithmUnregistered(id, replacing=true) fires before algorithmRegistered(id).
Implemented in PhosphorTiles::AlgorithmRegistry.
|
pure virtual |
Apply the user-configured tiling parameters.
Emits previewParamsChanged when the stored value differs from the new one; AutotileLayoutSource reacts by invalidating its preview cache.
Implemented in PhosphorTiles::AlgorithmRegistry.
|
pure virtual |
Unregister and delete the algorithm with id.
Returns true when an algorithm was found and removed.
Implemented in PhosphorTiles::AlgorithmRegistry.