OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CSMWorld::IdTable Class Reference

#include <idtable.hpp>

Inheritance diagram for CSMWorld::IdTable:
Collaboration diagram for CSMWorld::IdTable:

Public Member Functions

 IdTable (CollectionBase *idCollection, unsigned int features=0)
 The ownership of idCollection is not transferred. More...
 
virtual ~IdTable ()
 
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 setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 
virtual bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex())
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
virtual QModelIndex parent (const QModelIndex &index) const
 
void addRecord (const std::string &id, UniversalId::Type type=UniversalId::Type_None)
 
void addRecordWithData (const std::string &id, const std::map< int, QVariant > &data, UniversalId::Type type=UniversalId::Type_None)
 
void cloneRecord (const std::string &origin, const std::string &destination, UniversalId::Type type=UniversalId::Type_None)
 
virtual QModelIndex getModelIndex (const std::string &id, int column) const
 This method can return only indexes to the top level table cells. More...
 
void setRecord (const std::string &id, const RecordBase &record, UniversalId::Type type=UniversalId::Type_None)
 Add record or overwrite existing record. More...
 
const RecordBasegetRecord (const std::string &id) const
 
virtual int searchColumnIndex (Columns::ColumnId id) const
 Return index of column with the given id. If no such column exists, -1 is returned. More...
 
virtual int findColumnIndex (Columns::ColumnId id) const
 
void reorderRows (int baseIndex, const std::vector< int > &newOrder)
 
virtual std::pair< UniversalId,
std::string > 
view (int row) const
 
virtual bool isDeleted (const std::string &id) const
 Is id flagged as deleted? More...
 
virtual int getColumnId (int column) const
 
- Public Member Functions inherited from CSMWorld::IdTableBase
 IdTableBase (unsigned int features)
 
unsigned int getFeatures () const
 

Protected Member Functions

virtual CollectionBaseidCollection () const
 

Private Member Functions

 IdTable (const IdTable &)
 
IdTableoperator= (const IdTable &)
 

Private Attributes

CollectionBasemIdCollection
 

Additional Inherited Members

- Public Types inherited from CSMWorld::IdTableBase
enum  Features {
  Feature_ReorderWithinTopic = 1, Feature_ViewId = 2, Feature_ViewCell = 4, Feature_View = Feature_ViewId | Feature_ViewCell,
  Feature_Preview = 8, Feature_Constant = 16
}
 

Constructor & Destructor Documentation

CSMWorld::IdTable::IdTable ( const IdTable )
private
CSMWorld::IdTable::IdTable ( CollectionBase idCollection,
unsigned int  features = 0 
)

The ownership of idCollection is not transferred.

CSMWorld::IdTable::~IdTable ( )
virtual

Member Function Documentation

void CSMWorld::IdTable::addRecord ( const std::string &  id,
UniversalId::Type  type = UniversalId::Type_None 
)
Parameters
typeWill be ignored, unless the collection supports multiple record types
void CSMWorld::IdTable::addRecordWithData ( const std::string &  id,
const std::map< int, QVariant > &  data,
UniversalId::Type  type = UniversalId::Type_None 
)
Parameters
typeWill be ignored, unless the collection supports multiple record types
void CSMWorld::IdTable::cloneRecord ( const std::string &  origin,
const std::string &  destination,
UniversalId::Type  type = UniversalId::Type_None 
)
int CSMWorld::IdTable::columnCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Reimplemented in CSMWorld::IdTree.

Here is the caller graph for this function:

QVariant CSMWorld::IdTable::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
virtual

Reimplemented in CSMWorld::IdTree.

Here is the caller graph for this function:

int CSMWorld::IdTable::findColumnIndex ( Columns::ColumnId  id) const
virtual

Return index of column with the given id. If no such column exists, an exception is thrown.

Implements CSMWorld::IdTableBase.

Here is the caller graph for this function:

Qt::ItemFlags CSMWorld::IdTable::flags ( const QModelIndex &  index) const
virtual

Reimplemented in CSMWorld::IdTree.

Here is the caller graph for this function:

int CSMWorld::IdTable::getColumnId ( int  column) const
virtual

Implements CSMWorld::IdTableBase.

QModelIndex CSMWorld::IdTable::getModelIndex ( const std::string &  id,
int  column 
) const
virtual

This method can return only indexes to the top level table cells.

Implements CSMWorld::IdTableBase.

Here is the caller graph for this function:

const CSMWorld::RecordBase & CSMWorld::IdTable::getRecord ( const std::string &  id) const

Here is the caller graph for this function:

QVariant CSMWorld::IdTable::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual

Here is the caller graph for this function:

CSMWorld::CollectionBase * CSMWorld::IdTable::idCollection ( ) const
protectedvirtual
QModelIndex CSMWorld::IdTable::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
virtual

Reimplemented in CSMWorld::IdTree.

Here is the caller graph for this function:

bool CSMWorld::IdTable::isDeleted ( const std::string &  id) const
virtual

Is id flagged as deleted?

For top level data/columns.

Implements CSMWorld::IdTableBase.

IdTable& CSMWorld::IdTable::operator= ( const IdTable )
private
QModelIndex CSMWorld::IdTable::parent ( const QModelIndex &  index) const
virtual

Reimplemented in CSMWorld::IdTree.

bool CSMWorld::IdTable::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
virtual

Reimplemented in CSMWorld::IdTree.

Here is the caller graph for this function:

void CSMWorld::IdTable::reorderRows ( int  baseIndex,
const std::vector< int > &  newOrder 
)

Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices given in newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex).

int CSMWorld::IdTable::rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Reimplemented in CSMWorld::IdTree.

Here is the caller graph for this function:

int CSMWorld::IdTable::searchColumnIndex ( Columns::ColumnId  id) const
virtual

Return index of column with the given id. If no such column exists, -1 is returned.

Implements CSMWorld::IdTableBase.

Here is the caller graph for this function:

bool CSMWorld::IdTable::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
virtual

Reimplemented in CSMWorld::IdTree.

Here is the caller graph for this function:

void CSMWorld::IdTable::setRecord ( const std::string &  id,
const RecordBase record,
UniversalId::Type  type = UniversalId::Type_None 
)

Add record or overwrite existing record.

Here is the call graph for this function:

std::pair< CSMWorld::UniversalId, std::string > CSMWorld::IdTable::view ( int  row) const
virtual

Return the UniversalId and the hint for viewing row. If viewing is not supported by this table, return (UniversalId::Type_None, "").

Implements CSMWorld::IdTableBase.

Member Data Documentation

CollectionBase* CSMWorld::IdTable::mIdCollection
private

The documentation for this class was generated from the following files: