11#ifndef DOWNLOAD_INTERFACE_H_1442932929
12#define DOWNLOAD_INTERFACE_H_1442932929
14#include <QtCore/QObject>
15#include <QtCore/QByteArray>
16#include <QtCore/QList>
18#include <QtCore/QString>
19#include <QtCore/QStringList>
20#include <QtCore/QVariant>
21#include <QtDBus/QtDBus>
22#include <lomiri/download_manager/metatypes.h>
27class DownloadInterface:
public QDBusAbstractInterface
31 static inline const char *staticInterfaceName()
32 {
return "com.lomiri.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(QString DestinationApp READ destinationApp)
44 inline QString destinationApp()
const
45 {
return qvariant_cast< QString >(property(
"DestinationApp")); }
47 Q_PROPERTY(
bool ShowInIndicator READ showInIndicator)
48 inline bool showInIndicator()
const
49 {
return qvariant_cast< bool >(property(
"ShowInIndicator")); }
51 Q_PROPERTY(QString Title READ title)
52 inline QString title()
const
53 {
return qvariant_cast< QString >(property(
"Title")); }
56 inline QDBusPendingReply<> allowGSMDownload(
bool allowed)
58 QList<QVariant> argumentList;
59 argumentList << QVariant::fromValue(allowed);
60 return asyncCallWithArgumentList(QStringLiteral(
"allowGSMDownload"), argumentList);
63 inline QDBusPendingReply<> cancel()
65 QList<QVariant> argumentList;
66 return asyncCallWithArgumentList(QStringLiteral(
"cancel"), argumentList);
69 inline QDBusPendingReply<> collected()
71 QList<QVariant> argumentList;
72 return asyncCallWithArgumentList(QStringLiteral(
"collected"), argumentList);
75 inline QDBusPendingReply<QString> filePath()
77 QList<QVariant> argumentList;
78 return asyncCallWithArgumentList(QStringLiteral(
"filePath"), argumentList);
81 inline QDBusPendingReply<StringMap> headers()
83 QList<QVariant> argumentList;
84 return asyncCallWithArgumentList(QStringLiteral(
"headers"), argumentList);
87 inline QDBusPendingReply<bool> isGSMDownloadAllowed()
89 QList<QVariant> argumentList;
90 return asyncCallWithArgumentList(QStringLiteral(
"isGSMDownloadAllowed"), argumentList);
93 inline QDBusPendingReply<QVariantMap> metadata()
95 QList<QVariant> argumentList;
96 return asyncCallWithArgumentList(QStringLiteral(
"metadata"), argumentList);
99 inline QDBusPendingReply<> pause()
101 QList<QVariant> argumentList;
102 return asyncCallWithArgumentList(QStringLiteral(
"pause"), argumentList);
105 inline QDBusPendingReply<qulonglong> progress()
107 QList<QVariant> argumentList;
108 return asyncCallWithArgumentList(QStringLiteral(
"progress"), argumentList);
111 inline QDBusPendingReply<> resume()
113 QList<QVariant> argumentList;
114 return asyncCallWithArgumentList(QStringLiteral(
"resume"), argumentList);
117 inline QDBusPendingReply<> setDestinationDir(
const QString &path)
119 QList<QVariant> argumentList;
120 argumentList << QVariant::fromValue(path);
121 return asyncCallWithArgumentList(QStringLiteral(
"setDestinationDir"), argumentList);
124 inline QDBusPendingReply<> setHeaders(StringMap headers)
126 QList<QVariant> argumentList;
127 argumentList << QVariant::fromValue(headers);
128 return asyncCallWithArgumentList(QStringLiteral(
"setHeaders"), argumentList);
131 inline QDBusPendingReply<> setMetadata(
const QVariantMap &data)
133 QList<QVariant> argumentList;
134 argumentList << QVariant::fromValue(data);
135 return asyncCallWithArgumentList(QStringLiteral(
"setMetadata"), argumentList);
138 inline QDBusPendingReply<> setThrottle(qulonglong speed)
140 QList<QVariant> argumentList;
141 argumentList << QVariant::fromValue(speed);
142 return asyncCallWithArgumentList(QStringLiteral(
"setThrottle"), argumentList);
145 inline QDBusPendingReply<> start()
147 QList<QVariant> argumentList;
148 return asyncCallWithArgumentList(QStringLiteral(
"start"), argumentList);
151 inline QDBusPendingReply<int> state()
153 QList<QVariant> argumentList;
154 return asyncCallWithArgumentList(QStringLiteral(
"state"), argumentList);
157 inline QDBusPendingReply<qulonglong> throttle()
159 QList<QVariant> argumentList;
160 return asyncCallWithArgumentList(QStringLiteral(
"throttle"), argumentList);
163 inline QDBusPendingReply<qulonglong> totalSize()
165 QList<QVariant> argumentList;
166 return asyncCallWithArgumentList(QStringLiteral(
"totalSize"), argumentList);
170 void authError(AuthErrorStruct error);
171 void canceled(
bool success);
172 void error(
const QString &error);
173 void finished(
const QString &path);
174 void hashError(HashErrorStruct error);
175 void httpError(HttpErrorStruct error);
176 void networkError(NetworkErrorStruct error);
177 void paused(
bool success);
178 void processError(ProcessErrorStruct error);
179 void processing(
const QString &path);
180 void progress(qulonglong received, qulonglong total);
181 void resumed(
bool success);
182 void started(
bool success);
186 namespace canonical {
187 namespace applications {
188 typedef ::DownloadInterface Download;