OpenMW
Signals | Public Member Functions | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes
CSMWorld::Data Class Reference

#include <data.hpp>

List of all members.

Signals

void idListChanged ()

Public Member Functions

 Data ()
virtual ~Data ()
const IdCollection< ESM::Global > & getGlobals () const
IdCollection< ESM::Global > & getGlobals ()
const IdCollection
< ESM::GameSetting > & 
getGmsts () const
IdCollection< ESM::GameSetting > & getGmsts ()
const IdCollection< ESM::Skill > & getSkills () const
IdCollection< ESM::Skill > & getSkills ()
const IdCollection< ESM::Class > & getClasses () const
IdCollection< ESM::Class > & getClasses ()
const IdCollection
< ESM::Faction > & 
getFactions () const
IdCollection< ESM::Faction > & getFactions ()
const IdCollection< ESM::Race > & getRaces () const
IdCollection< ESM::Race > & getRaces ()
const IdCollection< ESM::Sound > & getSounds () const
IdCollection< ESM::Sound > & getSounds ()
const IdCollection< ESM::Script > & getScripts () const
IdCollection< ESM::Script > & getScripts ()
const IdCollection< ESM::Region > & getRegions () const
IdCollection< ESM::Region > & getRegions ()
const IdCollection
< ESM::BirthSign > & 
getBirthsigns () const
IdCollection< ESM::BirthSign > & getBirthsigns ()
const IdCollection< ESM::Spell > & getSpells () const
IdCollection< ESM::Spell > & getSpells ()
const IdCollection
< ESM::Dialogue > & 
getTopics () const
IdCollection< ESM::Dialogue > & getTopics ()
const IdCollection
< ESM::Dialogue > & 
getJournals () const
IdCollection< ESM::Dialogue > & getJournals ()
const InfoCollectiongetTopicInfos () const
InfoCollectiongetTopicInfos ()
const InfoCollectiongetJournalInfos () const
InfoCollectiongetJournalInfos ()
const IdCollection< Cell > & getCells () const
IdCollection< Cell > & getCells ()
const RefIdCollectiongetReferenceables () const
RefIdCollectiongetReferenceables ()
const RefCollectiongetReferences () const
RefCollectiongetReferences ()
const IdCollection
< CSMFilter::Filter > & 
getFilters () const
IdCollection< CSMFilter::Filter > & getFilters ()
QAbstractItemModel * getTableModel (const UniversalId &id)
void merge ()
 Merge modified into base.
void loadFile (const boost::filesystem::path &path, bool base, bool project)
bool hasId (const std::string &id) const
std::vector< std::string > getIds (bool listDeleted=true) const
int count (RecordBase::State state) const
 Return number of top-level records with the given state.
void setDescription (const std::string &description)
std::string getDescription () const
void setAuthor (const std::string &author)
std::string getAuthor () const

Private Slots

void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
void rowsChanged (const QModelIndex &parent, int start, int end)

Private Member Functions

 Data (const Data &)
Dataoperator= (const Data &)
void addModel (QAbstractItemModel *model, UniversalId::Type type1, UniversalId::Type type2=UniversalId::Type_None, bool update=true)

Static Private Member Functions

static void appendIds (std::vector< std::string > &ids, const CollectionBase &collection, bool listDeleted)
 Append all IDs from collection to ids.
static int count (RecordBase::State state, const CollectionBase &collection)

Private Attributes

IdCollection< ESM::GlobalmGlobals
IdCollection< ESM::GameSettingmGmsts
IdCollection< ESM::SkillmSkills
IdCollection< ESM::ClassmClasses
IdCollection< ESM::FactionmFactions
IdCollection< ESM::RacemRaces
IdCollection< ESM::SoundmSounds
IdCollection< ESM::ScriptmScripts
IdCollection< ESM::RegionmRegions
IdCollection< ESM::BirthSignmBirthsigns
IdCollection< ESM::SpellmSpells
IdCollection< ESM::DialoguemTopics
IdCollection< ESM::DialoguemJournals
InfoCollection mTopicInfos
InfoCollection mJournalInfos
IdCollection< CellmCells
RefIdCollection mReferenceables
RefCollection mRefs
IdCollection< CSMFilter::FiltermFilters
std::vector< QAbstractItemModel * > mModels
std::map< UniversalId::Type,
QAbstractItemModel * > 
mModelIndex
std::string mAuthor
std::string mDescription

Constructor & Destructor Documentation

CSMWorld::Data::Data ( const Data ) [private]
CSMWorld::Data::~Data ( ) [virtual]

Member Function Documentation

void CSMWorld::Data::addModel ( QAbstractItemModel *  model,
UniversalId::Type  type1,
UniversalId::Type  type2 = UniversalId::Type_None,
bool  update = true 
) [private]
void CSMWorld::Data::appendIds ( std::vector< std::string > &  ids,
const CollectionBase collection,
bool  listDeleted 
) [static, private]

Append all IDs from collection to ids.

int CSMWorld::Data::count ( RecordBase::State  state,
const CollectionBase collection 
) [static, private]

Return number of top-level records with the given state.

void CSMWorld::Data::dataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
) [private, slot]
std::string CSMWorld::Data::getAuthor ( ) const
std::string CSMWorld::Data::getDescription ( ) const
std::vector< std::string > CSMWorld::Data::getIds ( bool  listDeleted = true) const

Return a sorted collection of all IDs that are not internal to the editor.

Parameters:
listDeletedinclude deleted record in the list
QAbstractItemModel * CSMWorld::Data::getTableModel ( const UniversalId id)

If no table model is available for id, an exception is thrown.

Note:
The returned table may either be the model for the ID itself or the model that contains the record specified by the ID.
bool CSMWorld::Data::hasId ( const std::string &  id) const
void CSMWorld::Data::idListChanged ( ) [signal]
void CSMWorld::Data::loadFile ( const boost::filesystem::path &  path,
bool  base,
bool  project 
)

Merging content of a file into base or modified.

Parameters:
projectload project file instead of content file
Todo:
set encoding properly, once config implementation has been fixed.
Todo:
handle info records
Todo:
handle info records
Todo:
report deletion of non-existing record
Todo:
INFO record without matching DIAL record -> report to user
Todo:
throw an exception instead, once all records are implemented or maybe report error and continue?

Merge modified into base.

Data& CSMWorld::Data::operator= ( const Data ) [private]
void CSMWorld::Data::rowsChanged ( const QModelIndex &  parent,
int  start,
int  end 
) [private, slot]
void CSMWorld::Data::setAuthor ( const std::string &  author)
void CSMWorld::Data::setDescription ( const std::string &  description)

Member Data Documentation

std::string CSMWorld::Data::mAuthor [private]
std::string CSMWorld::Data::mDescription [private]
std::map<UniversalId::Type, QAbstractItemModel *> CSMWorld::Data::mModelIndex [private]
std::vector<QAbstractItemModel *> CSMWorld::Data::mModels [private]

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