#ifndef SDATADLG_H
#define SDATADLG_H

#include <QDialog>
#include <QTabWidget>
#include <QTableWidget>

#include "../common.h"

class SDataDlg : public QDialog
{
    Q_OBJECT
public:
    SDataDlg();
    ~SDataDlg();
    void setWidgets();
    QTableWidget *AddTable(QString _str);
    void DataReload(QString _strTableName,int _nSelect);
    QTableWidget *GetCurrentWidget() { return (QTableWidget *)m_ptab->currentWidget();}
    int GetCurrentArticle();
    void InsertCopyRow(int _nRow,QTableWidget *_pCurrent,QTableWidget *_pNew);

    void SearchDate(QDate _dtStart,QDate _dtEnd);
    void SearchCounter(int _nCatalogIndex,int _nCompIndex,int _nInsDelIndex,int _nCounter);
    void SearchLength(int _nCatalogIndex,int _nCompIndex,int _nInsDelIndex,int _nLength);
    void SearchReplace(int _nCatalogIndex,int _nReplaceFindIndex,int _nReplaceIndex,QString _strFind,QString _strReplace);
    void SearchKeyword(QVector <SKeyword> _vecKeyword);
    void Import(QVector <QByteArray> _vecImport);
    void Export(QString _strFilename);
    QTabWidget* GetCurrentTab() { return m_ptab; }

    //void SearchCounter(int _nCatalogIndex,int _nCompIndex,int _nInsDelIndex,QString _strCounter);
private:
    QTabWidget *m_ptab;    
private slots:
    void DoubleClickTab(int index);
    void CloseTab(int index);
};

#endif // SDATADLG_H
