#ifndef _DCFILEHASHER_H_
#define _DCFILEHASHER_H_

#include <QDialog>
#include <QThread>
#include <dclib/cfilehasher.h>


#include "DCDialogFileHasher.h"

class QTimer;
class CByteArray;

class DCHashThread: public QThread{
    Q_OBJECT

    public:
        DCHashThread();
        virtual ~DCHashThread();

        void run();

        void setFile(QString);
        QString getHash();

    protected:
        void calculate_tth();
    private:
        CFileHasher *file_hasher;
        QString file_name, hash;
};

class DCFileHasher: public QDialog, private Ui::DCDialogFileHasher{
    Q_OBJECT

    public:

        DCFileHasher(QWidget *parent = NULL);
        virtual ~DCFileHasher();

    protected:
        void initDocument();

    private slots:
        void slotStart();
        void slotBrowse();
        void slotDone();
        void slotMagnet();

    private:
        DCHashThread *hasher;
};

#endif //_DCFILEHASHER_H_
