OpenMW
apps/opencs/model/tools/reportmodel.hpp
Go to the documentation of this file.
00001 #ifndef CSM_TOOLS_REPORTMODEL_H
00002 #define CSM_TOOLS_REPORTMODEL_H
00003 
00004 #include <vector>
00005 #include <string>
00006 
00007 #include <QAbstractTableModel>
00008 
00009 #include "../world/universalid.hpp"
00010 
00011 namespace CSMTools
00012 {
00013     class ReportModel : public QAbstractTableModel
00014     {
00015             Q_OBJECT
00016 
00017             std::vector<std::pair<CSMWorld::UniversalId, std::string> > mRows;
00018 
00019         public:
00020 
00021             virtual int rowCount (const QModelIndex & parent = QModelIndex()) const;
00022 
00023             virtual int columnCount (const QModelIndex & parent = QModelIndex()) const;
00024 
00025             virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const;
00026 
00027             virtual QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00028 
00029             virtual bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex());
00030 
00031             void add (const std::string& row);
00032 
00033             const CSMWorld::UniversalId& getUniversalId (int row) const;
00034     };
00035 }
00036 
00037 #endif