1 #ifndef MWGUI_ITEM_MODEL_H
2 #define MWGUI_ITEM_MODEL_H
4 #include "../mwworld/ptr.hpp"
Definition: itemmodel.hpp:30
Definition: itemmodel.hpp:29
ItemModel()
Definition: itemmodel.cpp:111
Type mType
Definition: itemmodel.hpp:25
ItemModel & operator=(const ItemModel &)
The base class that all item models should derive from.
Definition: itemmodel.hpp:43
Definition: itemmodel.hpp:22
ProxyItemModel()
Definition: itemmodel.cpp:128
Definition: itemmodel.hpp:23
virtual size_t getItemCount()=0
virtual MWWorld::Ptr copyItem(const ItemStack &item, size_t count, bool setNewOwner=false)
Definition: itemmodel.cpp:138
ModelIndex mapToSource(ModelIndex index)
Definition: itemmodel.cpp:148
virtual ModelIndex getIndex(ItemStack item)
Returns an invalid index if the item was not found.
Definition: itemmodel.cpp:172
virtual ~ItemModel()
Definition: itemmodel.hpp:47
virtual bool allowedToInsertItems() const
Is the player allowed to insert items into this model? (default true)
Definition: itemmodel.cpp:122
A proxy item model can be used to filter or rearrange items from a source model (or even add new item...
Definition: itemmodel.hpp:83
A single item stack managed by an item model.
Definition: itemmodel.hpp:12
ItemStack()
Definition: itemmodel.cpp:61
virtual ModelIndex getIndex(ItemStack item)=0
Returns an invalid index if the item was not found.
virtual MWWorld::Ptr moveItem(const ItemStack &item, size_t count, ItemModel *otherModel)
Definition: itemmodel.cpp:115
size_t mCount
Definition: itemmodel.hpp:35
bool operator==(const ItemStack &left, const ItemStack &right)
Definition: itemmodel.cpp:89
void setSourceModel(ItemModel *sourceModel)
Definition: itemmodel.cpp:177
int mFlags
Definition: itemmodel.hpp:32
virtual void removeItem(const ItemStack &item, size_t count)=0
Definition: itemmodel.hpp:21
ModelIndex mapFromSource(ModelIndex index)
Definition: itemmodel.cpp:160
bool stacks(const ItemStack &other)
like operator==, only without checking mType
Definition: itemmodel.cpp:69
int ModelIndex
Definition: itemmodel.hpp:49
virtual ~ProxyItemModel()
Definition: itemmodel.cpp:133
ItemModel * mCreator
Definition: itemmodel.hpp:34
virtual MWWorld::Ptr copyItem(const ItemStack &item, size_t count, bool setNewOwner=false)=0
ItemModel * mSourceModel
Definition: itemmodel.hpp:98
virtual void removeItem(const ItemStack &item, size_t count)
Definition: itemmodel.cpp:143
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
Type
Definition: itemmodel.hpp:19
virtual ItemStack getItem(ModelIndex index)=0
Throws for invalid index or out of range index.
virtual void update()=0
Rebuild the item model, this will invalidate existing model indices.
MWWorld::Ptr mBase
Definition: itemmodel.hpp:36
Flags
Definition: itemmodel.hpp:27