OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
resourcetable.hpp
Go to the documentation of this file.
1 #ifndef CSM_WOLRD_RESOURCETABLE_H
2 #define CSM_WOLRD_RESOURCETABLE_H
3 
4 #include "idtablebase.hpp"
5 
6 namespace CSMWorld
7 {
8  class Resources;
9 
10  class ResourceTable : public IdTableBase
11  {
13 
14  public:
15 
17  ResourceTable (const Resources *resources, unsigned int features = 0);
18 
19  virtual ~ResourceTable();
20 
21  virtual int rowCount (const QModelIndex & parent = QModelIndex()) const;
22 
23  virtual int columnCount (const QModelIndex & parent = QModelIndex()) const;
24 
25  virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const;
26 
27  virtual QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
28 
29  virtual bool setData ( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
30 
31  virtual Qt::ItemFlags flags (const QModelIndex & index) const;
32 
33  virtual QModelIndex index (int row, int column, const QModelIndex& parent = QModelIndex())
34  const;
35 
36  virtual QModelIndex parent (const QModelIndex& index) const;
37 
38  virtual QModelIndex getModelIndex (const std::string& id, int column) const;
39 
42  virtual int searchColumnIndex (Columns::ColumnId id) const;
43 
46  virtual int findColumnIndex (Columns::ColumnId id) const;
47 
50  virtual std::pair<UniversalId, std::string> view (int row) const;
51 
53  virtual bool isDeleted (const std::string& id) const;
54 
55  virtual int getColumnId (int column) const;
56  };
57 }
58 
59 #endif
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: resourcetable.cpp:31
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Definition: resourcetable.cpp:80
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: resourcetable.cpp:45
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: resourcetable.cpp:86
const Resources * mResources
Definition: resourcetable.hpp:12
virtual int getColumnId(int column) const
Definition: resourcetable.cpp:147
virtual std::pair< UniversalId, std::string > view(int row) const
Definition: resourcetable.cpp:137
virtual ~ResourceTable()
Definition: resourcetable.cpp:13
Definition: resources.hpp:17
virtual int findColumnIndex(Columns::ColumnId id) const
Definition: resourcetable.cpp:127
ResourceTable(const Resources *resources, unsigned int features=0)
Definition: resourcetable.cpp:9
virtual QModelIndex getModelIndex(const std::string &id, int column) const
Definition: resourcetable.cpp:111
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: resourcetable.cpp:23
virtual bool isDeleted(const std::string &id) const
Is id flagged as deleted?
Definition: resourcetable.cpp:142
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: resourcetable.cpp:91
ColumnId
Definition: columns.hpp:13
Definition: idtablebase.hpp:12
Definition: resourcetable.hpp:10
virtual int searchColumnIndex(Columns::ColumnId id) const
Definition: resourcetable.cpp:116
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: resourcetable.cpp:15
virtual QModelIndex parent(const QModelIndex &index) const
Definition: resourcetable.cpp:106