Skip to content
Snippets Groups Projects
xdgurl.h 781 B
Newer Older
akiraohgaki's avatar
akiraohgaki committed
#ifndef HANDLERS_XDGURL_H
#define HANDLERS_XDGURL_H

#include <QObject>
//#include <QJsonObject>

//class QNetworkReply;

namespace Core {
class Config;
class Network;
}

namespace Handlers {

class XdgUrl : public QObject
{
    Q_OBJECT

private:
akiraohgaki's avatar
akiraohgaki committed
    QString _xdgUrl;
akiraohgaki's avatar
akiraohgaki committed
    Core::Config *_appConfig;
    Core::Config *_userConfig;
    Core::Network *_asyncNetwork;

public:
akiraohgaki's avatar
akiraohgaki committed
    explicit XdgUrl(const QString &xdgUrl, Core::Config *appConfig, Core::Config *userConfig, Core::Network *asyncNetwork, QObject *parent = 0);
akiraohgaki's avatar
akiraohgaki committed

private:
akiraohgaki's avatar
akiraohgaki committed
    bool _download();
    bool _install();
akiraohgaki's avatar
akiraohgaki committed

private slots:

public slots:
akiraohgaki's avatar
akiraohgaki committed
    bool process();
akiraohgaki's avatar
akiraohgaki committed

signals:
akiraohgaki's avatar
akiraohgaki committed
    void downloaded(const QString &metadata);
    void installed(const QString &metadata);
akiraohgaki's avatar
akiraohgaki committed

};

} // namespace Handlers

#endif // HANDLERS_XDGURL_H