#ifndef SEARCHINBLOBS_H
#define SEARCHINBLOBS_H

#include "ui_searchinblobs.h"

#include <QWidget>
#include <QSqlDatabase>
#include <QStandardItemModel>


class Searchinblobs:public QWidget,public Ui::SearchInBlobs
{
    Q_OBJECT
    public:
        Searchinblobs (QObject * parent = 0);
        ~Searchinblobs ();
    
    private slots :
        void parse();
        void addarequest();
        void deleterequest();
        void deleteSearchinBlobs();
    private:
        void initialise();
        QStringList allIdWitchContainsVariable(QString comparevariable,int row);
        QStringList allIdWhoseVariableIsInfTo(QString variable,QString comparevariable,int row);
        QHash<QString,QString> setHashIdAndNamesOfResults(QStringList resultList);
        QStringList searchInfInDocuments(QString blob,QString refDos,QString tableblobs,QString idprimkeyblob,QString idblob,QString variable,QString comparevariable, int indexOfNumberToCompare);
        QStringList searchInTerrain(QString blob,QString refDos,QString tableblobs,QString idprimkeyblob,QString idblob,QString variable,QString comparevariable,int row);
        QStringList searchInObservation(QString blob,QString refDos,QString tableblobs,QString idprimkeyblob,QString idblob,QString variable,QString comparevariable,int row);
        QSqlDatabase m_db;
        QStandardItemModel * m_analyseModel;
        QStandardItemModel * m_resultsModel;
        QHash<int,QString> m_hashConditions;
        QStringList m_listOfReturnedIdWithConjunction;
};

#endif

