19 #ifndef UBUNTU_DOWNLOADMANAGER_CLIENT_DOWNLOAD_IMPL_H
20 #define UBUNTU_DOWNLOADMANAGER_CLIENT_DOWNLOAD_IMPL_H
22 #include <QDBusConnection>
23 #include <QDBusObjectPath>
25 #include <QVariantMap>
27 #include <ubuntu/transfers/visibility.h>
28 #include <ubuntu/download_manager/metatypes.h>
34 class QDBusConnection;
35 class QDBusObjectPath;
39 namespace DownloadManager {
42 class UBUNTU_TRANSFERS_PRIVATE DownloadImpl :
public Download {
46 friend class ManagerImpl;
47 friend class DownloadPCW;
48 friend class MetadataDownloadsListManagerPCW;
49 friend class DownloadsListManagerPCW;
50 friend class DownloadManagerPCW;
53 virtual ~DownloadImpl();
60 void allowMobileDownload(
bool allowed);
61 bool isMobileDownloadAllowed();
63 void setDestinationDir(
const QString& path);
64 void setThrottle(qulonglong speed);
65 qulonglong throttle();
68 QVariantMap metadata();
69 qulonglong progress();
70 qulonglong totalSize();
76 DownloadImpl(
const QDBusConnection& conn, Error* err,
QObject* parent = 0);
77 DownloadImpl(
const QDBusConnection& conn,
78 const QString& servicePath,
79 const QDBusObjectPath& objectPath,
83 void setLastError(Error* err);
84 void setLastError(
const QDBusError& err);
85 void onHttpError(HttpErrorStruct);
86 void onNetworkError(NetworkErrorStruct);
87 void onProcessError(ProcessErrorStruct);
88 void onAuthError(AuthErrorStruct);
92 bool _isError =
false;
93 Error* _lastError =
nullptr;
94 DownloadInterface* _dbusInterface =
nullptr;
95 QDBusConnection _conn;
104 #endif // UBUNTU_DOWNLOADMANAGER_CLIENT_DOWNLOAD_IMPL_H