#ifndef UPDATECONTROLLER_H
#define UPDATECONTROLLER_H

#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include <QXmlStreamAttribute>
#include <QCryptographicHash>
#include <QDirIterator>
#include <QFile>
#include <QTextStream>
#include <QDateTime>
#include <QDebug>
#include <QList>
#include <QObject>
#include <QDialogButtonBox>

#include <Data\FileData.h>
#include <Core\dataparser.h>
#include <Core\tcpclient.h>
#include <Data\streamingversiondata.h>

class SendSystem;
class MainWindow;
class DataParser;
class VersionContainer;

class UpdateController : public QObject
{

    Q_OBJECT

public:
    explicit UpdateController(DataParser *parser,
                              SendSystem *sendSystem,
                              QObject *parent = 0);

    void initialize(MainWindow *mainWindow,VersionContainer *versionContainer);
    void calculateCommonHash();
    void calculateStreamingHash();
    ~UpdateController();

    void updateFilesOnServer(QList<FileData> *fileSendList);

signals:
    void sigUpdateComplete(bool flag);
private:
    DataParser *dataParser;
    SendSystem *sendSystem;
    QString applicationFolderPath;
    VersionContainer *versionContainer;
    QList<FileData> appDataList;
    QList<FileData> streamingDataList;

    QList<FileData> calculateHash(QString path,QString ignoreName);
};



#endif // UPDATECONTROLLER_H
