PluginAppContext.h header

#include <ew/app/PluginAppContext.h>

Namespace ew::app

PluginAppContext class

class ew::app::PluginAppContext

The live application services handed to a plugin when the host builds one of its panels (or runs one of its menu commands). Where PluginContext is about registering contributions at load time, PluginAppContext is the running handle a plugin's own widget uses to do real work: read and traverse the open project, change it through the undoable command stack (so a plugin's edit is one undo step exactly like a UI edit), and parent dialogs off the main window.

It is host-implemented; a plugin only ever holds a reference, whose lifetime spans the panel's. Everything reachable through it lives on the GUI thread. This is the seam that lets a native plugin contribute a whole new window that actually reads and edits the user's data (DESIGN §6.11) – the capability scripts get through the world/app bridges, plugins get here with the full C++ model and command API.

Members

ew::app::PluginAppContext::PluginAppContext()=default

Defaulted.

virtual ew::app::PluginAppContext::~PluginAppContext()=default

Defaulted.

ew::app::PluginAppContext::PluginAppContext(const PluginAppContext &)=delete

Not copyable.

ew::app::PluginAppContext::PluginAppContext(PluginAppContext &&)=delete

Not movable.

PluginAppContext & ew::app::PluginAppContext::operator=(const PluginAppContext &)=delete

Not copyable.

PluginAppContext & ew::app::PluginAppContext::operator=(PluginAppContext &&)=delete

Not movable.

virtual ew::core::Project & ew::app::PluginAppContext::project()=0

The open project, to read and traverse the whole model (codex, documents, timeline, maps, ...).

virtual ew::core::CommandStack & ew::app::PluginAppContext::commands()=0

The undo/redo stack. A plugin pushes Commands here so its changes are undoable and merge into the app's history exactly like edits made in the UI.

virtual QWidget * ew::app::PluginAppContext::mainWindow()=0

The application's top-level window, for parenting a plugin's dialogs and message boxes; null in a headless host.