2012-12-11 14:35:47 +00:00
|
|
|
#ifndef CSM_TOOLS_REPORTMODEL_H
|
|
|
|
#define CSM_TOOLS_REPORTMODEL_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
|
|
|
#include "../world/universalid.hpp"
|
|
|
|
|
|
|
|
namespace CSMTools
|
|
|
|
{
|
|
|
|
class ReportModel : public QAbstractTableModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2015-03-29 11:43:11 +00:00
|
|
|
struct Line
|
|
|
|
{
|
|
|
|
Line (const CSMWorld::UniversalId& id, const std::string& message,
|
|
|
|
const std::string& hint);
|
|
|
|
|
|
|
|
CSMWorld::UniversalId mId;
|
|
|
|
std::string mMessage;
|
|
|
|
std::string mHint;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<Line> mRows;
|
2012-12-11 14:35:47 +00:00
|
|
|
|
2015-03-29 11:55:31 +00:00
|
|
|
enum Columns
|
|
|
|
{
|
|
|
|
Column_Type = 0, Column_Id = 1, Column_Hint = 2, Column_Description = 3
|
|
|
|
};
|
|
|
|
|
2012-12-11 14:35:47 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
virtual int rowCount (const QModelIndex & parent = QModelIndex()) const;
|
|
|
|
|
|
|
|
virtual int columnCount (const QModelIndex & parent = QModelIndex()) const;
|
|
|
|
|
|
|
|
virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const;
|
|
|
|
|
|
|
|
virtual QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
|
|
|
|
|
|
|
virtual bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex());
|
|
|
|
|
2014-12-06 12:45:47 +00:00
|
|
|
void add (const CSMWorld::UniversalId& id, const std::string& message,
|
|
|
|
const std::string& hint = "");
|
2012-12-12 21:36:20 +00:00
|
|
|
|
|
|
|
const CSMWorld::UniversalId& getUniversalId (int row) const;
|
2014-12-06 12:45:47 +00:00
|
|
|
|
|
|
|
std::string getHint (int row) const;
|
2015-03-28 11:53:01 +00:00
|
|
|
|
|
|
|
void clear();
|
2012-12-11 14:35:47 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|