11 #ifndef MANAGER_INTERFACE_H_1386155846 
   12 #define MANAGER_INTERFACE_H_1386155846 
   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> 
   26 using namespace Transfers::Errors;
 
   28 namespace DownloadManager {
 
   33 class ManagerInterface: 
public QDBusAbstractInterface
 
   37     static inline const char *staticInterfaceName()
 
   38     { 
return "com.canonical.applications.DownloadManager"; }
 
   41     ManagerInterface(
const QString &service, 
const QString &path, 
const QDBusConnection &connection, 
QObject *parent = 0);
 
   46     inline QDBusPendingReply<> allowGSMDownload(
bool allowed)
 
   48         QList<QVariant> argumentList;
 
   49         argumentList << QVariant::fromValue(allowed);
 
   50         return asyncCallWithArgumentList(QLatin1String(
"allowGSMDownload"), argumentList);
 
   53     inline QDBusPendingReply<QDBusObjectPath> createDownload(DownloadStruct download)
 
   55         QList<QVariant> argumentList;
 
   56         argumentList << QVariant::fromValue(download);
 
   57         return asyncCallWithArgumentList(QLatin1String(
"createDownload"), argumentList);
 
   60     inline QDBusPendingReply<QDBusObjectPath> createDownloadGroup(StructList downloads, 
const QString &algorithm, 
bool allowed3G, 
const QVariantMap &metadata, StringMap headers)
 
   62         QList<QVariant> argumentList;
 
   63         argumentList << QVariant::fromValue(downloads) << QVariant::fromValue(algorithm) << QVariant::fromValue(allowed3G) << QVariant::fromValue(metadata) << QVariant::fromValue(headers);
 
   64         return asyncCallWithArgumentList(QLatin1String(
"createDownloadGroup"), argumentList);
 
   67     inline QDBusPendingReply<qulonglong> defaultThrottle()
 
   69         QList<QVariant> argumentList;
 
   70         return asyncCallWithArgumentList(QLatin1String(
"defaultThrottle"), argumentList);
 
   73     inline QDBusPendingReply<> exit()
 
   75         QList<QVariant> argumentList;
 
   76         return asyncCallWithArgumentList(QLatin1String(
"exit"), argumentList);
 
   79     inline QDBusPendingReply<QList<QDBusObjectPath> > getAllDownloads(
const QString &appId, 
bool uncollected)
 
   81         QList<QVariant> argumentList;
 
   82         argumentList << QVariant::fromValue(appId);
 
   83         argumentList << QVariant::fromValue(uncollected);
 
   84         return asyncCallWithArgumentList(QLatin1String(
"getAllDownloads"), argumentList);
 
   87     inline QDBusPendingReply<QList<QDBusObjectPath> > getAllDownloadsWithMetadata(
const QString &name, 
const QString &value)
 
   89         QList<QVariant> argumentList;
 
   90         argumentList << QVariant::fromValue(name) << QVariant::fromValue(value);
 
   91         return asyncCallWithArgumentList(QLatin1String(
"getAllDownloadsWithMetadata"), argumentList);
 
   94     inline QDBusPendingReply<bool> isGSMDownloadAllowed()
 
   96         QList<QVariant> argumentList;
 
   97         return asyncCallWithArgumentList(QLatin1String(
"isGSMDownloadAllowed"), argumentList);
 
  100     inline QDBusPendingReply<> setDefaultThrottle(qulonglong speed)
 
  102         QList<QVariant> argumentList;
 
  103         argumentList << QVariant::fromValue(speed);
 
  104         return asyncCallWithArgumentList(QLatin1String(
"setDefaultThrottle"), argumentList);
 
  108     void downloadCreated(
const QDBusObjectPath &path);