OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Private Attributes | List of all members
MWGui::InventoryItemModel Class Reference

#include <inventoryitemmodel.hpp>

Inheritance diagram for MWGui::InventoryItemModel:
Collaboration diagram for MWGui::InventoryItemModel:

Public Member Functions

 InventoryItemModel (const MWWorld::Ptr &actor)
 
virtual ItemStack getItem (ModelIndex index)
 Throws for invalid index or out of range index. More...
 
virtual ModelIndex getIndex (ItemStack item)
 Returns an invalid index if the item was not found. More...
 
virtual size_t getItemCount ()
 
virtual bool onTakeItem (const MWWorld::Ptr &item, int count)
 
virtual MWWorld::Ptr copyItem (const ItemStack &item, size_t count, bool setNewOwner=false)
 
virtual void removeItem (const ItemStack &item, size_t count)
 
virtual MWWorld::Ptr moveItem (const ItemStack &item, size_t count, ItemModel *otherModel)
 Move items from this model to otherModel. More...
 
virtual void update ()
 Rebuild the item model, this will invalidate existing model indices. More...
 
- Public Member Functions inherited from MWGui::ItemModel
 ItemModel ()
 
virtual ~ItemModel ()
 
virtual bool allowedToUseItems () const
 Is the player allowed to use items from this item model? (default true) More...
 
virtual void onClose ()
 
virtual bool onDropItem (const MWWorld::Ptr &item, int count)
 

Protected Attributes

MWWorld::Ptr mActor
 

Private Attributes

std::vector< ItemStackmItems
 

Additional Inherited Members

- Public Types inherited from MWGui::ItemModel
typedef int ModelIndex
 

Constructor & Destructor Documentation

MWGui::InventoryItemModel::InventoryItemModel ( const MWWorld::Ptr actor)

Member Function Documentation

MWWorld::Ptr MWGui::InventoryItemModel::copyItem ( const ItemStack item,
size_t  count,
bool  setNewOwner = false 
)
virtual
Parameters
setNewOwnerIf true, set the copied item's owner to the actor we are copying to, otherwise reset owner to ""

Implements MWGui::ItemModel.

Reimplemented in MWGui::CompanionItemModel.

Here is the call graph for this function:

Here is the caller graph for this function:

ItemModel::ModelIndex MWGui::InventoryItemModel::getIndex ( ItemStack  item)
virtual

Returns an invalid index if the item was not found.

Implements MWGui::ItemModel.

ItemStack MWGui::InventoryItemModel::getItem ( ModelIndex  index)
virtual

Throws for invalid index or out of range index.

Implements MWGui::ItemModel.

size_t MWGui::InventoryItemModel::getItemCount ( )
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())

Implements MWGui::ItemModel.

MWWorld::Ptr MWGui::InventoryItemModel::moveItem ( const ItemStack item,
size_t  count,
ItemModel otherModel 
)
virtual

Move items from this model to otherModel.

Reimplemented from MWGui::ItemModel.

Here is the call graph for this function:

bool MWGui::InventoryItemModel::onTakeItem ( const MWWorld::Ptr item,
int  count 
)
virtual

Reimplemented from MWGui::ItemModel.

Here is the call graph for this function:

void MWGui::InventoryItemModel::removeItem ( const ItemStack item,
size_t  count 
)
virtual

Implements MWGui::ItemModel.

Reimplemented in MWGui::CompanionItemModel.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::InventoryItemModel::update ( )
virtual

Rebuild the item model, this will invalidate existing model indices.

Implements MWGui::ItemModel.

Here is the call graph for this function:

Member Data Documentation

MWWorld::Ptr MWGui::InventoryItemModel::mActor
protected
std::vector<ItemStack> MWGui::InventoryItemModel::mItems
private

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