1 #ifndef CSM_WOLRD_NESTEDCOLLECTION_H 2 #define CSM_WOLRD_NESTEDCOLLECTION_H 3 4 #include "columns.hpp" 5 6 class QVariant; 7 8 namespace CSMWorld 9 { 10 class NestableColumn; 11 struct NestedTableWrapperBase; 12 13 class NestedCollection 14 { 15 16 public: 17 18 NestedCollection(); 19 virtual ~NestedCollection(); 20 21 virtual void addNestedRow(int row, int col, int position) = 0; 22 23 virtual void removeNestedRows(int row, int column, int subRow) = 0; 24 25 virtual QVariant getNestedData(int row, int column, int subRow, int subColumn) const = 0; 26 27 virtual void setNestedData(int row, int column, const QVariant& data, int subRow, int subColumn) = 0; 28 29 virtual NestedTableWrapperBase* nestedTable(int row, int column) const = 0; 30 31 virtual void setNestedTable(int row, int column, const NestedTableWrapperBase& nestedTable) = 0; 32 33 virtual int getNestedRowsCount(int row, int column) const; 34 35 virtual int getNestedColumnsCount(int row, int column) const; 36 37 virtual NestableColumn *getNestableColumn(int column) = 0; 38 39 virtual int searchNestedColumnIndex(int parentColumn, Columns::ColumnId id); 40 ///< \return the column index or -1 if the requested column wasn't found. 41 42 virtual int findNestedColumnIndex(int parentColumn, Columns::ColumnId id); 43 ///< \return the column index or throws an exception if the requested column wasn't found. 44 }; 45 } 46 47 #endif // CSM_WOLRD_NESTEDCOLLECTION_H 48