SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmmvis::GuiExtensionHost Class Referencefinal

#include <guiextensionhost.h>

Inheritance diagram for openswmmvis::GuiExtensionHost:
Collaboration diagram for openswmmvis::GuiExtensionHost:

Classes

struct  Job
 Host-owned job state shared between its worker and queued GUI continuations. More...
 

Signals

void aboutToShutdown ()
 Release model contributions before the loader calls plugin shutdown.
 
void eventOccurred (const QString &event, const QVariantMap &data)
 Notify observers on the GUI thread.
 
void typedEventOccurred (const OpenSWMM::Sdk::Event &event)
 Publish one canonical typed notification before its legacy projection.
 

Public Member Functions

 GuiExtensionHost (QString id, OpenSWMM::Sdk::CompatibilityManifest manifest, QMainWindow *window, QMdiArea *mdi, ExtensionUiBridge bridge, QSettings *settings, QObject *parent=nullptr, ExtensionStateRegistry *stateRegistry=nullptr)
 Construct one extension's namespaced implementation of host services.
 
 ~GuiExtensionHost () override
 Join workers, remove preferences/views/docks/tabs/actions, and release output widgets.
 
OpenSWMM::Sdk::CompatibilityManifest manifest () const override
 Inspect the running host build identity.
 
QString pluginId () const override
 Identify the extension owning this facade.
 
QObject * lifetime () const override
 Obtain a safe QObject context for actions and signal connections.
 
QList< OpenSWMM::Sdk::IProject * > projects () const override
 Enumerate open projects.
 
OpenSWMM::Sdk::IProject * activeProject () const override
 Resolve the active model project.
 
QList< OpenSWMM::Sdk::IModelInstance * > instances () const override
 Enumerate loaded models across projects.
 
OpenSWMM::Sdk::IModelInstance * activeInstance () const override
 Resolve the active loaded model.
 
OpenSWMM::Sdk::IUiHost * ui () override
 Access namespaced widget/action registration.
 
OpenSWMM::Sdk::ISettings * settings () override
 Access this extension user settings.
 
OpenSWMM::Sdk::IConsole * console () override
 Access this extension output channel.
 
QUuid beginProgress (const QString &title, QObject *context) override
 Begin an operation and immediately publish indeterminate shared progress.
 
bool updateProgress (const QUuid &operationId, double fraction, const QString &stage) override
 Update progress and its current human-readable stage.
 
bool finishProgress (const QUuid &operationId, OpenSWMM::Sdk::ProgressOutcome outcome, const QString &detail={}) override
 Remove an operation from shared progress and record its terminal outcome once.
 
OpenSWMM::Sdk::INetworkPolicy * network () override
 Access the host offline/HTTPS destination policy and shared client.
 
OpenSWMM::Sdk::IRunRegistry * runRegistry () override
 Access Simulation Status enumeration/start/cancel operations.
 
OpenSWMM::Sdk::IPlotService * plots () override
 Access the application's existing plot panels.
 
OpenSWMM::Sdk::IDialogs * dialogs () override
 Access registered built-in dialog commands.
 
QList< QVariantMap > runs () const override
 Copy current Simulation Status rows.
 
int start (OpenSWMM::Sdk::IModelInstance *instance, QString *error=nullptr) override
 Save and run an existing model using its configured engine/options.
 
void cancel (int id) override
 Request cancellation of one active run.
 
QList< QVariantMap > variables (OpenSWMM::Sdk::IModelInstance *instance, const QString &category) const override
 Enumerate plottable variables from the model's active 1D results.
 
bool timeSeries (OpenSWMM::Sdk::IModelInstance *instance, const QString &category, const QString &name, const QString &variableKey) override
 Add a result series to the shared time-series plot panel.
 
bool profile (OpenSWMM::Sdk::IModelInstance *instance, const QStringList &nodes) override
 Open the standard profile panel along connected named nodes.
 
QStringList ids () const override
 Enumerate currently registered built-in commands that open dialogs.
 
bool open (const QString &id) override
 Trigger a built-in dialog in the current application context.
 
bool isDark () const override
 Inspect resolved palette contrast.
 
QColor themeColor (QPalette::ColorRole role) const override
 Read an active host palette token.
 
QMetaObject::Connection observe (QObject *context, std::function< void(const QString &, const QVariantMap &)> callback) override
 Connect a synchronous GUI-thread listener to this extension's scoped event stream.
 
QMetaObject::Connection subscribe (QObject *context, const OpenSWMM::Sdk::EventFilter &filter, std::function< void(const OpenSWMM::Sdk::Event &)> callback) override
 Subscribe to typed SDK 1.2 notifications using a frozen optional interface.
 
OpenSWMM::Sdk::StateSnapshot stateSnapshot () const override
 Copy live session metadata and its atomic registry watermark.
 
OpenSWMM::Sdk::IJob * importTimeSeries (const OpenSWMM::Sdk::TimeSeriesImportRequest &request, QObject *context, std::function< void(const OpenSWMM::Sdk::TimeSeriesImportResult &)> finished, QString *error=nullptr) override
 Start a guarded native observation import through the installed application bridge.
 
QList< OpenSWMM::Sdk::TimeSeriesLayerInfo > timeSeriesLayers (const QUuid &sessionId) const override
 Query bounded native observation-layer metadata for one Ready session.
 
void setTimeSeriesControls (std::function< OpenSWMM::Sdk::IJob *(const OpenSWMM::Sdk::TimeSeriesImportRequest &, QObject *, std::function< void(const OpenSWMM::Sdk::TimeSeriesImportResult &)>, QString *)> importer, std::function< QList< OpenSWMM::Sdk::TimeSeriesLayerInfo >(const QUuid &)> layers)
 Install private native dataset routes before extension initialization.
 
QUuid previewLayer (const QUuid &sessionId, QList< qint64 > *featureIds=nullptr) const override
 Identify this extension's native preview layer in one Ready session.
 
void setPreviewLayers (std::function< QUuid(const QUuid &, QList< qint64 > *)> lookup)
 Install the private native preview-layer lookup before extension initialization.
 
void setJobCancellationHook (OpenSWMM::Sdk::IJob *job, std::function< void()> hook)
 Install a host-internal publication cancellation hook on a retained job.
 
bool isStopping () const
 Report shutdown or wrong-thread access before private bridges read GUI state.
 
OpenSWMM::Sdk::IModelInstance * resolveSession (const QUuid &sessionId) const override
 Resolve a ready session without creating a facade or emitting events.
 
QMetaObject::Connection observeState (QObject *context, const OpenSWMM::Sdk::StateEventFilter &filter, std::function< void(const OpenSWMM::Sdk::StateEvent &)> callback) override
 Observe queued lifecycle/state changes after this registration's watermark.
 
QMetaObject::Connection observeBeforeSave (QObject *context, std::function< void(const OpenSWMM::Sdk::SaveRequest &)> callback) override
 Collect plugin state synchronously before an accepted save writes it.
 
OpenSWMM::Sdk::ViewSnapshot viewSnapshot (const QUuid &sessionId) const override
 Copy tracked native view metadata without creating trackers or facades.
 
QMetaObject::Connection observeViews (QObject *context, const OpenSWMM::Sdk::ViewEventFilter &filter, std::function< void(const OpenSWMM::Sdk::ViewEvent &)> callback) override
 Observe future IViewEvents domain invalidations on the ordered shared dispatcher.
 
bool executeViewCommand (const OpenSWMM::Sdk::ViewCommand &command, QString *error=nullptr) override
 Apply a validated view controller command.
 
QList< qint64 > selectedLayerFeatures (const QUuid &sessionId, const QUuid &layerSessionId, int offset=0, int limit=500) const override
 Copy a bounded sorted page of selected vector FIDs.
 
OpenSWMM::Sdk::ActivitySnapshot activitySnapshot () const override
 Copy retained process and scoped UI state without native mutation.
 
QMetaObject::Connection observeActivity (QObject *context, const OpenSWMM::Sdk::ActivityEventFilter &filter, std::function< void(const OpenSWMM::Sdk::ActivityEvent &)> callback) override
 Subscribe to future scoped activity metadata on the shared ordered dispatcher.
 
QUuid startRunAttempt (const QUuid &sessionId, quint64 loadGeneration, QString *error=nullptr) override
 Start an exact Ready model generation via the native run controller.
 
QUuid jobOperationId (OpenSWMM::Sdk::IJob *job) const override
 Resolve an own retained IJob handle without dereferencing foreign pointers.
 
bool cancelOperation (const QUuid &operationId, QString *error=nullptr) override
 Cancel an exact shared run or this host's own worker.
 
bool executeActivityUiCommand (const OpenSWMM::Sdk::UiActivityCommand &command, QString *error=nullptr) override
 Validate current runtime UI identities and use scoped native routes.
 
QUuid activityOwnerId () const
 Read the stable per-host lifetime used for private activity scope.
 
QUuid activityWindowId () const
 Read the main-window lifetime established at host construction.
 
OpenSWMM::Sdk::IJob * runJob (const QString &title, std::function< void(OpenSWMM::Sdk::IJobContext &)> work, std::function< void(bool, const QString &)> finished={}) override
 Start one worker, retaining its handle and progress UI until host cleanup.
 
void prepareShutdown () override
 Cancel and join extension workers before plugin-owned resources are released.
 
QVariant value (const QString &key, const QVariant &fallback={}) const override
 Read a key beneath extensions/<pluginId>/.
 
void setValue (const QString &key, const QVariant &value) override
 Persist a nonempty relative key and announce settingsChanged.
 
void remove (const QString &key) override
 Remove a relative key or subgroup within this extension's settings.
 
QStringList keys () const override
 List this extension's stored settings without the host prefix.
 
void append (const QString &level, const QString &text) override
 Append literal text to this extension's bounded Output and native timestamped Logs.
 
void clear () override
 Clear only this extension's Output history; native Logs history is retained.
 
void appendLocation (const QString &level, const QString &text, const QString &path, int line) override
 Append literal output associated with a source file location.
 
void setLocationHandler (QObject *context, std::function< void(const QString &, int)> handler) override
 Register a guarded source-location callback for this output channel.
 
bool registerAction (const QString &id, QAction *action) override
 Register an extension command in the host command palette and shortcut context.
 
void unregisterAction (const QString &id) override
 Remove a command without deleting its QAction.
 
bool registerRibbonTab (const OpenSWMM::Sdk::RibbonTabSpec &tab) override
 Register an independent, dynamically removable extension-owned ribbon tab.
 
void unregisterRibbonTab (const QString &id) override
 Remove only this contribution and its host-owned toolbars.
 
bool registerDockPanelFactory (OpenSWMM::Sdk::IDockPanelFactory *factory) override
 Instantiate and mount a dock with View-menu and layout persistence.
 
void unregisterDockPanelFactory (const QString &id) override
 Destroy a registered dock and its widget.
 
bool registerDocumentViewFactory (OpenSWMM::Sdk::IDocumentViewFactory *factory) override
 Register a borrowed document factory and materialize pending project views.
 
void unregisterDocumentViewFactory (const QString &kind) override
 Close all views of this kind before releasing its factory.
 
QWidget * openDocumentView (const QString &kind, OpenSWMM::Sdk::IModelInstance *instance) override
 Create and show one host-owned MDI document.
 
bool registerPreferencesPage (OpenSWMM::Sdk::IPreferencesPageFactory *factory) override
 Add a preferences factory to the Extensions section of future Preferences dialogs.
 
void unregisterPreferencesPage (const QString &id) override
 Remove a preferences factory and its live page before resource teardown.
 
void showDock (const QString &id) override
 Reveal and raise a registered dock.
 
void statusMessage (const QString &text, int milliseconds=5000) override
 Display transient status-bar text.
 
void message (const QString &title, const QString &text) override
 Present an informational dialog on the GUI thread.
 
void postToMainThread (std::function< void()> callback) override
 Queue a callback onto the GUI thread from any worker.
 
QWidget * mainWindow () const override
 Obtain the main window for widget parenting.
 
void setModelAccess (std::function< QList< OpenSWMM::Sdk::IProject * >()> projects, std::function< OpenSWMM::Sdk::IModelInstance *()> active)
 Install GUI-thread model enumeration adapters before initialize() runs.
 
void setSessionResolver (std::function< OpenSWMM::Sdk::IModelInstance *(const QUuid &)> resolver)
 Install a lookup-only per-session facade resolver during host setup.
 
ExtensionStateRegistry * stateRegistry () const
 Access the application registry used by this host's private model bridge.
 
void setViewControls (std::function< bool(const OpenSWMM::Sdk::ViewCommand &, QString *)> execute, std::function< QList< qint64 >(const QUuid &, const QUuid &, int, int)> selection)
 Install private native view-controller routes during host setup.
 
void notify (const QString &event, const QVariantMap &data={})
 Deliver an owning metadata notification to extension observers.
 
void restoreViews (OpenSWMM::Sdk::IModelInstance *instance, const QJsonArray &views)
 Restore this plugin's known views and retain unavailable kinds as pending.
 
QJsonArray saveViews (OpenSWMM::Sdk::IModelInstance *instance) const
 Capture live and pending view state for one model.
 
- Public Member Functions inherited from OpenSWMM::Sdk::ExtensionHost
virtual ~ExtensionHost ()=default
 Join outstanding jobs and destroy host-owned contributions during teardown.
 
virtual QMetaObject::Connection observe (QObject *context, std::function< void(const QString &event, const QVariantMap &data)> callback)=0
 Subscribe to scoped host notifications.
 
virtual IJob * runJob (const QString &title, std::function< void(IJobContext &)> work, std::function< void(bool ok, const QString &error)> finished={})=0
 Run cancellable extension work on the extension's bounded thread pool.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IUiHost
virtual ~IUiHost ()=default
 Destroy UI service implementation; extensions borrow this facade.
 
- Public Member Functions inherited from OpenSWMM::Sdk::ISettings
virtual ~ISettings ()=default
 Release an implementation; extensions borrow and never delete the host facade.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IConsole
virtual ~IConsole ()=default
 Destroy a console implementation; the host owns the public facade.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IRunRegistry
virtual ~IRunRegistry ()=default
 Destroy an implementation; extensions borrow this host-owned service.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IPlotService
virtual ~IPlotService ()=default
 Destroy an implementation; extensions borrow this host-owned service.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IDialogs
virtual ~IDialogs ()=default
 Destroy an implementation; extensions borrow this host-owned service.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IModelEvents
virtual ~IModelEvents ()=default
 Destroy an implementation; plugins borrow the host-owned service.
 
virtual QMetaObject::Connection subscribe (QObject *context, const EventFilter &filter, std::function< void(const Event &)> callback)=0
 Subscribe to filtered typed observations on the GUI thread.
 
- Public Member Functions inherited from OpenSWMM::Sdk::ISessionEvents
virtual ~ISessionEvents ()=default
 Destroy an implementation; callers borrow the host-owned capability.
 
virtual QMetaObject::Connection observeState (QObject *context, const StateEventFilter &filter, std::function< void(const StateEvent &)> callback)=0
 Observe future queued state transitions with GUI-thread lifetime guards.
 
virtual QMetaObject::Connection observeBeforeSave (QObject *context, std::function< void(const SaveRequest &)> callback)=0
 Register a short synchronous pre-save state collector.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IViewEvents
virtual ~IViewEvents ()=default
 Destroy an implementation; consumers borrow the host-owned capability.
 
virtual QMetaObject::Connection observeViews (QObject *context, const ViewEventFilter &filter, std::function< void(const ViewEvent &)> callback)=0
 Observe future queued invalidations on the GUI thread.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IViewControls
virtual ~IViewControls ()=default
 Destroy an implementation; consumers borrow the host-owned service.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IActivityEvents
virtual ~IActivityEvents ()=default
 Destroy an implementation; consumers borrow the host-owned capability.
 
virtual QMetaObject::Connection observeActivity (QObject *context, const ActivityEventFilter &filter, std::function< void(const ActivityEvent &)> callback)=0
 Observe future queued scoped transitions with managed lifetime/thread guards.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IActivityControls
virtual ~IActivityControls ()=default
 Destroy an implementation; consumers borrow the host-owned capability.
 
- Public Member Functions inherited from OpenSWMM::Sdk::ITimeSeriesLayers
virtual ~ITimeSeriesLayers ()=default
 Destroy an implementation; plugins only borrow this capability.
 
virtual IJob * importTimeSeries (const TimeSeriesImportRequest &request, QObject *context, std::function< void(const TimeSeriesImportResult &)> finished, QString *error=nullptr)=0
 Prepare and attach a native dataset through a cancellable host job.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IProgress
virtual ~IProgress ()=default
 Destroy an implementation; plugins only borrow the host capability.
 
- Public Member Functions inherited from OpenSWMM::Sdk::IPreviewLayers
virtual ~IPreviewLayers ()=default
 Destroy an implementation; plugins only borrow the host capability.
 

Protected Member Functions

bool eventFilter (QObject *object, QEvent *event) override
 Publish theme changes and activate output source locations.
 

Detailed Description

Per-extension facade: ownership and IDs cannot cross another extension's namespace.

Constructor & Destructor Documentation

◆ GuiExtensionHost()

openswmmvis::GuiExtensionHost::GuiExtensionHost ( QString  id,
OpenSWMM::Sdk::CompatibilityManifest  manifest,
QMainWindow *  window,
QMdiArea *  mdi,
ExtensionUiBridge  bridge,
QSettings *  settings,
QObject *  parent = nullptr,
ExtensionStateRegistry *  stateRegistry = nullptr 
)

Construct one extension's namespaced implementation of host services.

Parameters
[in]idValidated extension identity.
[in]manifestHost build compatibility identity.
[in]windowBorrowed main window, kept alive through host shutdown.
[in]mdiBorrowed MDI area for extension document widgets.
[in]bridgeApplication action/ribbon callbacks; values captured by ownership.
[in]settingsRequired borrowed host settings, outliving this host.
[in]parentOptional QObject owner; the manager normally owns the host by unique_ptr.
[in]stateRegistryBorrowed authoritative registry, or null for the application registry.
Here is the call graph for this function:

◆ ~GuiExtensionHost()

openswmmvis::GuiExtensionHost::~GuiExtensionHost ( )
override

Join workers, remove preferences/views/docks/tabs/actions, and release output widgets.

Here is the call graph for this function:

Member Function Documentation

◆ aboutToShutdown

void openswmmvis::GuiExtensionHost::aboutToShutdown ( )
signal

Release model contributions before the loader calls plugin shutdown.

Here is the caller graph for this function:

◆ activeInstance()

IModelInstance * openswmmvis::GuiExtensionHost::activeInstance ( ) const
overridevirtual

Resolve the active loaded model.

Returns
Borrowed facade, or null when no model is active.

Implements OpenSWMM::Sdk::ExtensionHost.

Here is the caller graph for this function:

◆ activeProject()

IProject * openswmmvis::GuiExtensionHost::activeProject ( ) const
overridevirtual

Resolve the active model project.

Returns
Borrowed facade, or null when no model is active.

Implements OpenSWMM::Sdk::ExtensionHost.

Here is the call graph for this function:

◆ activityOwnerId()

QUuid openswmmvis::GuiExtensionHost::activityOwnerId ( ) const
inline

Read the stable per-host lifetime used for private activity scope.

Returns
Runtime owner UUID, independent of the configured plugin ID.

◆ activitySnapshot()

ActivitySnapshot openswmmvis::GuiExtensionHost::activitySnapshot ( ) const
overridevirtual

Copy retained process and scoped UI state without native mutation.

Returns
Owning snapshot, empty on the wrong thread/after host stop.

Implements OpenSWMM::Sdk::IActivityEvents.

◆ activityWindowId()

QUuid openswmmvis::GuiExtensionHost::activityWindowId ( ) const
inline

Read the main-window lifetime established at host construction.

Returns
Runtime window UUID, null without a main window.

◆ append()

void openswmmvis::GuiExtensionHost::append ( const QString &  level,
const QString &  text 
)
overridevirtual

Append literal text to this extension's bounded Output and native timestamped Logs.

Parameters
[in]levelCase-insensitive severity: warning/warn, error, or information for all other values, including info.
[in]textPlain text; never interpreted as HTML or executable content.
Note
Thread-safe entry point: worker calls are queued to the GUI thread. Native Logs adds the plugin identity; the extension should supply its message without that prefix.

Implements OpenSWMM::Sdk::IConsole.

Here is the caller graph for this function:

◆ appendLocation()

void openswmmvis::GuiExtensionHost::appendLocation ( const QString &  level,
const QString &  text,
const QString &  path,
int  line 
)
overridevirtual

Append literal output associated with a source file location.

Parameters
[in]levelDisplay severity, as for append().
[in]textLiteral output; every appended line receives the location.
[in]pathSource path passed verbatim to the location handler, without opening a file.
[in]lineOne-based source line; nonpositive lines or empty paths produce ordinary text.
Note
Thread-safe like append(). Double-click a located line to activate it. Available since SDK 1.1.

Implements OpenSWMM::Sdk::IConsole.

◆ beginProgress()

QUuid openswmmvis::GuiExtensionHost::beginProgress ( const QString &  title,
QObject *  context 
)
overridevirtual

Begin an operation and immediately publish indeterminate shared progress.

Parameters
[in]titleNonempty user-facing title; the host adds the plugin identity.
[in]contextRequired GUI-thread lifetime guard, kept on the GUI thread.
Returns
Unique per-host operation UUID, or null for an empty title, invalid context, wrong-thread call, stopping host, or operation released during synchronous publication.
Note
Context destruction releases only its outstanding operations as cancelled. Native statusbar/log publication is synchronous and may reenter application code.

Implements OpenSWMM::Sdk::IProgress.

◆ cancel()

void openswmmvis::GuiExtensionHost::cancel ( int  id)
overridevirtual

Request cancellation of one active run.

Parameters
[in]idStable Simulation Status job ID; unknown/finished IDs are ignored.

Implements OpenSWMM::Sdk::IRunRegistry.

◆ cancelOperation()

bool openswmmvis::GuiExtensionHost::cancelOperation ( const QUuid &  operationId,
QString *  error = nullptr 
)
overridevirtual

Cancel an exact shared run or this host's own worker.

Parameters
[in]operationIdUnique retained attempt.
[out]errorOptional refusal detail.
Returns
True for accepted/idempotent active cancellation.

Implements OpenSWMM::Sdk::IActivityControls.

◆ clear()

void openswmmvis::GuiExtensionHost::clear ( )
overridevirtual

Clear only this extension's Output history; native Logs history is retained.

Note
GUI thread only.

Implements OpenSWMM::Sdk::IConsole.

◆ console()

OpenSWMM::Sdk::IConsole * openswmmvis::GuiExtensionHost::console ( )
inlineoverridevirtual

Access this extension output channel.

Returns
Borrowed console with thread-safe append().

Implements OpenSWMM::Sdk::ExtensionHost.

◆ dialogs()

OpenSWMM::Sdk::IDialogs * openswmmvis::GuiExtensionHost::dialogs ( )
inlineoverridevirtual

Access registered built-in dialog commands.

Returns
Borrowed GUI-thread service.

Implements OpenSWMM::Sdk::ExtensionHost.

◆ eventFilter()

bool openswmmvis::GuiExtensionHost::eventFilter ( QObject *  object,
QEvent *  event 
)
overrideprotected

Publish theme changes and activate output source locations.

Parameters
[in]objectWatched window or output viewport.
[in]eventBorrowed Qt event; located output double-clicks invoke the guarded handler.
Returns
True for a handled output location; otherwise QObject's event-filter result.
Here is the call graph for this function:

◆ eventOccurred

void openswmmvis::GuiExtensionHost::eventOccurred ( const QString &  event,
const QVariantMap &  data 
)
signal

Notify observers on the GUI thread.

Parameters
[in]eventSDK event name.
[in]dataOwning metadata map.
Here is the caller graph for this function:

◆ executeActivityUiCommand()

bool openswmmvis::GuiExtensionHost::executeActivityUiCommand ( const OpenSWMM::Sdk::UiActivityCommand &  command,
QString *  error = nullptr 
)
overridevirtual

Validate current runtime UI identities and use scoped native routes.

Parameters
[in]commandCopied window/target/action request.
[out]errorOptional refusal detail.
Returns
True for accepted/no-op, false when stale/foreign/unavailable.

Implements OpenSWMM::Sdk::IActivityControls.

◆ executeViewCommand()

bool openswmmvis::GuiExtensionHost::executeViewCommand ( const OpenSWMM::Sdk::ViewCommand &  command,
QString *  error = nullptr 
)
overridevirtual

Apply a validated view controller command.

Parameters
[in]commandOwning request targeting a Ready session and current attachment.
[out]errorOptional refusal detail, cleared on success.
Returns
True for an accepted command/no-op.

Implements OpenSWMM::Sdk::IViewControls.

◆ finishProgress()

bool openswmmvis::GuiExtensionHost::finishProgress ( const QUuid &  operationId,
OpenSWMM::Sdk::ProgressOutcome  outcome,
const QString &  detail = {} 
)
overridevirtual

Remove an operation from shared progress and record its terminal outcome once.

Parameters
[in]operationIdActive UUID issued by this exact host.
[in]outcomeSuccessful, failed or cancelled; invalid enum values are rejected.
[in]detailOptional literal terminal explanation, appended to the log entry.
Returns
True when finished, false for invalid, foreign or finished IDs, unavailable/moved contexts, wrong-thread calls, invalid outcomes or a stopping host.
Note
Host shutdown releases all outstanding native progress without further plugin callbacks or log messages. Finishing one operation never clears another operation.

Implements OpenSWMM::Sdk::IProgress.

◆ ids()

QStringList openswmmvis::GuiExtensionHost::ids ( ) const
overridevirtual

Enumerate currently registered built-in commands that open dialogs.

Returns
Stable ActionRegistry identities whose user-facing action advertises a dialog.

Implements OpenSWMM::Sdk::IDialogs.

◆ importTimeSeries()

IJob * openswmmvis::GuiExtensionHost::importTimeSeries ( const OpenSWMM::Sdk::TimeSeriesImportRequest &  request,
QObject *  context,
std::function< void(const OpenSWMM::Sdk::TimeSeriesImportResult &)>  finished,
QString *  error = nullptr 
)
override

Start a guarded native observation import through the installed application bridge.

Parameters
[in]requestExact session/generation and completed local asset paths.
[in]contextRequired GUI-thread receiver lifetime.
[in]finishedManaged terminal receiver suppressed during shutdown.
[out]errorImmediate refusal detail, cleared on acceptance.
Returns
Borrowed cancellable worker handle, null for an invalid/unavailable request.

◆ instances()

QList< IModelInstance * > openswmmvis::GuiExtensionHost::instances ( ) const
overridevirtual

Enumerate loaded models across projects.

Returns
Borrowed facades; query isOpen() before later reuse.

Implements OpenSWMM::Sdk::ExtensionHost.

Here is the call graph for this function:

◆ isDark()

bool openswmmvis::GuiExtensionHost::isDark ( ) const
overridevirtual

Inspect resolved palette contrast.

Returns
True for a dark window background.

Implements OpenSWMM::Sdk::ExtensionHost.

Here is the call graph for this function:

◆ isStopping()

bool openswmmvis::GuiExtensionHost::isStopping ( ) const

Report shutdown or wrong-thread access before private bridges read GUI state.

Returns
True outside the host thread or once shutdown begins.

◆ jobOperationId()

QUuid openswmmvis::GuiExtensionHost::jobOperationId ( OpenSWMM::Sdk::IJob *  job) const
overridevirtual

Resolve an own retained IJob handle without dereferencing foreign pointers.

Parameters
[in]jobBorrowed handle from this host's runJob().
Returns
Unique job UUID, or null.

Implements OpenSWMM::Sdk::IActivityControls.

◆ keys()

QStringList openswmmvis::GuiExtensionHost::keys ( ) const
overridevirtual

List this extension's stored settings without the host prefix.

Returns
Owning relative keys, including nested groups.

Implements OpenSWMM::Sdk::ISettings.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lifetime()

QObject * openswmmvis::GuiExtensionHost::lifetime ( ) const
inlineoverridevirtual

Obtain a safe QObject context for actions and signal connections.

Returns
Borrowed host QObject; do not delete or reparent it.
Note
SDK 1.2 supports qobject_cast to IModelEvents; SDK 1.3 adds ISessionEvents for authoritative lifecycle/state snapshots. SDK 1.4 also supports IViewEvents and IViewControls for typed view observations and validated native controller commands. Private host classes and arbitrary slots remain implementation details. SDK 1.5 adds IActivityEvents and IActivityControls for process attempts and scoped UI activity.

Implements OpenSWMM::Sdk::ExtensionHost.

◆ mainWindow()

QWidget * openswmmvis::GuiExtensionHost::mainWindow ( ) const
inlineoverridevirtual

Obtain the main window for widget parenting.

Returns
Borrowed QWidget or null during teardown; never delete it.

Implements OpenSWMM::Sdk::IUiHost.

Here is the caller graph for this function:

◆ manifest()

OpenSWMM::Sdk::CompatibilityManifest openswmmvis::GuiExtensionHost::manifest ( ) const
inlineoverridevirtual

Inspect the running host build identity.

Returns
Owning manifest matching the installed SDK package.

Implements OpenSWMM::Sdk::ExtensionHost.

◆ message()

void openswmmvis::GuiExtensionHost::message ( const QString &  title,
const QString &  text 
)
overridevirtual

Present an informational dialog on the GUI thread.

Parameters
[in]titleDialog caption.
[in]textUser-facing message; avoid invoking nested dialogs during an edit scope.

Implements OpenSWMM::Sdk::IUiHost.

◆ network()

INetworkPolicy * openswmmvis::GuiExtensionHost::network ( )
overridevirtual

Access the host offline/HTTPS destination policy and shared client.

Returns
Borrowed GUI-thread network service; use it for preview metadata and payload transfers.

Implements OpenSWMM::Sdk::ExtensionHost.

◆ notify()

void openswmmvis::GuiExtensionHost::notify ( const QString &  event,
const QVariantMap &  data = {} 
)

Deliver an owning metadata notification to extension observers.

Parameters
[in]eventSDK event name.
[in]dataCopied metadata; model events contain a persistent id.
Note
GUI-thread publication only; off-thread calls and calls after shutdown begins are ignored.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ observe()

QMetaObject::Connection openswmmvis::GuiExtensionHost::observe ( QObject *  context,
std::function< void(const QString &, const QVariantMap &)>  callback 
)
override

Connect a synchronous GUI-thread listener to this extension's scoped event stream.

Parameters
[in]contextRequired GUI-thread QObject lifetime guard, automatically disconnecting on destruction.
[in]callbackOwning receiver of the event name and copied metadata.
Returns
Qt connection for optional early disconnect; invalid for an empty callback, null or off-thread context, off-thread registration, or a stopping host.
Note
Moving the context to another thread is unsupported and suppresses delivery there. Shutdown suppresses all subsequent delivery. Observer exceptions are logged and isolated.
Here is the call graph for this function:

◆ observeActivity()

QMetaObject::Connection openswmmvis::GuiExtensionHost::observeActivity ( QObject *  context,
const OpenSWMM::Sdk::ActivityEventFilter &  filter,
std::function< void(const OpenSWMM::Sdk::ActivityEvent &)>  callback 
)
override

Subscribe to future scoped activity metadata on the shared ordered dispatcher.

Parameters
[in]contextRequired GUI-thread receiver lifetime.
[in]filterCopied reason/attempt/session filter.
[in]callbackShort managed exception-isolated observer.
Returns
Disconnectable handle, invalid for unavailable registration.
Here is the call graph for this function:

◆ observeBeforeSave()

QMetaObject::Connection openswmmvis::GuiExtensionHost::observeBeforeSave ( QObject *  context,
std::function< void(const OpenSWMM::Sdk::SaveRequest &)>  callback 
)
override

Collect plugin state synchronously before an accepted save writes it.

Parameters
[in]contextRequired GUI-thread lifetime guard.
[in]callbackShort non-vetoing collector; must not start writes/runs or nested event loops.
Returns
Disconnectable handle, or invalid for unavailable context/callback/host.
Here is the call graph for this function:

◆ observeState()

QMetaObject::Connection openswmmvis::GuiExtensionHost::observeState ( QObject *  context,
const OpenSWMM::Sdk::StateEventFilter &  filter,
std::function< void(const OpenSWMM::Sdk::StateEvent &)>  callback 
)
override

Observe queued lifecycle/state changes after this registration's watermark.

Parameters
[in]contextRequired GUI-thread lifetime guard.
[in]filterCopied kind/session selection.
[in]callbackGUI-thread observer; each delivery rechecks session generation/lifetime.
Returns
Disconnectable handle, or invalid for an unavailable context/callback/host.
Here is the call graph for this function:

◆ observeViews()

QMetaObject::Connection openswmmvis::GuiExtensionHost::observeViews ( QObject *  context,
const OpenSWMM::Sdk::ViewEventFilter &  filter,
std::function< void(const OpenSWMM::Sdk::ViewEvent &)>  callback 
)
override

Observe future IViewEvents domain invalidations on the ordered shared dispatcher.

Parameters
[in]contextRequired GUI-thread lifetime guard.
[in]filterCopied reason/session/attachment filter.
[in]callbackManaged exception-isolated observer.
Returns
Disconnectable handle, or invalid for an unavailable registration.
Here is the call graph for this function:

◆ open()

bool openswmmvis::GuiExtensionHost::open ( const QString &  id)
overridevirtual

Trigger a built-in dialog in the current application context.

Parameters
[in]idIdentity returned by ids(); extension commands are excluded.
Returns
False if unavailable/disabled/unknown; true after triggering the normal action.

Implements OpenSWMM::Sdk::IDialogs.

◆ openDocumentView()

QWidget * openswmmvis::GuiExtensionHost::openDocumentView ( const QString &  kind,
OpenSWMM::Sdk::IModelInstance *  instance 
)
overridevirtual

Create and show one host-owned MDI document.

Parameters
[in]kindPreviously registered extension-local document kind.
[in]instanceBorrowed live model, or null if the factory supports model-independent views.
Returns
Borrowed widget or null on unavailable/unsupported context; model closure destroys its views.

Implements OpenSWMM::Sdk::IUiHost.

Here is the call graph for this function:

◆ plots()

OpenSWMM::Sdk::IPlotService * openswmmvis::GuiExtensionHost::plots ( )
inlineoverridevirtual

Access the application's existing plot panels.

Returns
Borrowed GUI-thread service.

Implements OpenSWMM::Sdk::ExtensionHost.

◆ pluginId()

QString openswmmvis::GuiExtensionHost::pluginId ( ) const
inlineoverridevirtual

Identify the extension owning this facade.

Returns
The validated plugin.json id.

Implements OpenSWMM::Sdk::ExtensionHost.

Here is the caller graph for this function:

◆ postToMainThread()

void openswmmvis::GuiExtensionHost::postToMainThread ( std::function< void()>  callback)
overridevirtual

Queue a callback onto the GUI thread from any worker.

Parameters
[in]callbackOwning function, suppressed if host shutdown has started.
Note
Capture copied data or QPointer guards, rather than raw short-lived widgets.

Implements OpenSWMM::Sdk::IUiHost.

Here is the caller graph for this function:

◆ prepareShutdown()

void openswmmvis::GuiExtensionHost::prepareShutdown ( )
overridevirtual

Cancel and join extension workers before plugin-owned resources are released.

Cancel and join jobs before shutdown destroys extension-owned resources.

Note
GUI-thread, idempotent, potentially blocking until cooperative jobs return. Pending GUI continuations are suppressed. The loader calls this before IGuiExtension::shutdown().

Implements OpenSWMM::Sdk::ExtensionHost.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ previewLayer()

QUuid openswmmvis::GuiExtensionHost::previewLayer ( const QUuid &  sessionId,
QList< qint64 > *  featureIds = nullptr 
) const
overridevirtual

Identify this extension's native preview layer in one Ready session.

Parameters
[in]sessionIdReady per-open identity.
[out]featureIdsOptional destination, replaced with native FIDs in the feature order of the accepted showPreview() collection; empty when unavailable.
Returns
Runtime attachment UUID usable with IViewControls and IViewEvents, or null without an attached native preview (none shown, scene-only preview, manually removed, cleared, closed, wrong thread or host stopping).
Note
FIDs belong to that exact attachment. A changed collection creates a new attachment with new FIDs; never retain them as durable feature associations.

Implements OpenSWMM::Sdk::IPreviewLayers.

◆ profile()

bool openswmmvis::GuiExtensionHost::profile ( OpenSWMM::Sdk::IModelInstance *  instance,
const QStringList &  nodeNames 
)
overridevirtual

Open the standard profile panel along connected named nodes.

Parameters
[in]instanceBorrowed live model; result overlays follow its active results.
[in]nodeNamesAt least two ordered connected node IDs; each adjacent pair must have a link.
Returns
False if a node/link is missing or no supported model is available.

Implements OpenSWMM::Sdk::IPlotService.

◆ projects()

QList< IProject * > openswmmvis::GuiExtensionHost::projects ( ) const
overridevirtual

Enumerate open projects.

Returns
Borrowed host-owned project facades, excluding closed instances.

Implements OpenSWMM::Sdk::ExtensionHost.

Here is the caller graph for this function:

◆ registerAction()

bool openswmmvis::GuiExtensionHost::registerAction ( const QString &  id,
QAction *  action 
)
overridevirtual

Register an extension command in the host command palette and shortcut context.

Parameters
[in]idNonempty extension-local command ID.
[in]actionBorrowed QAction; parent it to ExtensionHost::lifetime() for host ownership.
Returns
False for null action, duplicate ID or an unavailable main window.
Note
Icons are supported through QAction::setIcon(). Bundle SVG/PNG resources in the plugin's .qrc and pass it to openswmmvis_add_extension() SOURCES. Set QAction::setIconVisibleInMenu(true) when menu icons are desired; native menu policy applies. Update the action icon when its palette-dependent rendering changes.

Implements OpenSWMM::Sdk::IUiHost.

◆ registerDockPanelFactory()

bool openswmmvis::GuiExtensionHost::registerDockPanelFactory ( OpenSWMM::Sdk::IDockPanelFactory *  factory)
overridevirtual

Instantiate and mount a dock with View-menu and layout persistence.

Parameters
[in]factoryBorrowed factory during this call; returned widget becomes host-owned.
Returns
False for null/duplicate IDs, missing main window or failed widget creation.

Implements OpenSWMM::Sdk::IUiHost.

Here is the call graph for this function:

◆ registerDocumentViewFactory()

bool openswmmvis::GuiExtensionHost::registerDocumentViewFactory ( OpenSWMM::Sdk::IDocumentViewFactory *  factory)
overridevirtual

Register a borrowed document factory and materialize pending project views.

Parameters
[in]factoryMust remain alive until unregistered.
Returns
False for null, empty or duplicate kind.

Implements OpenSWMM::Sdk::IUiHost.

Here is the call graph for this function:

◆ registerPreferencesPage()

bool openswmmvis::GuiExtensionHost::registerPreferencesPage ( OpenSWMM::Sdk::IPreferencesPageFactory *  factory)
overridevirtual

Add a preferences factory to the Extensions section of future Preferences dialogs.

Parameters
[in]factoryBorrowed until unregistered.
Returns
False for null or duplicate ID.

Implements OpenSWMM::Sdk::IUiHost.

Here is the call graph for this function:

◆ registerRibbonTab()

bool openswmmvis::GuiExtensionHost::registerRibbonTab ( const OpenSWMM::Sdk::RibbonTabSpec &  tab)
overridevirtual

Register an independent, dynamically removable extension-owned ribbon tab.

Parameters
[in]tabData-described tab; every action ID must already be registered by this extension. Register multiple distinct local tab IDs to create multiple tabs; the host scopes each ID to this extension.
Returns
False for duplicate/empty IDs, unknown actions or an unavailable toolbar bridge.

Implements OpenSWMM::Sdk::IUiHost.

◆ remove()

void openswmmvis::GuiExtensionHost::remove ( const QString &  key)
overridevirtual

Remove a relative key or subgroup within this extension's settings.

Parameters
[in]keyNonempty relative key; invalid and empty values are ignored.

Implements OpenSWMM::Sdk::ISettings.

Here is the call graph for this function:

◆ resolveSession()

IModelInstance * openswmmvis::GuiExtensionHost::resolveSession ( const QUuid &  sessionId) const
overridevirtual

Resolve a ready session without creating a facade or emitting events.

Parameters
[in]sessionIdPer-open session identity, independent of the saved instance UUID.
Returns
Borrowed live facade, or null for unavailable/unready/retired sessions.

Implements OpenSWMM::Sdk::ISessionEvents.

◆ restoreViews()

void openswmmvis::GuiExtensionHost::restoreViews ( OpenSWMM::Sdk::IModelInstance *  instance,
const QJsonArray &  views 
)

Restore this plugin's known views and retain unavailable kinds as pending.

Parameters
[in]instanceBorrowed stable model facade.
[in]viewsSaved project view entries from every extension; foreign prefixes are ignored.

◆ runJob()

IJob * openswmmvis::GuiExtensionHost::runJob ( const QString &  title,
std::function< void(OpenSWMM::Sdk::IJobContext &)>  work,
std::function< void(bool, const QString &)>  finished = {} 
)
override

Start one worker, retaining its handle and progress UI until host cleanup.

Parameters
[in]titleUser-visible stage caption and durable operation-marker description.
[in]workWorker-only operation; it must cooperate with cancellation.
[in]finishedOptional GUI-thread receiver of worker status and exception text.
Returns
Borrowed job handle, or null if the host is stopping or work is empty.

◆ runRegistry()

OpenSWMM::Sdk::IRunRegistry * openswmmvis::GuiExtensionHost::runRegistry ( )
inlineoverridevirtual

Access Simulation Status enumeration/start/cancel operations.

Returns
Borrowed GUI-thread service.

Implements OpenSWMM::Sdk::ExtensionHost.

◆ runs()

QList< QVariantMap > openswmmvis::GuiExtensionHost::runs ( ) const
overridevirtual

Copy current Simulation Status rows.

Returns
Maps containing id, name, inputPath, engineVersion, status, progress, start/end, errorCode, error, warnings and available continuity percentages.

Implements OpenSWMM::Sdk::IRunRegistry.

◆ saveViews()

QJsonArray openswmmvis::GuiExtensionHost::saveViews ( OpenSWMM::Sdk::IModelInstance *  instance) const

Capture live and pending view state for one model.

Parameters
[in]instanceBorrowed model facade whose views should be saved.
Returns
Owning JSON entries containing fully qualified kind and factory state.

◆ selectedLayerFeatures()

QList< qint64 > openswmmvis::GuiExtensionHost::selectedLayerFeatures ( const QUuid &  sessionId,
const QUuid &  layerSessionId,
int  offset = 0,
int  limit = 500 
) const
overridevirtual

Copy a bounded sorted page of selected vector FIDs.

Parameters
[in]sessionIdReady model lifetime.
[in]layerSessionIdCurrent runtime attachment UUID.
[in]offsetNonnegative sorted-result offset.
[in]limitPositive requested count, capped at 5000.
Returns
Copied selected identities, or empty on invalid/unavailable input.

Implements OpenSWMM::Sdk::IViewControls.

◆ setJobCancellationHook()

void openswmmvis::GuiExtensionHost::setJobCancellationHook ( OpenSWMM::Sdk::IJob *  job,
std::function< void()>  hook 
)

Install a host-internal publication cancellation hook on a retained job.

Parameters
[in]jobBorrowed job issued by this host.
[in]hookThread-safe callback invoked by IJob::cancel(), including after worker settlement. Use only copied atomic state, never GUI objects. Empty clears the hook.
Note
GUI-thread registration; this does not alter the frozen worker/activity outcome.

◆ setLocationHandler()

void openswmmvis::GuiExtensionHost::setLocationHandler ( QObject *  context,
std::function< void(const QString &, int)>  handler 
)
overridevirtual

Register a guarded source-location callback for this output channel.

Parameters
[in]contextBorrowed GUI-thread receiver lifetime; null disables navigation.
[in]handlerOwning callback receiving the source path and one-based line.

Implements OpenSWMM::Sdk::IConsole.

◆ setModelAccess()

void openswmmvis::GuiExtensionHost::setModelAccess ( std::function< QList< OpenSWMM::Sdk::IProject * >()>  projects,
std::function< OpenSWMM::Sdk::IModelInstance *()>  active 
)

Install GUI-thread model enumeration adapters before initialize() runs.

Parameters
[in]projectsOwning callback returning borrowed guarded project facades.
[in]activeOwning callback resolving the active model facade, or null.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPreviewLayers()

void openswmmvis::GuiExtensionHost::setPreviewLayers ( std::function< QUuid(const QUuid &, QList< qint64 > *)>  lookup)

Install the private native preview-layer lookup before extension initialization.

Parameters
[in]lookupSession-scoped resolver for this host's own preview facade.
Here is the caller graph for this function:

◆ setSessionResolver()

void openswmmvis::GuiExtensionHost::setSessionResolver ( std::function< OpenSWMM::Sdk::IModelInstance *(const QUuid &)>  resolver)

Install a lookup-only per-session facade resolver during host setup.

Parameters
[in]resolverBorrowed-facade lookup, confined to the GUI thread.
Here is the caller graph for this function:

◆ setTimeSeriesControls()

void openswmmvis::GuiExtensionHost::setTimeSeriesControls ( std::function< OpenSWMM::Sdk::IJob *(const OpenSWMM::Sdk::TimeSeriesImportRequest &, QObject *, std::function< void(const OpenSWMM::Sdk::TimeSeriesImportResult &)>, QString *)>  importer,
std::function< QList< OpenSWMM::Sdk::TimeSeriesLayerInfo >(const QUuid &)>  layers 
)

Install private native dataset routes before extension initialization.

Parameters
[in]importerCancellable application import/controller bridge.
[in]layersLookup-only attached collection metadata query.
Here is the caller graph for this function:

◆ settings()

OpenSWMM::Sdk::ISettings * openswmmvis::GuiExtensionHost::settings ( )
inlineoverridevirtual

Access this extension user settings.

Returns
Borrowed facade confined to the plugin namespace.

Implements OpenSWMM::Sdk::ExtensionHost.

◆ setValue()

void openswmmvis::GuiExtensionHost::setValue ( const QString &  key,
const QVariant &  value 
)
overridevirtual

Persist a nonempty relative key and announce settingsChanged.

Parameters
[in]keyRelative setting name; empty and traversal keys are ignored.
[in]valueOwning value copied into QSettings.
Note
Values use normal QSettings storage; this is not a credential vault.

Implements OpenSWMM::Sdk::ISettings.

Here is the call graph for this function:

◆ setViewControls()

void openswmmvis::GuiExtensionHost::setViewControls ( std::function< bool(const OpenSWMM::Sdk::ViewCommand &, QString *)>  execute,
std::function< QList< qint64 >(const QUuid &, const QUuid &, int, int)>  selection 
)

Install private native view-controller routes during host setup.

Parameters
[in]executeValidated native command callback.
[in]selectionLookup-only paged vector-selection callback.
Here is the caller graph for this function:

◆ showDock()

void openswmmvis::GuiExtensionHost::showDock ( const QString &  id)
overridevirtual

Reveal and raise a registered dock.

Parameters
[in]idExtension-local dock identity; unknown IDs are ignored.

Implements OpenSWMM::Sdk::IUiHost.

◆ start()

int openswmmvis::GuiExtensionHost::start ( OpenSWMM::Sdk::IModelInstance *  instance,
QString *  error = nullptr 
)
overridevirtual

Save and run an existing model using its configured engine/options.

Parameters
[in]instanceBorrowed live, previously saved model facade.
[out]errorOptional save, lease or startup refusal detail.
Returns
Simulation Status job ID, or minus one if execution did not start.
Note
Uses normal application preflight/output rules and can present their existing dialogs.

Implements OpenSWMM::Sdk::IRunRegistry.

Here is the call graph for this function:

◆ startRunAttempt()

QUuid openswmmvis::GuiExtensionHost::startRunAttempt ( const QUuid &  sessionId,
quint64  loadGeneration,
QString *  error = nullptr 
)
overridevirtual

Start an exact Ready model generation via the native run controller.

Parameters
[in]sessionIdPer-open native model identity.
[in]loadGenerationExact accepted model generation.
[out]errorOptional refusal detail.
Returns
Accepted attempt UUID, null if refused before acceptance.

Implements OpenSWMM::Sdk::IActivityControls.

◆ stateRegistry()

ExtensionStateRegistry * openswmmvis::GuiExtensionHost::stateRegistry ( ) const

Access the application registry used by this host's private model bridge.

Returns
Borrowed registry, or null during application teardown.
Here is the caller graph for this function:

◆ stateSnapshot()

StateSnapshot openswmmvis::GuiExtensionHost::stateSnapshot ( ) const
overridevirtual

Copy live session metadata and its atomic registry watermark.

Returns
Owning snapshot, or empty off the GUI thread/after shutdown.

Implements OpenSWMM::Sdk::ISessionEvents.

◆ statusMessage()

void openswmmvis::GuiExtensionHost::statusMessage ( const QString &  text,
int  milliseconds = 5000 
)
overridevirtual

Display transient status-bar text.

Parameters
[in]textUser-facing message.
[in]millisecondsVisibility duration; zero keeps the message until replaced.

Implements OpenSWMM::Sdk::IUiHost.

◆ subscribe()

QMetaObject::Connection openswmmvis::GuiExtensionHost::subscribe ( QObject *  context,
const OpenSWMM::Sdk::EventFilter &  filter,
std::function< void(const OpenSWMM::Sdk::Event &)>  callback 
)
override

Subscribe to typed SDK 1.2 notifications using a frozen optional interface.

Parameters
[in]contextRequired GUI-thread receiver whose destruction disconnects delivery.
[in]filterCopied event-kind and model-identity filter; empty fields match all.
[in]callbackSynchronous observer receiving a borrowed typed value during the call.
Returns
Disconnectable connection, or invalid for an unavailable context/callback/host.
Note
Has the same thread, lifetime, exception and shutdown guards as observe(). Publication sequence is local to this host and is not a model revision.
Here is the call graph for this function:

◆ themeColor()

QColor openswmmvis::GuiExtensionHost::themeColor ( QPalette::ColorRole  role) const
overridevirtual

Read an active host palette token.

Parameters
[in]roleQt semantic palette role.
Returns
Owning color; refresh after observing themeChanged.

Implements OpenSWMM::Sdk::ExtensionHost.

Here is the caller graph for this function:

◆ timeSeries()

bool openswmmvis::GuiExtensionHost::timeSeries ( OpenSWMM::Sdk::IModelInstance *  instance,
const QString &  category,
const QString &  name,
const QString &  variableKey 
)
overridevirtual

Add a result series to the shared time-series plot panel.

Parameters
[in]instanceBorrowed live model with active 1D results.
[in]categoryNode, link, subcatchment or system.
[in]nameObject ID, or empty for system results.
[in]variableKeyKey returned by variables(); no GUI enum values are required.
Returns
False for an unavailable model/result/object/variable; true after panel submission.

Implements OpenSWMM::Sdk::IPlotService.

◆ timeSeriesLayers()

QList< TimeSeriesLayerInfo > openswmmvis::GuiExtensionHost::timeSeriesLayers ( const QUuid &  sessionId) const
overridevirtual

Query bounded native observation-layer metadata for one Ready session.

Parameters
[in]sessionIdExact open lifetime; persistent UUIDs are not accepted.
Returns
At most 1000 copied layer descriptors, empty off-thread/after closure.

Implements OpenSWMM::Sdk::ITimeSeriesLayers.

◆ typedEventOccurred

void openswmmvis::GuiExtensionHost::typedEventOccurred ( const OpenSWMM::Sdk::Event &  event)
signal

Publish one canonical typed notification before its legacy projection.

Parameters
[in]eventOwning domain value with per-host publication sequence.
Note
Private implementation signal; plugins discover IModelEvents instead.
Here is the caller graph for this function:

◆ ui()

OpenSWMM::Sdk::IUiHost * openswmmvis::GuiExtensionHost::ui ( )
inlineoverridevirtual

Access namespaced widget/action registration.

Returns
Borrowed GUI-thread service.

Implements OpenSWMM::Sdk::ExtensionHost.

◆ unregisterAction()

void openswmmvis::GuiExtensionHost::unregisterAction ( const QString &  id)
overridevirtual

Remove a command without deleting its QAction.

Parameters
[in]idExtension-local command identity.

Implements OpenSWMM::Sdk::IUiHost.

Here is the caller graph for this function:

◆ unregisterDockPanelFactory()

void openswmmvis::GuiExtensionHost::unregisterDockPanelFactory ( const QString &  id)
overridevirtual

Destroy a registered dock and its widget.

Parameters
[in]idExtension-local dock identity.

Implements OpenSWMM::Sdk::IUiHost.

Here is the caller graph for this function:

◆ unregisterDocumentViewFactory()

void openswmmvis::GuiExtensionHost::unregisterDocumentViewFactory ( const QString &  kind)
overridevirtual

Close all views of this kind before releasing its factory.

Parameters
[in]kindExtension-local document kind.

Implements OpenSWMM::Sdk::IUiHost.

Here is the caller graph for this function:

◆ unregisterPreferencesPage()

void openswmmvis::GuiExtensionHost::unregisterPreferencesPage ( const QString &  id)
overridevirtual

Remove a preferences factory and its live page before resource teardown.

Parameters
[in]idExtension-local page identity.

Implements OpenSWMM::Sdk::IUiHost.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unregisterRibbonTab()

void openswmmvis::GuiExtensionHost::unregisterRibbonTab ( const QString &  id)
overridevirtual

Remove only this contribution and its host-owned toolbars.

Parameters
[in]idExtension-local contribution identity; other plugins remain available.

Implements OpenSWMM::Sdk::IUiHost.

Here is the caller graph for this function:

◆ updateProgress()

bool openswmmvis::GuiExtensionHost::updateProgress ( const QUuid &  operationId,
double  fraction,
const QString &  stage 
)
overridevirtual

Update progress and its current human-readable stage.

Parameters
[in]operationIdActive UUID issued by this exact host.
[in]fractionFinite negative values mean indeterminate; nonnegative values clamp to [0,1]. NaN and infinity are rejected without altering progress.
[in]stageCurrent stage; use stable wording so byte/count updates do not flood Logs.
Returns
True for an accepted update/no-op, false for invalid, foreign or finished IDs, unavailable/moved contexts, wrong-thread calls, nonfinite fractions or a stopping host.
Note
Identical updates are coalesced. Only changed nonempty stages are logged.

Implements OpenSWMM::Sdk::IProgress.

Here is the call graph for this function:

◆ value()

QVariant openswmmvis::GuiExtensionHost::value ( const QString &  key,
const QVariant &  fallback = {} 
) const
overridevirtual

Read a key beneath extensions/<pluginId>/.

Parameters
[in]keyRelative key; absolute paths and traversal components are refused.
[in]fallbackValue returned for an absent or refused key.
Returns
Owning QVariant; no other extension namespace is visible.

Implements OpenSWMM::Sdk::ISettings.

◆ variables()

QList< QVariantMap > openswmmvis::GuiExtensionHost::variables ( OpenSWMM::Sdk::IModelInstance *  instance,
const QString &  category 
) const
overridevirtual

Enumerate plottable variables from the model's active 1D results.

Parameters
[in]instanceBorrowed live model.
[in]categoryOne of node, link, subcatchment or system.
Returns
Maps with stable key, label and units; empty if no matching results/kind exists.

Implements OpenSWMM::Sdk::IPlotService.

◆ viewSnapshot()

ViewSnapshot openswmmvis::GuiExtensionHost::viewSnapshot ( const QUuid &  sessionId) const
overridevirtual

Copy tracked native view metadata without creating trackers or facades.

Parameters
[in]sessionIdPer-open model identity.
Returns
Owning state, or a null-session value when unavailable.

Implements OpenSWMM::Sdk::IViewEvents.


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