19 #ifndef UBUNTU_DOWNLOADMANAGER_CLIENT_MANAGER_H
20 #define UBUNTU_DOWNLOADMANAGER_CLIENT_MANAGER_H
24 #include <ubuntu/download_manager/metatypes.h>
25 #include <ubuntu/download_manager/common.h>
26 #include <ubuntu/download_manager/download_struct.h>
27 #include <ubuntu/download_manager/group_download_struct.h>
32 namespace DownloadManager {
43 typedef std::function<void(Download*)>
DownloadCb;
61 typedef std::function<void(GroupDownload*)>
GroupCb;
141 const QString& algorithm,
143 const QVariantMap& metadata,
144 StringMap headers) = 0;
162 const QString& algorithm,
164 const QVariantMap& metadata,
201 const QString &value) = 0;
215 const QString &value,
224 virtual bool isError()
const = 0;
283 virtual void exit() = 0;
324 const QString& value,
341 #endif // UBUNTU_DOWNLOADMANAGER_CLIENT_MANAGER_H
The Error class is the base class that represents an error in the download manager API...
std::function< void(Download *)> DownloadCb
std::function< void(const QString &, const QString &, DownloadsList *)> MetadataDownloadsListCb
static Manager * createSessionManager(const QString &path="", QObject *parent=0)
virtual void getAllDownloads()=0
void groupCreated(GroupDownload *down)
virtual void createDownload(DownloadStruct downStruct)=0
void downloadsFound(DownloadsList *downloads)
virtual Error * lastError() const =0
virtual void allowMobileDataDownload(bool allowed)=0
virtual bool isError() const =0
virtual bool isMobileDataDownload()=0
static Manager * createSystemManager(const QString &path="", QObject *parent=0)
virtual void setDefaultThrottle(qulonglong speed)=0
The Download class allows to control a download that was created in the download manager.
Manager(QObject *parent=0)
std::function< void(GroupDownload *)> GroupCb
std::function< void(DownloadsList *)> DownloadsListCb
void downloadCreated(Download *down)
void downloadsWithMetadataFound(const QString &name, const QString &value, DownloadsList *downloads)
The Manager class is the entry point of the download manager API and allows the client to create down...
virtual void getAllDownloadsWithMetadata(const QString &name, const QString &value)=0
virtual qulonglong defaultThrottle()=0
virtual Download * getDownloadForId(const QString &id)=0