#ifndef GIFANIMATIONDEMOWIDGET_H
#define GIFANIMATIONDEMOWIDGET_H
#include <QApplication>
#include <QWidget>
#include <QLabel>
#include <QFile>
#include <QFileInfo>
#include <QStandardPaths>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QMovie>
#include <QUrl>
#include <QDir>
#include <QThread>
#include <QtConcurrent/QtConcurrent>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QVideoWidget>

namespace Ui {
class GIFAnimationDemoWidget;
}

class GIFAnimationDemoWidget : public QWidget {
    Q_OBJECT

public:
    explicit GIFAnimationDemoWidget( QWidget* parent = 0 );
    ~GIFAnimationDemoWidget();

    QString df_url;
    QString df_path;
    QNetworkAccessManager *m_NetworkMngr;
    QNetworkReply *reply;

    void downloadFile(const QString &url, const QString &aPathInClient);
    QString getFilelist(const QString &url);
    void makeFolder(QString path);
    bool fileExists(QString path);
    QString fileHash(const QString &fileName, QCryptographicHash::Algorithm hashAlgorithm);
    void start(QString filelist);


public slots:

private slots:
    void startNewAnimation();

private:
    Ui::GIFAnimationDemoWidget* ui;

    QMovie * movie;
    QMediaPlayer *player;
    QMediaPlaylist *playlist;
    QVideoWidget *videoWidget;
};

#endif // GIFANIMATIONDEMOWIDGET_H
