/** SubClass of Abstract List Model, deals with list of scripts**/

#ifndef SCRIPTLISTMODEL_H
#define SCRIPTLISTMODEL_H

#include <QtGui>
#include "consoleoutmodel.h"  //For ConsoleOut namespace

class ScriptListModel : public QAbstractListModel
{
    Q_OBJECT

public:
    ScriptListModel(QObject *parent, QString *scriptsFolderPath);

    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation,
                        int role = Qt::DisplayRole) const;

    //Helpers for me..
    QString getName(int row);
    QString getPath(int row);
    QString getRequire(int row);
    QString getOptional(int row);
    QString getDecription(int row);
    QString getReturn(int row);

    void refresh();

private:
    QString *scriptsFolderPath;

    QStringList nameList;
    QStringList pathList;
    QStringList requireList;
    QStringList optionalList;
    QStringList descriptionList;
    QStringList returnList;

signals:
    void sendConsoleOut(QString text, ConsoleOut::OutputType);
};


#endif // SCRIPTLISTMODEL_H
