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/download_struct.h>
26 #include <ubuntu/download_manager/group_download_struct.h>
31 namespace DownloadManager {
42 typedef std::function<void(Download*)>
DownloadCb;
60 typedef std::function<void(GroupDownload*)>
GroupCb;
126 DownloadCb errCb) = 0;
140 const QString& algorithm,
142 const QVariantMap& metadata,
143 StringMap headers) = 0;
161 const QString& algorithm,
163 const QVariantMap& metadata,
181 virtual void getAllDownloads(
const QString& appId,
bool uncollected) = 0;
200 DownloadsListCb errCb) = 0;
212 const QString &value) = 0;
226 const QString &value,
227 MetadataDownloadsListCb cb,
228 MetadataDownloadsListCb errCb) = 0;
235 virtual bool isError()
const = 0;
294 virtual void exit() = 0;
335 const QString& value,
352 #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)
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
virtual void getAllDownloads(const QString &appId, bool uncollected)=0
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