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

#include <sortfilteritemmodel.hpp>

Inheritance diagram for MWGui::SortFilterItemModel:
Collaboration diagram for MWGui::SortFilterItemModel:

Public Member Functions

 SortFilterItemModel (ItemModel *sourceModel)
 
virtual void update ()
 Rebuild the item model, this will invalidate existing model indices. More...
 
bool filterAccepts (const ItemStack &item)
 
virtual ItemStack getItem (ModelIndex index)
 Throws for invalid index or out of range index. More...
 
virtual size_t getItemCount ()
 
void addDragItem (const MWWorld::Ptr &dragItem, size_t count)
 Dragged items are not displayed. More...
 
void clearDragItems ()
 
void setCategory (int category)
 
void setFilter (int filter)
 
void setSortByType (bool sort)
 Use ItemStack::Type for sorting? More...
 
- Public Member Functions inherited from MWGui::ProxyItemModel
 ProxyItemModel ()
 
virtual ~ProxyItemModel ()
 
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 MWWorld::Ptr moveItem (const ItemStack &item, size_t count, ItemModel *otherModel)
 
virtual bool allowedToInsertItems () const
 Is the player allowed to insert items into this model? (default true) More...
 

Static Public Attributes

static const int Category_Weapon = (1<<1)
 
static const int Category_Apparel = (1<<2)
 
static const int Category_Misc = (1<<3)
 
static const int Category_Magic = (1<<4)
 
static const int Category_All = 255
 
static const int Filter_OnlyIngredients = (1<<0)
 
static const int Filter_OnlyEnchanted = (1<<1)
 
static const int Filter_OnlyEnchantable = (1<<2)
 
static const int Filter_OnlyChargedSoulstones = (1<<3)
 
static const int Filter_OnlyUsableItems = (1<<4)
 
static const int Filter_OnlyRepairable = (1<<5)
 
static const int Filter_OnlyRechargable = (1<<6)
 

Private Attributes

std::vector< ItemStackmItems
 
std::vector< std::pair
< MWWorld::Ptr, size_t > > 
mDragItems
 
int mCategory
 
int mFilter
 
bool mSortByType
 

Additional Inherited Members

- Public Types inherited from MWGui::ItemModel
typedef int ModelIndex
 
- Protected Attributes inherited from MWGui::ProxyItemModel
ItemModelmSourceModel
 

Constructor & Destructor Documentation

MWGui::SortFilterItemModel::SortFilterItemModel ( ItemModel sourceModel)

Member Function Documentation

void MWGui::SortFilterItemModel::addDragItem ( const MWWorld::Ptr dragItem,
size_t  count 
)

Dragged items are not displayed.

Here is the caller graph for this function:

void MWGui::SortFilterItemModel::clearDragItems ( )

Here is the caller graph for this function:

bool MWGui::SortFilterItemModel::filterAccepts ( const ItemStack item)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Throws for invalid index or out of range index.

Implements MWGui::ItemModel.

Here is the caller graph for this function:

size_t MWGui::SortFilterItemModel::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.

Here is the caller graph for this function:

void MWGui::SortFilterItemModel::setCategory ( int  category)

Here is the caller graph for this function:

void MWGui::SortFilterItemModel::setFilter ( int  filter)

Here is the caller graph for this function:

void MWGui::SortFilterItemModel::setSortByType ( bool  sort)
inline

Use ItemStack::Type for sorting?

Here is the caller graph for this function:

void MWGui::SortFilterItemModel::update ( )
virtual

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

Implements MWGui::ItemModel.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const int MWGui::SortFilterItemModel::Category_All = 255
static
const int MWGui::SortFilterItemModel::Category_Apparel = (1<<2)
static
const int MWGui::SortFilterItemModel::Category_Magic = (1<<4)
static
const int MWGui::SortFilterItemModel::Category_Misc = (1<<3)
static
const int MWGui::SortFilterItemModel::Category_Weapon = (1<<1)
static
const int MWGui::SortFilterItemModel::Filter_OnlyChargedSoulstones = (1<<3)
static
const int MWGui::SortFilterItemModel::Filter_OnlyEnchantable = (1<<2)
static
const int MWGui::SortFilterItemModel::Filter_OnlyEnchanted = (1<<1)
static
const int MWGui::SortFilterItemModel::Filter_OnlyIngredients = (1<<0)
static
const int MWGui::SortFilterItemModel::Filter_OnlyRechargable = (1<<6)
static
const int MWGui::SortFilterItemModel::Filter_OnlyRepairable = (1<<5)
static
const int MWGui::SortFilterItemModel::Filter_OnlyUsableItems = (1<<4)
static
int MWGui::SortFilterItemModel::mCategory
private
std::vector<std::pair<MWWorld::Ptr, size_t> > MWGui::SortFilterItemModel::mDragItems
private
int MWGui::SortFilterItemModel::mFilter
private
std::vector<ItemStack> MWGui::SortFilterItemModel::mItems
private
bool MWGui::SortFilterItemModel::mSortByType
private

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