The Manager class is the entry point of the download manager API and allows the client to create download requests in the download manager. More...
#include <manager.h>
Signals | |
void | downloadCreated (Download *down) |
void | downloadsFound (DownloadsList *downloads) |
void | downloadsWithMetadataFound (const QString &name, const QString &value, DownloadsList *downloads) |
void | groupCreated (GroupDownload *down) |
Public Member Functions | |
Manager (QObject *parent=0) | |
virtual Download * | getDownloadForId (const QString &id)=0 |
virtual void | createDownload (DownloadStruct downStruct)=0 |
virtual void | createDownload (DownloadStruct downStruct, DownloadCb cb, DownloadCb errCb)=0 |
virtual void | createDownload (StructList downs, const QString &algorithm, bool allowed3G, const QVariantMap &metadata, StringMap headers)=0 |
virtual void | createDownload (StructList downs, const QString &algorithm, bool allowed3G, const QVariantMap &metadata, StringMap headers, GroupCb cb, GroupCb errCb)=0 |
virtual void | getAllDownloads (const QString &appId, bool uncollected)=0 |
virtual void | getAllDownloads (const QString &appId, bool uncollected, DownloadsListCb cb, DownloadsListCb errCb)=0 |
virtual void | getAllDownloadsWithMetadata (const QString &name, const QString &value)=0 |
virtual void | getAllDownloadsWithMetadata (const QString &name, const QString &value, MetadataDownloadsListCb cb, MetadataDownloadsListCb errCb)=0 |
virtual bool | isError () const =0 |
virtual Error * | lastError () const =0 |
virtual void | allowMobileDataDownload (bool allowed)=0 |
virtual bool | isMobileDataDownload ()=0 |
virtual qulonglong | defaultThrottle ()=0 |
virtual void | setDefaultThrottle (qulonglong speed)=0 |
virtual void | exit ()=0 |
Static Public Member Functions | |
static Manager * | createSessionManager (const QString &path="", QObject *parent=0) |
static Manager * | createSystemManager (const QString &path="", QObject *parent=0) |
The Manager class is the entry point of the download manager API and allows the client to create download requests in the download manager.
The Manager is the entry point of the API and allows to create new downloads that will be performed by the download manager. The class allows to have two different types of managers:
The general rule of thumb is that a normal client application must connect to the session which contains all the downloads created for the user in the current session.
|
inlineexplicit |
|
pure virtual |
|
pure virtual |
Creates a new download using the data found in the structure. The downloadCreated(Download* down) can be used to get a pointer to the new created download.
|
pure virtual |
Creates a new download using the data found in the structure. cb will be executed when a successful download creation occurs while errCb will be executed when there was an error during the creation of the download object.
|
pure virtual |
Creates a group download with the data found in the structure. The groupCreated(GroupDownload* down) signal can be used to get a pointer to the new created group download.
|
pure virtual |
Creates a group download with the data found in the structure. cb will be executed when a successful group download creation occurs while errCb will be executed when there was an error during the creation of the group download object.
|
static |
Creates a new manager that will be connected to the session manager. path allows to provide the path where the download manager service can be found. In the general use case path does not need to be provided and the default value should be used.
Definition at line 31 of file manager.cpp.
|
static |
Creates a new manager that will be connected to the system manager. path allows to provide the path where the download manager service can be found. In the general use case path does not need to be provided and the default value should be used.
Definition at line 40 of file manager.cpp.
|
pure virtual |
Returns the default bandwidth limit that was set for the downloads that are present in the download manager.
|
signal |
This signal is emitted whenever a download is created by the download manager.
|
signal |
|
signal |
|
pure virtual |
Allows to stop the download manager. This method should not be used in production because it was added to simplify integration testing with the download manager.
|
pure virtual |
Returns all the downloads in the download manager that can be accessed by the calling client. If the client is not confined all downloads are returned, on the other hand if the client is confined the result will be only those downloads created by the client. The result of the method is returned via the downloadsFound signal.
If appId is specified only downloads from that appId will be returned.
If uncollected is true then only downloads that haven't yet been collected by a client will be returned.
|
pure virtual |
|
pure virtual |
Returns all the downloads in the download manager that can be accessed by the calling client. If the client is not confined all downloads are returned, on the other hand if the client is confined the result will be only those downloads created by the client. The result of the method is returned via the downloadsWithMetadataFound signal.
|
pure virtual |
Returns all the downloads in the download manager that can be accessed by the calling client. If the client is not confined all downloads are returned, on the other hand if the client is confined the result will be only those downloads created by the client. If the method is a success the cb is executed else errCb is executed.
|
pure virtual |
Returns a download object for the download with the given id. The id most be valid else the returned download will be in an unknown state meaning that most of the download operations will fail.
|
signal |
This signal is emitted whenever a group download is created by the download manager.
|
pure virtual |
Returns if the manager received an error during the execution of a command.
|
pure virtual |
|
pure virtual |
Returns the last error that occurred when interacting with the download manager.
|
pure virtual |
Allows to set the default bandwidth limit to all the downloads in the download manager.