![]() |
LeechCraft 0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
|
Interface for plugins holding jobs or persistent notifications. More...
#include "ijobholder.h"
Classes | |
| struct | ViewCallbacks |
| The callbacks into the view showing the handlers' representations. More... | |
Public Member Functions | |
| virtual std::vector< IJobHolderRepresentationHandler_ptr > | CreateRepresentationHandlers (const ViewCallbacks &callbacks)=0 |
| Creates the handlers representing the jobs of this plugin. | |
Protected Member Functions | |
| virtual | ~IJobHolder ()=default |
Static Protected Member Functions | |
| template<std::derived_from< IJobHolderRepresentationHandler >... Handlers> | |
| static std::vector< IJobHolderRepresentationHandler_ptr > | MakeHandlers (std::unique_ptr< Handlers >... handlers) |
| Wraps the given handlers into the list to be returned from CreateRepresentationHandlers(). | |
Interface for plugins holding jobs or persistent notifications.
If a plugin can have some long-performing jobs (like a BitTorrent download, or file transfer in an IM client, or mail checking status) or persistent notifications (like unread messages in an IM client, unread news in an RSS feed reader or weather forecast), it may want to implement this interface to display itself in plugins like Summary.
The models with jobs and state info, as well as the controls and the information panes for them, are provided by the handlers created via CreateRepresentationHandlers(). The rows of the models carry some metadata like job progress via the JobHolderRole and JobHolderProcessRole enumerations (see RowInfo for an example).
Controls and additional information pane of a handler are only visible when a job of that handler is selected.
Definition at line 245 of file ijobholder.h.
|
protectedvirtualdefault |
|
pure virtual |
Creates the handlers representing the jobs of this plugin.
Each handler is presented as if it came from a separate plugin: its model is merged with the others in the returned order, and its controls, info widget, context menu and selection hooks are the ones used while a row of its model is current or selected. Thus a plugin whose jobs come in kinds needing different controls, like unread channels and running feed updates, returns a handler per kind.
The models of the returned handlers shall be distinct, as the views merge them by identity. A model may still be shared with the handlers returned to other views: this function is invoked once per view showing the jobs, and each view keeps the handlers it got for as long as it exists.
| [in] | callbacks | The callbacks into the view the handlers are created for. |
|
inlinestaticprotected |
Wraps the given handlers into the list to be returned from CreateRepresentationHandlers().
A braced list can't do that: std::initializer_list only ever yields const elements, while the handlers are move-only.
Definition at line 300 of file ijobholder.h.