11 #ifndef DOWNLOAD_INTERFACE_H_1392136772
12 #define DOWNLOAD_INTERFACE_H_1392136772
14 #include <QtCore/QObject>
15 #include <QtCore/QByteArray>
16 #include <QtCore/QList>
17 #include <QtCore/QMap>
18 #include <QtCore/QString>
19 #include <QtCore/QStringList>
20 #include <QtCore/QVariant>
21 #include <QtDBus/QtDBus>
22 #include <ubuntu/download_manager/metatypes.h>
27 class DownloadInterface:
public QDBusAbstractInterface
31 static inline const char *staticInterfaceName()
32 {
return "com.canonical.applications.Download"; }
35 DownloadInterface(
const QString &service,
const QString &path,
const QDBusConnection &connection,
QObject *parent = 0);
40 inline QDBusPendingReply<> allowGSMDownload(
bool allowed)
42 QList<QVariant> argumentList;
43 argumentList << QVariant::fromValue(allowed);
44 return asyncCallWithArgumentList(QLatin1String(
"allowGSMDownload"), argumentList);
47 inline QDBusPendingReply<> cancel()
49 QList<QVariant> argumentList;
50 return asyncCallWithArgumentList(QLatin1String(
"cancel"), argumentList);
53 inline QDBusPendingReply<StringMap> headers()
55 QList<QVariant> argumentList;
56 return asyncCallWithArgumentList(QLatin1String(
"headers"), argumentList);
59 inline QDBusPendingReply<bool> isGSMDownloadAllowed()
61 QList<QVariant> argumentList;
62 return asyncCallWithArgumentList(QLatin1String(
"isGSMDownloadAllowed"), argumentList);
65 inline QDBusPendingReply<QVariantMap> metadata()
67 QList<QVariant> argumentList;
68 return asyncCallWithArgumentList(QLatin1String(
"metadata"), argumentList);
71 inline QDBusPendingReply<> pause()
73 QList<QVariant> argumentList;
74 return asyncCallWithArgumentList(QLatin1String(
"pause"), argumentList);
77 inline QDBusPendingReply<qulonglong> progress()
79 QList<QVariant> argumentList;
80 return asyncCallWithArgumentList(QLatin1String(
"progress"), argumentList);
83 inline QDBusPendingReply<> resume()
85 QList<QVariant> argumentList;
86 return asyncCallWithArgumentList(QLatin1String(
"resume"), argumentList);
89 inline QDBusPendingReply<> setDestinationDir(
const QString &path)
91 QList<QVariant> argumentList;
92 argumentList << QVariant::fromValue(path);
93 return asyncCallWithArgumentList(QLatin1String(
"setDestinationDir"), argumentList);
96 inline QDBusPendingReply<> setHeaders(StringMap headers)
98 QList<QVariant> argumentList;
99 argumentList << QVariant::fromValue(headers);
100 return asyncCallWithArgumentList(QLatin1String(
"setHeaders"), argumentList);
103 inline QDBusPendingReply<> setThrottle(qulonglong speed)
105 QList<QVariant> argumentList;
106 argumentList << QVariant::fromValue(speed);
107 return asyncCallWithArgumentList(QLatin1String(
"setThrottle"), argumentList);
110 inline QDBusPendingReply<> start()
112 QList<QVariant> argumentList;
113 return asyncCallWithArgumentList(QLatin1String(
"start"), argumentList);
116 inline QDBusPendingReply<qulonglong> throttle()
118 QList<QVariant> argumentList;
119 return asyncCallWithArgumentList(QLatin1String(
"throttle"), argumentList);
122 inline QDBusPendingReply<qulonglong> totalSize()
124 QList<QVariant> argumentList;
125 return asyncCallWithArgumentList(QLatin1String(
"totalSize"), argumentList);
129 void authError(AuthErrorStruct error);
130 void canceled(
bool success);
131 void error(
const QString &error);
132 void finished(
const QString &path);
133 void httpError(HttpErrorStruct error);
134 void networkError(NetworkErrorStruct error);
135 void paused(
bool success);
136 void processError(ProcessErrorStruct error);
137 void processing(
const QString &path);
138 void progress(qulonglong received, qulonglong total);
139 void resumed(
bool success);
140 void started(
bool success);
144 namespace canonical {
145 namespace applications {
146 typedef ::DownloadInterface Download;