OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | List of all members
MWGui::ItemModel Class Referenceabstract

The base class that all item models should derive from. More...

#include <itemmodel.hpp>

Inheritance diagram for MWGui::ItemModel:
Collaboration diagram for MWGui::ItemModel:

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 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)
 
virtual bool onTakeItem (const MWWorld::Ptr &item, int count)
 

Private Member Functions

 ItemModel (const ItemModel &)
 
ItemModeloperator= (const ItemModel &)
 

Detailed Description

The base class that all item models should derive from.

Member Typedef Documentation

Constructor & Destructor Documentation

MWGui::ItemModel::ItemModel ( )
virtual MWGui::ItemModel::~ItemModel ( )
inlinevirtual
MWGui::ItemModel::ItemModel ( const ItemModel )
private

Member Function Documentation

bool MWGui::ItemModel::allowedToUseItems ( ) const
virtual

Is the player allowed to use items from this item model? (default true)

Reimplemented in MWGui::ProxyItemModel, MWGui::ContainerItemModel, MWGui::SortFilterItemModel, MWGui::TradeItemModel, and MWGui::PickpocketItemModel.

Here is the caller graph for this function:

virtual MWWorld::Ptr MWGui::ItemModel::copyItem ( const ItemStack item,
size_t  count,
bool  setNewOwner = false 
)
pure virtual
Parameters
setNewOwnerIf 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.

Here is the caller graph for this function:

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

Returns an invalid index if the item was not found.

Implemented in MWGui::ProxyItemModel, MWGui::WorldItemModel, MWGui::ContainerItemModel, and MWGui::InventoryItemModel.

Here is the caller graph for this function:

virtual ItemStack MWGui::ItemModel::getItem ( ModelIndex  index)
pure virtual

Throws for invalid index or out of range index.

Implemented in MWGui::WorldItemModel, MWGui::ContainerItemModel, MWGui::TradeItemModel, MWGui::SortFilterItemModel, MWGui::PickpocketItemModel, and MWGui::InventoryItemModel.

Here is the caller graph for this function:

virtual size_t MWGui::ItemModel::getItemCount ( )
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::TradeItemModel, MWGui::SortFilterItemModel, MWGui::PickpocketItemModel, and MWGui::InventoryItemModel.

Here is the caller graph for this function:

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

Move items from this model to otherModel.

Note
Derived implementations may return an empty Ptr if the move was unsuccessful.

Reimplemented in MWGui::InventoryItemModel.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MWGui::ItemModel::onClose ( )
inlinevirtual

Reimplemented in MWGui::ProxyItemModel, MWGui::SortFilterItemModel, and MWGui::PickpocketItemModel.

Here is the caller graph for this function:

bool MWGui::ItemModel::onDropItem ( const MWWorld::Ptr item,
int  count 
)
virtual

Reimplemented in MWGui::ProxyItemModel, MWGui::SortFilterItemModel, MWGui::ContainerItemModel, and MWGui::PickpocketItemModel.

Here is the caller graph for this function:

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

Reimplemented in MWGui::ProxyItemModel, MWGui::SortFilterItemModel, MWGui::ContainerItemModel, MWGui::PickpocketItemModel, and MWGui::InventoryItemModel.

Here is the caller graph for this function:

ItemModel& MWGui::ItemModel::operator= ( const ItemModel )
private
virtual void MWGui::ItemModel::removeItem ( const ItemStack item,
size_t  count 
)
pure virtual

Implemented in MWGui::ProxyItemModel, MWGui::WorldItemModel, MWGui::ContainerItemModel, MWGui::InventoryItemModel, MWGui::PickpocketItemModel, and MWGui::CompanionItemModel.

Here is the caller graph for this function:

virtual void MWGui::ItemModel::update ( )
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.

Here is the caller graph for this function:


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