1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 15:23:52 +00:00
openmw/apps/opencs/model/world/resourcetable.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
2.1 KiB
C++
Raw Normal View History

2014-07-05 13:50:47 +00:00
#ifndef CSM_WOLRD_RESOURCETABLE_H
#define CSM_WOLRD_RESOURCETABLE_H
#include "idtablebase.hpp"
namespace CSMWorld
{
class Resources;
class ResourceTable : public IdTableBase
{
2022-09-22 18:26:05 +00:00
const Resources* mResources;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
public:
/// \note The feature Feature_Constant will be added implicitly.
ResourceTable(const Resources* resources, unsigned int features = 0);
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
~ResourceTable() override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
Qt::ItemFlags flags(const QModelIndex& index) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
QModelIndex parent(const QModelIndex& index) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
QModelIndex getModelIndex(const std::string& id, int column) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
/// Return index of column with the given \a id. If no such column exists, -1 is
/// returned.
int searchColumnIndex(Columns::ColumnId id) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
/// Return index of column with the given \a id. If no such column exists, an
/// exception is thrown.
int findColumnIndex(Columns::ColumnId id) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
/// Return the UniversalId and the hint for viewing \a row. If viewing is not
/// supported by this table, return (UniversalId::Type_None, "").
std::pair<UniversalId, std::string> view(int row) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
/// Is \a id flagged as deleted?
bool isDeleted(const std::string& id) const override;
2014-07-05 13:50:47 +00:00
2022-09-22 18:26:05 +00:00
int getColumnId(int column) const override;
2022-09-22 18:26:05 +00:00
/// Signal Qt that the data is about to change.
void beginReset();
/// Signal Qt that the data has been changed.
void endReset();
2014-07-05 13:50:47 +00:00
};
}
#endif