/*
 * This file was generated by qdbusxml2cpp version 0.8
 * Command line was: qdbusxml2cpp -c DownloadAdaptor -a download_adaptor.h:download_adaptor.cpp com.lomiri.applications.download.xml
 *
 * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
 *
 * This file has been manually edited to wrap the state -> stateInt methods
 */

#include "download_adaptor.h"
#include <QtCore/QMetaObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>

/*
 * Implementation of adaptor class DownloadAdaptor
 */

DownloadAdaptor::DownloadAdaptor(QObject *parent)
    : QDBusAbstractAdaptor(parent)
{
    // constructor
    setAutoRelaySignals(true);
}

DownloadAdaptor::~DownloadAdaptor()
{
    // destructor
}

QString DownloadAdaptor::clickPackage() const
{
    // get the value of property ClickPackage
    return qvariant_cast< QString >(parent()->property("ClickPackage"));
}

QString DownloadAdaptor::destinationApp() const
{
    // get the value of property DownloadOwner
    return qvariant_cast< QString >(parent()->property("DownloadOwner"));
}

bool DownloadAdaptor::showInIndicator() const
{
    // get the value of property ShowInIndicator
    return qvariant_cast< bool >(parent()->property("ShowInIndicator"));
}

QString DownloadAdaptor::title() const
{
    // get the value of property Title
    return qvariant_cast< QString >(parent()->property("Title"));
}

void DownloadAdaptor::allowGSMDownload(bool allowed)
{
    // handle method call com.lomiri.applications.Download.allowGSMDownload
    QMetaObject::invokeMethod(parent(), "allowGSMDownload", Q_ARG(bool, allowed));
}

void DownloadAdaptor::cancel()
{
    // handle method call com.lomiri.applications.Download.cancel
    QMetaObject::invokeMethod(parent(), "cancel");
}

void DownloadAdaptor::collected()
{
    // handle method call com.lomiri.applications.Download.collected
    QMetaObject::invokeMethod(parent(), "collected");
}

QString DownloadAdaptor::filePath()
{
    // handle method call com.lomiri.applications.Download.filePath
    QString filePath;
    QMetaObject::invokeMethod(parent(), "filePath", Q_RETURN_ARG(QString, filePath));
    return filePath;    
}

StringMap DownloadAdaptor::headers()
{
    // handle method call com.lomiri.applications.Download.headers
    StringMap headers;
    QMetaObject::invokeMethod(parent(), "headers", Q_RETURN_ARG(StringMap, headers));
    return headers;
}

bool DownloadAdaptor::isGSMDownloadAllowed()
{
    // handle method call com.lomiri.applications.Download.isGSMDownloadAllowed
    bool allowed;
    QMetaObject::invokeMethod(parent(), "isGSMDownloadAllowed", Q_RETURN_ARG(bool, allowed));
    return allowed;
}

QVariantMap DownloadAdaptor::metadata()
{
    // handle method call com.lomiri.applications.Download.metadata
    QVariantMap data;
    QMetaObject::invokeMethod(parent(), "metadata", Q_RETURN_ARG(QVariantMap, data));
    return data;
}

void DownloadAdaptor::pause()
{
    // handle method call com.lomiri.applications.Download.pause
    QMetaObject::invokeMethod(parent(), "pause");
}

qulonglong DownloadAdaptor::progress()
{
    // handle method call com.lomiri.applications.Download.progress
    qulonglong received;
    QMetaObject::invokeMethod(parent(), "progress", Q_RETURN_ARG(qulonglong, received));
    return received;
}

void DownloadAdaptor::resume()
{
    // handle method call com.lomiri.applications.Download.resume
    QMetaObject::invokeMethod(parent(), "resume");
}

void DownloadAdaptor::setDestinationDir(const QString &path)
{
    // handle method call com.lomiri.applications.Download.setDestinationDir
    QMetaObject::invokeMethod(parent(), "setDestinationDir", Q_ARG(QString, path));
}

void DownloadAdaptor::setHeaders(StringMap headers)
{
    // handle method call com.lomiri.applications.Download.setHeaders
    QMetaObject::invokeMethod(parent(), "setHeaders", Q_ARG(StringMap, headers));
}

void DownloadAdaptor::setMetadata(const QVariantMap &data)
{
    // handle method call com.lomiri.applications.Download.setMetadata
    QMetaObject::invokeMethod(parent(), "setMetadata", Q_ARG(QVariantMap, data));
}

void DownloadAdaptor::setThrottle(qulonglong speed)
{
    // handle method call com.lomiri.applications.Download.setThrottle
    QMetaObject::invokeMethod(parent(), "setThrottle", Q_ARG(qulonglong, speed));
}

void DownloadAdaptor::start()
{
    // handle method call com.lomiri.applications.Download.start
    QMetaObject::invokeMethod(parent(), "start");
}

int DownloadAdaptor::state()
{
    // handle method call com.lomiri.applications.Download.state
    int state;
    QMetaObject::invokeMethod(parent(), "stateInt", Q_RETURN_ARG(int, state));
   
    return state;
}

qulonglong DownloadAdaptor::throttle()
{
    // handle method call com.lomiri.applications.Download.throttle
    qulonglong speed;
    QMetaObject::invokeMethod(parent(), "throttle", Q_RETURN_ARG(qulonglong, speed));
    return speed;
}

qulonglong DownloadAdaptor::totalSize()
{
    // handle method call com.lomiri.applications.Download.totalSize
    qulonglong total;
    QMetaObject::invokeMethod(parent(), "totalSize", Q_RETURN_ARG(qulonglong, total));
    return total;
}

