29 #include <sigc++/signal.h> 44 GuiState() : m_dirty(false), m_deleted(false), m_new(false) {}
46 void set_dirty(
bool dirty =
true) { m_dirty = dirty; }
84 typedef std::map<long, ModelItem*>
ItemMap;
110 virtual void add_item(
Item*);
111 virtual void remove_item(
Item* item);
113 virtual void reset();
114 virtual void purge();
173 virtual void add_item(
ModelItem* item,
long cat_id);
175 virtual bool filter(
bool checked);
176 virtual void set_dirty(
bool dirty =
true) { m_dirty=dirty; }
184 virtual void reset();
185 virtual void purge();
189 #endif // KIT_MODEL_H
ModelItemContainer::iterator ModelItemIter
Class encapsulating state of an object in the data model.
Comparator for comparing items by their unique ID.
sigc::slot< bool, ModelItem & > SlotForeachModelItem
Represents a Category combined with GuiState attributes.
ItemMap * m_removed_children
List of items removed from the Category.
CategoryMap * m_category_map
Map allowing categories to be located by ID.
virtual void set_dirty(bool dirty=true)
sigc::slot< bool, ModelCategory & > SlotForeachCategory
void set_dirty(bool dirty=true)
void set_new_flag(bool flag)
ItemMap::iterator ItemMapIter
Comparator used for comparing Items by id.
std::vector< Item * > ItemContainer
virtual void set_checked(bool checked)
virtual void show_unchecked_only()
Sets the filter to show only unchecked items.
virtual void show_checked_only()
Sets the filter to show only checked items.
sigc::slot< bool, const ItemMap::iterator & > SlotForeachModelItemIter
virtual void show_all()
Removes filter. All items are shown.
std::vector< ModelItem * > ModelItemContainer
void set_deleted(bool deleted)
ItemMap * m_item_map
Map allowing items to be located by ID.
virtual void reset()
resets the state of each flag to it's default.
CategoryMap::iterator CategoryMapIter
Represents an Item combined with GuiState attributes.
std::vector< ModelCategory * > ModelCategoryContainer
Holds a rich graph of objects representing the application's data model.
virtual ItemMap * get_removed_children()
Returns a list of items that have been removed from the Category.
ItemMap * m_added_children
List of items added to the Category.
bool m_dirty
Indicates whether the model needs saving. I.e it's state has changed.
virtual void set_checked(bool checked)
ModelCategoryContainer::iterator ModelCategoryIter
std::vector< Category * > CategoryContainer
int operator()(ModelItem *i1, ModelItem *i2)
std::map< long, ModelCategory * > CategoryMap
Functor for processing items.
std::map< long, ModelItem * > ItemMap
sigc::slot< bool, const CategoryMap::iterator & > SlotForeachCategoryIter
virtual ItemMap * get_added_children()
Returns a list of items that have been added to the Category.