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

A proxy item model can be used to filter or rearrange items from a source model (or even add new items to it). The neat thing is that this does not actually alter the source model. More...

#include <itemmodel.hpp>

Inheritance diagram for MWGui::ProxyItemModel:
Collaboration diagram for MWGui::ProxyItemModel:

Public Member Functions

 ProxyItemModel ()
 
virtual ~ProxyItemModel ()
 
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)
 
virtual MWWorld::Ptr copyItem (const ItemStack &item, size_t count, bool setNewOwner=false)
 
virtual void removeItem (const ItemStack &item, size_t count)
 
virtual ModelIndex getIndex (ItemStack item)
 Returns an invalid index if the item was not found. More...
 
void setSourceModel (ItemModel *sourceModel)
 
ModelIndex mapToSource (ModelIndex index)
 
ModelIndex mapFromSource (ModelIndex index)
 
- Public Member Functions inherited from MWGui::ItemModel
 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 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)
 

Protected Attributes

ItemModelmSourceModel
 

Additional Inherited Members

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

Detailed Description

A proxy item model can be used to filter or rearrange items from a source model (or even add new items to it). The neat thing is that this does not actually alter the source model.

Constructor & Destructor Documentation

MWGui::ProxyItemModel::ProxyItemModel ( )
MWGui::ProxyItemModel::~ProxyItemModel ( )
virtual

Member Function Documentation

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

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

Reimplemented from MWGui::ItemModel.

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

Here is the call graph for this function:

MWWorld::Ptr MWGui::ProxyItemModel::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.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns an invalid index if the item was not found.

Implements MWGui::ItemModel.

Here is the call graph for this function:

ItemModel::ModelIndex MWGui::ProxyItemModel::mapFromSource ( ModelIndex  index)

Here is the call graph for this function:

ItemModel::ModelIndex MWGui::ProxyItemModel::mapToSource ( ModelIndex  index)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::ProxyItemModel::onClose ( )
virtual

Reimplemented from MWGui::ItemModel.

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

Here is the call graph for this function:

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

Reimplemented from MWGui::ItemModel.

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

Here is the call graph for this function:

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

Reimplemented from MWGui::ItemModel.

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

Here is the call graph for this function:

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

Implements MWGui::ItemModel.

Reimplemented in MWGui::PickpocketItemModel.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::ProxyItemModel::setSourceModel ( ItemModel sourceModel)
Note
Takes ownership of the passed pointer.

Here is the caller graph for this function:

Member Data Documentation

ItemModel* MWGui::ProxyItemModel::mSourceModel
protected

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