OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pickpocketitemmodel.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_PICKPOCKET_ITEM_MODEL_H
2 #define MWGUI_PICKPOCKET_ITEM_MODEL_H
3 
4 #include "itemmodel.hpp"
5 
6 namespace MWGui
7 {
8 
11  {
12  public:
13  PickpocketItemModel (const MWWorld::Ptr& thief, ItemModel* sourceModel, bool hideItems=true);
14  virtual ItemStack getItem (ModelIndex index);
15  virtual size_t getItemCount();
16  virtual void update();
17  virtual void removeItem (const ItemStack& item, size_t count);
18  virtual bool allowedToInsertItems() const;
19 
20  private:
21  std::vector<ItemStack> mHiddenItems;
22  std::vector<ItemStack> mItems;
23  };
24 
25 }
26 
27 #endif
The base class that all item models should derive from.
Definition: itemmodel.hpp:43
A proxy item model can be used to filter or rearrange items from a source model (or even add new item...
Definition: itemmodel.hpp:83
std::vector< ItemStack > mHiddenItems
Definition: pickpocketitemmodel.hpp:21
A single item stack managed by an item model.
Definition: itemmodel.hpp:12
virtual void update()
Rebuild the item model, this will invalidate existing model indices.
Definition: pickpocketitemmodel.cpp:43
PickpocketItemModel(const MWWorld::Ptr &thief, ItemModel *sourceModel, bool hideItems=true)
Definition: pickpocketitemmodel.cpp:11
std::vector< ItemStack > mItems
Definition: pickpocketitemmodel.hpp:22
virtual void removeItem(const ItemStack &item, size_t count)
Definition: pickpocketitemmodel.cpp:61
virtual bool allowedToInsertItems() const
Is the player allowed to insert items into this model? (default true)
Definition: pickpocketitemmodel.cpp:67
virtual ItemStack getItem(ModelIndex index)
Throws for invalid index or out of range index.
Definition: pickpocketitemmodel.cpp:29
The pickpocket item model randomly hides item stacks based on a specified chance. Equipped items are ...
Definition: pickpocketitemmodel.hpp:10
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual size_t getItemCount()
Definition: pickpocketitemmodel.cpp:38