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);
39 Q_PROPERTY(QString ClickPackage READ clickPackage)
40 inline QString clickPackage()
const
41 {
return qvariant_cast< QString >(property(
"ClickPackage")); }
43 Q_PROPERTY(
bool ShowInIndicator READ showInIndicator)
44 inline bool showInIndicator()
const
45 {
return qvariant_cast<
bool >(property(
"ShowInIndicator")); }
47 Q_PROPERTY(QString Title READ title)
48 inline QString title()
const
49 {
return qvariant_cast< QString >(property(
"Title")); }
52 inline QDBusPendingReply<> allowGSMDownload(
bool allowed)
54 QList<QVariant> argumentList;
55 argumentList << QVariant::fromValue(allowed);
56 return asyncCallWithArgumentList(QLatin1String(
"allowGSMDownload"), argumentList);
59 inline QDBusPendingReply<> cancel()
61 QList<QVariant> argumentList;
62 return asyncCallWithArgumentList(QLatin1String(
"cancel"), argumentList);
65 inline QDBusPendingReply<StringMap> headers()
67 QList<QVariant> argumentList;
68 return asyncCallWithArgumentList(QLatin1String(
"headers"), argumentList);
71 inline QDBusPendingReply<bool> isGSMDownloadAllowed()
73 QList<QVariant> argumentList;
74 return asyncCallWithArgumentList(QLatin1String(
"isGSMDownloadAllowed"), argumentList);
77 inline QDBusPendingReply<QVariantMap> metadata()
79 QList<QVariant> argumentList;
80 return asyncCallWithArgumentList(QLatin1String(
"metadata"), argumentList);
83 inline QDBusPendingReply<> pause()
85 QList<QVariant> argumentList;
86 return asyncCallWithArgumentList(QLatin1String(
"pause"), argumentList);
89 inline QDBusPendingReply<qulonglong> progress()
91 QList<QVariant> argumentList;
92 return asyncCallWithArgumentList(QLatin1String(
"progress"), argumentList);
95 inline QDBusPendingReply<> resume()
97 QList<QVariant> argumentList;
98 return asyncCallWithArgumentList(QLatin1String(
"resume"), argumentList);
101 inline QDBusPendingReply<> setDestinationDir(
const QString &path)
103 QList<QVariant> argumentList;
104 argumentList << QVariant::fromValue(path);
105 return asyncCallWithArgumentList(QLatin1String(
"setDestinationDir"), argumentList);
108 inline QDBusPendingReply<> setHeaders(StringMap headers)
110 QList<QVariant> argumentList;
111 argumentList << QVariant::fromValue(headers);
112 return asyncCallWithArgumentList(QLatin1String(
"setHeaders"), argumentList);
115 inline QDBusPendingReply<> setMetadata(
const QVariantMap &data)
117 QList<QVariant> argumentList;
118 argumentList << QVariant::fromValue(data);
119 return asyncCallWithArgumentList(QLatin1String(
"setMetadata"), argumentList);
122 inline QDBusPendingReply<> setThrottle(qulonglong speed)
124 QList<QVariant> argumentList;
125 argumentList << QVariant::fromValue(speed);
126 return asyncCallWithArgumentList(QLatin1String(
"setThrottle"), argumentList);
129 inline QDBusPendingReply<> start()
131 QList<QVariant> argumentList;
132 return asyncCallWithArgumentList(QLatin1String(
"start"), argumentList);
135 inline QDBusPendingReply<qulonglong> throttle()
137 QList<QVariant> argumentList;
138 return asyncCallWithArgumentList(QLatin1String(
"throttle"), argumentList);
141 inline QDBusPendingReply<qulonglong> totalSize()
143 QList<QVariant> argumentList;
144 return asyncCallWithArgumentList(QLatin1String(
"totalSize"), argumentList);
148 void authError(AuthErrorStruct error);
149 void canceled(
bool success);
150 void error(
const QString &error);
151 void finished(
const QString &path);
152 void httpError(HttpErrorStruct error);
153 void networkError(NetworkErrorStruct error);
154 void paused(
bool success);
155 void processError(ProcessErrorStruct error);
156 void processing(
const QString &path);
157 void progress(qulonglong received, qulonglong total);
158 void resumed(
bool success);
159 void started(
bool success);
163 namespace canonical {
164 namespace applications {
165 typedef ::DownloadInterface Download;