#ifndef CONSOLEOUTMODEL_H
#define CONSOLEOUTMODEL_H

#include <QtGui>

//should I have a namespace for this??

namespace ConsoleOut{
    enum OutputType{Verbose, Information, Error, Fatal};
}

class ConsoleOutModel : public QAbstractListModel
{
    Q_OBJECT

public:
    ConsoleOutModel(QWidget *parent);
    ~ConsoleOutModel(){}
    int rowCount(const QModelIndex &parent = QModelIndex()) const{
        return dataListDisplay.length();
    };
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation,
                                              int role) const;
    //helpers
    void consoleVerbose(QString text);
    void consoleInformation(QString text);
    void consoleError(QString text);
    void consoleFatal(QString text);

private:
    QStringList dataList, dataListDisplay;
    QList<ConsoleOut::OutputType> outputTypeList, outputTypeListDisplay;

    bool filterVerbose, filterInformation, filterError, filterFatal;
    void buildDisplayList();

public slots:
    void changeFilterVerbose(bool filterVerbose);
    void changefilterInformation(bool filterInformation);
    void changeFilterError(bool filterError);
    void changeFilterFatal(bool filterFatal);
    void receiveConsoleOut(QString text, ConsoleOut::OutputType type);

};

#endif // CONSOLEOUTMODEL_H
