Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorControl::ModulePlaceholderPage Class Referenceabstract

The controller of a page that stands in for a control module's page while the module is not loaded. More...

#include <PhosphorControl/ModulePlaceholderPage.h>

Inheritance diagram for PhosphorControl::ModulePlaceholderPage:
[legend]

Signals

void moduleStateChanged ()
Signals inherited from PhosphorControl::StagingDomain
void dirtyChanged ()
void applyResult (bool ok, const QString &error)
 Async-completion signal — REQUIRED for use with ApplicationController::applyAllAsync.
void discardResult (bool ok, const QString &error)
 Companion to applyResult for discard() — separate signal so the chrome can wire distinct user-visible states.

Public Member Functions

 ModulePlaceholderPage (const QString &id, QObject *parent=nullptr)
 The module's display name.
 ~ModulePlaceholderPage () override
bool isDirty () const override
void apply () override
 Persist staged changes to the backing store.
void discard () override
 Drop staged changes; reload from the backing store.
virtual QString moduleName () const =0
virtual bool failed () const =0
virtual bool disabledAfterCrash () const =0
virtual QString reason () const =0
virtual bool canRetry () const =0
virtual void retry ()=0
 Load the module again, or for the first time when it is still available.
Public Member Functions inherited from PhosphorControl::PageController
 PageController (QString id, QObject *parent=nullptr)
 ~PageController () override
QString id () const
Public Member Functions inherited from PhosphorControl::StagingDomain
 StagingDomain (QObject *parent=nullptr)
 ~StagingDomain () override

Additional Inherited Members

Public Slots inherited from PhosphorControl::StagingDomain
virtual void resetToDefaults ()
 Load factory defaults into the staged area.

Detailed Description

The controller of a page that stands in for a control module's page while the module is not loaded.

ModuleHost registers one per placeholder, and ModulePage.qml, the page it shows (ModuleHost::placeholderPageSource), declares its controller as this type, so QML checks the members it reads.

Never dirty: apply() and discard() succeed at once, so a placeholder never holds up a batch. The module's state comes from the implementation, which emits moduleStateChanged() whenever any of failed, disabledAfterCrash, reason or canRetry may have changed.

Constructor & Destructor Documentation

◆ ModulePlaceholderPage()

PhosphorControl::ModulePlaceholderPage::ModulePlaceholderPage ( const QString & id,
QObject * parent = nullptr )
explicit

The module's display name.

The module failed: its library, its metadata or its registration. The module was turned off because the app stopped while it loaded. The host's diagnostic account of a failure. Not translated. Whether retry() can load the module now.

◆ ~ModulePlaceholderPage()

PhosphorControl::ModulePlaceholderPage::~ModulePlaceholderPage ( )
override

Member Function Documentation

◆ apply()

void PhosphorControl::ModulePlaceholderPage::apply ( )
overridevirtual

Persist staged changes to the backing store.

ApplicationController only invokes apply() on domains whose isDirty() returns true, so implementations may assume there is staged work to do. Must not rely on side effects ("stamp last-applied timestamp", "fire notification") that need to run even when clean.

Implements PhosphorControl::StagingDomain.

◆ canRetry()

virtual bool PhosphorControl::ModulePlaceholderPage::canRetry ( ) const
pure virtual

◆ disabledAfterCrash()

virtual bool PhosphorControl::ModulePlaceholderPage::disabledAfterCrash ( ) const
pure virtual

◆ discard()

void PhosphorControl::ModulePlaceholderPage::discard ( )
overridevirtual

Drop staged changes; reload from the backing store.

ApplicationController only invokes discard() on dirty domains — same side-effect-free contract as apply().

Implements PhosphorControl::StagingDomain.

◆ failed()

virtual bool PhosphorControl::ModulePlaceholderPage::failed ( ) const
pure virtual

◆ isDirty()

bool PhosphorControl::ModulePlaceholderPage::isDirty ( ) const
overridevirtual

◆ moduleName()

virtual QString PhosphorControl::ModulePlaceholderPage::moduleName ( ) const
pure virtual

◆ moduleStateChanged

void PhosphorControl::ModulePlaceholderPage::moduleStateChanged ( )
signal

◆ reason()

virtual QString PhosphorControl::ModulePlaceholderPage::reason ( ) const
pure virtual

◆ retry()

virtual void PhosphorControl::ModulePlaceholderPage::retry ( )
pure virtual

Load the module again, or for the first time when it is still available.


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