OpenMW
|
The base class that all item models should derive from. More...
#include <itemmodel.hpp>
Public Types | |
typedef int | ModelIndex |
Public Member Functions | |
ItemModel () | |
virtual | ~ItemModel () |
virtual ItemStack | getItem (ModelIndex index)=0 |
Throws for invalid index or out of range index. More... | |
virtual size_t | getItemCount ()=0 |
virtual ModelIndex | getIndex (ItemStack item)=0 |
Returns an invalid index if the item was not found. More... | |
virtual void | update ()=0 |
Rebuild the item model, this will invalidate existing model indices. More... | |
virtual MWWorld::Ptr | moveItem (const ItemStack &item, size_t count, ItemModel *otherModel) |
virtual MWWorld::Ptr | copyItem (const ItemStack &item, size_t count, bool setNewOwner=false)=0 |
virtual void | removeItem (const ItemStack &item, size_t count)=0 |
virtual bool | allowedToInsertItems () const |
Is the player allowed to insert items into this model? (default true) More... | |
Private Member Functions | |
ItemModel (const ItemModel &) | |
ItemModel & | operator= (const ItemModel &) |
The base class that all item models should derive from.
typedef int MWGui::ItemModel::ModelIndex |
MWGui::ItemModel::ItemModel | ( | ) |
|
inlinevirtual |
|
private |
|
virtual |
Is the player allowed to insert items into this model? (default true)
Reimplemented in MWGui::PickpocketItemModel.
|
pure virtual |
setNewOwner | If true, set the copied item's owner to the actor we are copying to, otherwise reset owner to "" |
Implemented in MWGui::ProxyItemModel, MWGui::WorldItemModel, MWGui::ContainerItemModel, MWGui::InventoryItemModel, and MWGui::CompanionItemModel.
|
pure virtual |
Returns an invalid index if the item was not found.
Implemented in MWGui::ProxyItemModel, MWGui::WorldItemModel, MWGui::ContainerItemModel, and MWGui::InventoryItemModel.
|
pure virtual |
Throws for invalid index or out of range index.
Implemented in MWGui::WorldItemModel, MWGui::ContainerItemModel, MWGui::SortFilterItemModel, MWGui::TradeItemModel, MWGui::InventoryItemModel, and MWGui::PickpocketItemModel.
|
pure virtual |
The number of items in the model, this specifies the range of indices you can pass to the getItem function (but this range is only valid until the next call to update())
Implemented in MWGui::WorldItemModel, MWGui::ContainerItemModel, MWGui::SortFilterItemModel, MWGui::TradeItemModel, MWGui::InventoryItemModel, and MWGui::PickpocketItemModel.
|
virtual |
Move items from this model to otherModel.
Reimplemented in MWGui::InventoryItemModel.
|
pure virtual |
Implemented in MWGui::ProxyItemModel, MWGui::WorldItemModel, MWGui::ContainerItemModel, MWGui::InventoryItemModel, MWGui::CompanionItemModel, and MWGui::PickpocketItemModel.
|
pure virtual |
Rebuild the item model, this will invalidate existing model indices.
Implemented in MWGui::WorldItemModel, MWGui::ContainerItemModel, MWGui::InventoryItemModel, MWGui::TradeItemModel, MWGui::PickpocketItemModel, and MWGui::SortFilterItemModel.