#ifndef LISTSWITCHER_H
#define LISTSWITCHER_H

#include "switcher.h"
#include <QMap>
#include <QTableWidget>
#include <QHeaderView>
#include <QDebug>
#include <QMapIterator>
#include <QList>
#include <QDomElement>
#include <QTableWidget>
#include <QHeaderView>
#include <QHBoxLayout>
#include <QPushButton>
#include <QSpacerItem>
#include "components/appendabletablewidget.h"

class ListSwitcher : public Switcher
{
private:
    QString separator;
    QMap<QString, QList<QString> > values;
    bool fixedLength;
    QWidget *widget;
    AppendableTableWidget *table;
    QPushButton *pushb;
    QHBoxLayout *hlayout;
    QList<QTableWidget*> tables;

    void zerosToTable(QTableWidget *table);

public:
    ListSwitcher();
    ~ListSwitcher();

    void setFixedLength(bool fl) {fixedLength = fl;}
    bool getFixedLength() {return fixedLength;}

    QMap<QString, QList<QString> >& getValues() {return values;}

    void setSeparator(QString separator){
        this->separator=separator;
    }

    void setValues(QMap<QString,QList<QString> > values){
        this->values = values;
    }

    virtual QWidget* getComponent(QWidget *parent);

    virtual QString buildSwitcherString();

    virtual void setValuesFromNode(QDomElement &el);

    virtual QDomNode& getProjectNode(QDomElement &el);

    virtual void setSavedValues(QDomElement &el);
};

#endif // LISTSWITCHER_H

