OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
refidadapter.hpp
Go to the documentation of this file.
1 #ifndef CSM_WOLRD_REFIDADAPTER_H
2 #define CSM_WOLRD_REFIDADAPTER_H
3 
4 #include <string>
5 #include <vector>
6 
14 class QVariant;
15 
16 namespace CSMWorld
17 {
18  class RefIdColumn;
19  class RefIdData;
20  struct RecordBase;
21  struct NestedTableWrapperBase;
22  class HelperBase;
23 
25  {
26  // not implemented
27  RefIdAdapter (const RefIdAdapter&);
29 
30  public:
31 
32  RefIdAdapter();
33 
34  virtual ~RefIdAdapter();
35 
36  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int idnex)
37  const = 0;
39 
40  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
41  const QVariant& value) const = 0;
43 
44  virtual std::string getId (const RecordBase& record) const = 0;
45 
46  virtual void setId(RecordBase& record, const std::string& id) = 0; // used by RefIdCollection::cloneRecord()
47  };
48 
50  {
51  public:
53 
54  virtual ~NestedRefIdAdapterBase();
55 
56  virtual void setNestedData (const RefIdColumn *column,
57  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const = 0;
58 
59  virtual QVariant getNestedData (const RefIdColumn *column,
60  const RefIdData& data, int index, int subRowIndex, int subColIndex) const = 0;
61 
62  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const = 0;
63 
64  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const = 0;
65 
66  virtual void removeNestedRow (const RefIdColumn *column,
67  RefIdData& data, int index, int rowToRemove) const = 0;
68 
69  virtual void addNestedRow (const RefIdColumn *column,
70  RefIdData& data, int index, int position) const = 0;
71 
72  virtual void setNestedTable (const RefIdColumn* column,
73  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const = 0;
74 
75  virtual NestedTableWrapperBase* nestedTable (const RefIdColumn* column,
76  const RefIdData& data, int index) const = 0;
77  };
78 }
79 
80 #endif
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const =0
virtual ~NestedRefIdAdapterBase()
Definition: refidadapter.cpp:9
Definition: nestedtablewrapper.hpp:6
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const =0
virtual std::string getId(const RecordBase &record) const =0
RefIdAdapter & operator=(const RefIdAdapter &)
Definition: refiddata.hpp:219
Definition: refidadapter.hpp:24
virtual void setId(RecordBase &record, const std::string &id)=0
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const =0
Definition: refidcollection.hpp:24
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const =0
NestedRefIdAdapterBase()
Definition: refidadapter.cpp:7
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const =0
virtual ~RefIdAdapter()
Definition: refidadapter.cpp:5
RefIdAdapter()
Definition: refidadapter.cpp:3
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const =0
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int idnex) const =0
If called on the nest column, should return QVariant(true).
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const =0
Definition: record.hpp:8
Definition: refidadapter.hpp:49
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const =0
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const =0
If the data type does not match an exception is thrown.