![]() |
LeechCraft
0.6.70-10870-g558588d6ec
Modular cross-platform feature rich live environment.
|
Common interface for all the downloaders. More...
#include "idownload.h"
Public Types | |
enum | Error { EUnknown, ENoError, ENotFound, EAccessDenied, ELocalError } |
typedef unsigned long int | JobID_t |
Public Member Functions | |
virtual qint64 | GetDownloadSpeed () const =0 |
Returns download speed. More... | |
virtual qint64 | GetUploadSpeed () const =0 |
Returns upload speed. More... | |
virtual void | StartAll ()=0 |
Starts all tasks. More... | |
virtual void | StopAll ()=0 |
Stops all tasks. More... | |
virtual EntityTestHandleResult | CouldDownload (const LeechCraft::Entity &entity) const =0 |
Returns whether plugin can handle given entity. More... | |
virtual int | AddJob (LeechCraft::Entity entity)=0 |
Adds the job with given parameters. More... | |
virtual void | KillTask (int id)=0 |
Kills the task with the given id. 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 62 of file idownload.h.
typedef unsigned long int IDownload::JobID_t |
Definition at line 73 of file idownload.h.
enum IDownload::Error |
Enumerator | |
---|---|
EUnknown | |
ENoError | |
ENotFound | |
EAccessDenied | |
ELocalError |
Definition at line 65 of file idownload.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 152 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.
|
pure virtual |
Kills the task with the given id.
Kills the task with the id previously returned from AddJob. If there is no such task, the function shall leave the downloader in a good state. Ignoring will do.
[in] | id | ID of the task previously added with AddJob(). |
|
pure virtual |
Starts all tasks.
This is called by LeechCraft when it wants all plugins to start all of its tasks.
|
pure virtual |
Stops all tasks.
This is called by LeechCraft when it wants all plugins to stop all of its tasks.