2012-12-16 11:52:23 +00:00
|
|
|
#include "columnbase.hpp"
|
|
|
|
|
2013-08-07 07:36:05 +00:00
|
|
|
#include "columns.hpp"
|
|
|
|
|
2014-06-19 16:46:09 +00:00
|
|
|
#include <cassert>
|
|
|
|
|
2014-06-17 20:02:20 +00:00
|
|
|
CSMWorld::ColumnBase::ColumnBase (int columnId, Display displayType, int flags, bool canNest)
|
|
|
|
: mColumnId (columnId), mDisplayType (displayType), mFlags (flags), mCanNest(canNest)
|
2012-12-16 11:52:23 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
CSMWorld::ColumnBase::~ColumnBase() {}
|
|
|
|
|
|
|
|
bool CSMWorld::ColumnBase::isUserEditable() const
|
|
|
|
{
|
|
|
|
return isEditable();
|
2013-08-07 07:36:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string CSMWorld::ColumnBase::getTitle() const
|
|
|
|
{
|
|
|
|
return Columns::getName (static_cast<Columns::ColumnId> (mColumnId));
|
2014-03-08 14:27:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int CSMWorld::ColumnBase::getId() const
|
|
|
|
{
|
|
|
|
return mColumnId;
|
2014-06-17 20:02:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CSMWorld::ColumnBase::canHaveNestedColumns() const
|
|
|
|
{
|
|
|
|
return mCanNest;
|
|
|
|
}
|
2014-06-19 16:46:09 +00:00
|
|
|
|
|
|
|
std::string CSMWorld::ColumnBase::getNestedColumnTitle(int columnNumber) const
|
|
|
|
{
|
2014-06-20 11:40:54 +00:00
|
|
|
assert (mCanNest);
|
|
|
|
|
|
|
|
return Columns::getName(static_cast<Columns::ColumnId>(mNestedColumnId[columnNumber]));
|
2014-06-19 16:46:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSMWorld::ColumnBase::addNestedColumnDisplay(CSMWorld::ColumnBase::Display displayDefinition)
|
|
|
|
{
|
2014-06-20 11:40:54 +00:00
|
|
|
assert (mCanNest);
|
|
|
|
|
2014-06-19 16:46:09 +00:00
|
|
|
mNestedDisplayType.push_back(displayDefinition);
|
|
|
|
}
|
2014-06-20 11:40:54 +00:00
|
|
|
|
|
|
|
void CSMWorld::ColumnBase::addNestedColumnId(int columnId)
|
|
|
|
{
|
|
|
|
assert (mCanNest);
|
|
|
|
|
|
|
|
mNestedColumnId.push_back(columnId);
|
|
|
|
}
|