#ifndef HELPER_H
#define HELPER_H

#include <QString>
#include <QObject>
#include <QMap>
#include <QDir>
#include <QPushButton>
#include <QComboBox>
#include <QCryptographicHash>
#include "LotroDat.h"

class Helper:public QObject {
    Q_OBJECT
   public:
    Helper();
    Helper( const Helper&);
    Helper& operator=( Helper& );
    int getVersion(QString string);
    QMap <QString, QString> getPathsMap();
    QMap <QString, QString> htmlColors;

    void checkTab(QString tabname);
    bool fileExists(QString path);
    void loadNews();
    void loadHelp();
    void hideAll();
    void setAbout();
    void findSkins();
    void prepareMicroPatch();
    void saveLocale(int locale, QPushButton *button);
    QString getSkinName();
    void setState(QString state);
    void applyShadow(QWidget *obj, QString color, int blur, int offset_x, int offset_y);
    void myDialogBox(QString text, QString info, QString okText, QString cancelText, QString image,
                   QString okAnswer, QString cancelAnswer, int w, int h, bool textshadow, bool is_cancel);
    QString fileHash(const QString &fileName, QCryptographicHash::Algorithm hashAlgorithm);
    int dateToTimestamp(QString customDateString, QString format);
    void addComboItem(QComboBox* combo, QString itemName, QIcon* icon);
    bool setGameLocale(QString locale);
    void startGame();

    bool openDatFile(int id);
    void closeDatFile(int id);
    void applyPatch(QString name);
    void processFile();
    const char *stringToChar(QString val);
    void applyGlobal();
    bool isDatReady();
    void replaceSkin(QString name);
    void applyMicroPatch();
    void installMicroPatch();
    void applyLoadscreens();
    int checkDatFile();
    void clearFolder(QDir &dir);
    QByteArray ba;
    QString dialog_ok_answer;
    QString dialog_cancel_answer;
    LOTRO_DAT::LOCALE dat_locale;

private slots:
    void handleFinisheddd();
};


#endif // HELPER_H
