#ifndef KOREL_SETTING_H
#define KOREL_SETTING_H

#include <QWidget>
#include <QTime>

#include <my_image.h>
#include "korel_form.h"

#include <korelace/korelace.h>


#include <lib.h>


namespace Ui {
    class korel_setting;
}

class korel_setting : public QWidget {
    Q_OBJECT
public:
    korel_setting(QWidget *parent = 0);
    ~korel_setting();
    void load_image(my_image *img);
    void load_ref_image(my_image *img);

    int Time_ref;
    int Time;
    std::vector<BOD> position;

protected:
    void changeEvent(QEvent *e);
    void delete_method();
    void btn_method_enabled(bool state);//hromadne zakazani stisku talcitek implementovanych metod(napr. pri nacteni noveho obrazu)
    korel_form * form;
    my_image * image;
    my_image *image_ref;
    korelace * korel;


    QPalette paletteOK;
    QPalette paletteERR;
    bool ResultIsValid;
    bool CanRun;

private:
    Ui::korel_setting *ui;

public slots:
   // void ShowResult();
   // void ShowForm();//pri kliku na tlacitko zobraz formular
    void RefImageIsLoaded();//signal prjde pokud uzivatel nacte novy obraz - povoleni tlacitka pro nacteni obrazu do tridy
    void ImageIsLoaded();//signal prjde pokud uzivatel nacte novy obraz - povoleni tlacitka pro nacteni obrazu do tridy

    void NeedLoadRefImage();//tato funkce vysle signal hlavnimu oknu aby hlavni okno nacetlo obraz do tridy
    void NeedLoadImage();//tato funkce vysle signal hlavnimu oknu aby hlavni okno nacetlo obraz do tridy

    void korel_btn_clicked();//kliknuto na tlacitko pro rass metodu
    void korel_btn_run_clicked();
    void korel_btn_show_clicked();

    void show_form();
    void form_closed();
signals:
    void NeedLoadRef(int i);
    void NeedLoadImg(int i);
};

#endif // KOREL_SETTING_H
