LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
IJobHolder Class Referenceabstract

Interface for plugins holding jobs or persistent notifications. More...

#include "ijobholder.h"

Public Member Functions

virtual QAbstractItemModel * GetRepresentation () const =0
 Returns the item representation model. More...
 
virtual IJobHolderRepresentationHandler_ptr CreateRepresentationHandler ()
 
virtual ~IJobHolder ()
 Virtual destructor. More...
 

Detailed Description

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 model with jobs and state info is obtained via GetRepresentation(), and various roles are used to retrieve controls and information pane of the plugin from that model, as well as some metadata like job progress (see JobHolderRole enumeration and ProcessStateInfo for an example).

Returned model should have three columns: name, state and status. Controls and additional information pane are only visible when a job handled by the plugin is selected.

See also
IDownloader
CustomDataRoles
JobHolderRole::ProcessState
ProcessStateInfo

Definition at line 229 of file ijobholder.h.

Constructor & Destructor Documentation

◆ ~IJobHolder()

virtual IJobHolder::~IJobHolder ( )
inlinevirtual

Virtual destructor.

Definition at line 267 of file ijobholder.h.

Member Function Documentation

◆ CreateRepresentationHandler()

virtual IJobHolderRepresentationHandler_ptr IJobHolder::CreateRepresentationHandler ( )
inlinevirtual

Definition at line 263 of file ijobholder.h.

◆ GetRepresentation()

virtual QAbstractItemModel* IJobHolder::GetRepresentation ( ) const
pure virtual

Returns the item representation model.

The returned model should have three columns, each for name, state and progress with speed. Inside of LeechCraft it would be merged with other models from other plugins.

This model is also used to retrieve controls and additional info for a given index via the CustomDataRoles::RoleControls and CustomDataRoles::RoleAdditionalInfo respectively.

Returned controls widget would be placed above the view with the jobs, so usually it has some actions controlling the job, but in fact it can have anything you want. It is only visible when a job from your plugin is selected. If a job from other plugin is selected, then other plugin's controls would be placed, and if no jobs are selected at all then all controls are hidden.

Widget with the additional information is placed to the right of the view with the jobs, so usually it has additional information about the job like transfer log for FTP client, but in fact it can have anything you want. The same rules regarding its visibility apply as for controls widget.

Returns
Representation model.
See also
LC::CustomDataRoles
LC::JobHolderRow
LC::ProcessStateInfo

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