![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Common interface for all the downloaders. More...
#include "idownload.h"
Classes | |
struct | Error |
struct | Success |
Public Types | |
using | Result = LC::Util::Either< Error, Success > |
Public Member Functions | |
virtual qint64 | GetDownloadSpeed () const =0 |
Returns download speed. More... | |
virtual qint64 | GetUploadSpeed () const =0 |
Returns upload speed. More... | |
virtual EntityTestHandleResult | CouldDownload (const LC::Entity &entity) const =0 |
Returns whether plugin can handle given entity. More... | |
virtual QFuture< Result > | AddJob (LC::Entity entity)=0 |
Adds the job with given parameters. More... | |
virtual | ~IDownload () |
Virtual destructor. More... | |
Common interface for all the downloaders.
Plugins which provide downloading capabilities and want to be visible by LeechCraft and other plugins as download providers should implement this interface.
Plugins implementing this interface are expected to have following signals:
In order to obtain IDs for the tasks plugins are expected to use ICoreProxy::GetID() in order to avoid name clashes.
Definition at line 42 of file idownload.h.
using IDownload::Result = LC::Util::Either<Error, Success> |
Definition at line 74 of file idownload.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 130 of file idownload.h.
|
pure virtual |
Adds the job with given parameters.
Adds the job to the downloader and returns the ID of the newly added job back to identify it.
[in] | entity | A Entity structure. |
|
pure virtual |
Returns whether plugin can handle given entity.
This function is used to query every loaded plugin providing the IDownload interface whether it could handle the entity entered by user or generated automatically with given task parameters. Entity could be anything from file name to URL to all kinds of hashes like Magnet links.
[in] | entity | A Entity structure. |
|
pure virtual |
Returns download speed.
Returns summed up download speed of the plugin. The value is primarily used in the interface as there are no ways of controlling of bandwidth's usage of a particular plugin.
|
pure virtual |
Returns upload speed.
Returns summed up upload speed of the plugin. The value is primarily used in the interface as there are no ways of controlling of bandwidth's usage of a particular plugin.