#ifndef TABULKA_H
#define TABULKA_H

#include <QMainWindow>

#include <QFile>
#include <QMessageBox>
#include <QTextStream>
#include <QStringList>
#include <QList>
#include <QFileDialog>

#include <math.h>

#include <qfile.h>
#include <qtextstream.h>
#include <QClipboard>
#include <iostream>


struct BOD {
    float x;
    float y;
    float r;
    BOD(){this->x=0;this->y=0;this->r=0;};
    BOD(float xx,float yy,float rr){x=xx;y=yy;r=rr;}
    BOD(const BOD &s):x(s.x),y(s.y),r(s.r){} // copy constructor
    bool operator<(const BOD &druhy) const;
};


namespace Ui {
    class Tabulka;
}

class Tabulka : public QMainWindow {
    Q_OBJECT
public:
    Tabulka(QWidget *parent = 0);
    ~Tabulka();
     QClipboard *cb;

protected:
    void changeEvent(QEvent *e);

//void resizeEvent(QResizeEvent *event);

private:
    Ui::Tabulka *ui;
    void add_row(QStringList text);
    void Parse_File(QString file_name);
    BOD Parse_Headr(QString line);
    BOD Parse_Metody(QString line);


    void vypis_zaklad();
    void vypis_chyby();
    void vypis_chyby_bez_natoceni();
    void vypis_chyby_jen_natoceni();
    void vypis_cas_normalizuj();

    QString prepocet(BOD ref, BOD a);
    QString chyba(BOD ref, BOD a);

    QList<BOD> ref_hodnoty;
    QList<BOD> cis_hodnoty;
    QList<BOD> ras_hodnoty;
    QList<BOD> cisras_hodnoty;
    QList<BOD> korel_hodnoty;
    QList<BOD> hd_hodnoty;
    QList<BOD> hhd_hodnoty;

public slots:
    void button_clicked();
    void copy_to_clipboard();
    void vypis();
    void vypis(int x);
};

#endif // TABULKA_H
