#ifndef FILEDOWNLOADER_H
#define FILEDOWNLOADER_H

#include <QtCore/QObject>
#include <QtCore/QByteArray>

#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>

class FileDownloader : public QObject
{
 Q_OBJECT
 public:
  explicit FileDownloader(QUrl imageUrl, QObject *parent = 0);
  virtual ~FileDownloader();
  QByteArray downloadedData() const;

 signals:
  void downloaded();

 private slots:
  void fileDownloaded(QNetworkReply* pReply);
  private:
  QNetworkAccessManager m_WebCtrl;
  QByteArray m_DownloadedData;
};

#endif // FILEDOWNLOADER_H

class download : public QObject
{
	Q_OBJECT

public:
	download(QObject *parent = 0);
	~download();

	public slots:

		void unsupportedContent(QNetworkReply *);
		void loadImage();
		void go();
};