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

The root object of a bar-widget plugin. More...

#include <PhosphorRegistry/IBarWidgetPlugin.h>

Public Member Functions

virtual ~IBarWidgetPlugin ()=default
virtual std::unique_ptr< IBarWidgetFactory > createFactory ()=0
 A fresh factory whose id() equals the plugin's metadata "Id", or nullptr when it cannot be built.

Protected Member Functions

 IBarWidgetPlugin ()=default

Detailed Description

The root object of a bar-widget plugin.

A bar-widget plugin is a Qt plugin in the bar-widget seam (see PluginLoader::barWidgetSeam): its root QObject implements this interface, declares Q_PLUGIN_METADATA(IID PhosphorRegistryBarWidgetPlugin_iid FILE "metadata.json"), and its metadata carries "Id" and "ApiVersion".

The plugin and the host must use the same C++ standard library, because the factory crosses this interface in a std::unique_ptr that the host adopts into a std::shared_ptr.

Constructor & Destructor Documentation

◆ ~IBarWidgetPlugin()

virtual PhosphorRegistry::IBarWidgetPlugin::~IBarWidgetPlugin ( )
virtualdefault

◆ IBarWidgetPlugin()

PhosphorRegistry::IBarWidgetPlugin::IBarWidgetPlugin ( )
protecteddefault

Member Function Documentation

◆ createFactory()

virtual std::unique_ptr< IBarWidgetFactory > PhosphorRegistry::IBarWidgetPlugin::createFactory ( )
nodiscardpure virtual

A fresh factory whose id() equals the plugin's metadata "Id", or nullptr when it cannot be built.

Called each time the plugin comes on offer, which happens more than once when its file is removed and put back. Must not throw: the library is built without exceptions, so an exception that escapes ends the process.


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