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 allowedToInsertItems () const
 Is the player allowed to insert items into this model? (default true) More...
 

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::allowedToInsertItems ( ) const
virtual

Is the player allowed to insert items into this model? (default true)

Reimplemented in 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::SortFilterItemModel, MWGui::TradeItemModel, MWGui::InventoryItemModel, and MWGui::PickpocketItemModel.

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::SortFilterItemModel, MWGui::TradeItemModel, MWGui::InventoryItemModel, and MWGui::PickpocketItemModel.

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:

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::CompanionItemModel, and MWGui::PickpocketItemModel.

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: