ContributionRegistry.h header

#include <ew/app/ContributionRegistry.h>

Namespace ew::app

ContributionRegistry class

class ew::app::ContributionRegistry

Collects the contributions plugins register during load and vends them to the rest of the app. It is the host-side implementation of PluginContext: PluginHost fills it once at startup, then the theme picker and AI-command loader read it back (merged with the built-in/user data by the free functions availableThemes / loadPromptCommands). Constructed at the composition root and passed by reference (not a singleton).

Members

void ew::app::plugin::ContributionRegistry::addTheme(const app::settings::Theme &theme) override

Appends theme to the contributed themes (order preserved; de-duplication against the built-ins happens at read time in availableThemes).

void ew::app::plugin::ContributionRegistry::addPromptCommand(const app::ai::agent::PromptCommand &command) override

Appends command to the contributed AI commands (order preserved; de-duplication by name happens at read time in loadPromptCommands).

void ew::app::plugin::ContributionRegistry::addPanel(const PluginPanel &panel) override

Appends panel to the contributed dock/panels (order preserved); the host mounts each after plugins have loaded.

void ew::app::plugin::ContributionRegistry::addMenuCommand(const PluginMenuCommand &command) override

Appends command to the contributed menu commands (order preserved); the host adds each to the plugin-commands menu.

void ew::app::plugin::ContributionRegistry::adopt(const ContributionRegistry &other)

Appends everything staged in other, in its registration order.

A plugin registers into a scratch registry and the host adopts it only once registerContributions has returned, so a plugin that throws partway through leaves nothing behind. A half-registered plugin – one theme of three, a panel whose menu command never arrived – is not a state the app should run in, and it would be an invisible one: the user would see a plugin listed as loaded and merely behaving oddly (F-0083).

const std::vector< app::settings::Theme > & ew::app::plugin::ContributionRegistry::themes() const

The themes contributed by plugins, in registration order.

const std::vector< app::ai::agent::PromptCommand > & ew::app::plugin::ContributionRegistry::promptCommands() const

The AI commands contributed by plugins, in registration order.

const std::vector< PluginPanel > & ew::app::plugin::ContributionRegistry::panels() const

The dock/panels contributed by plugins, in registration order.

const std::vector< PluginMenuCommand > & ew::app::plugin::ContributionRegistry::menuCommands() const

The menu commands contributed by plugins, in registration order.