Kitlist
1.1.0
|
Represents a Category combined with GuiState attributes. More...
#include <kitmodel.hpp>
Public Member Functions | |
ModelCategory () | |
~ModelCategory () | |
virtual ModelItemContainer * | get_model_items () |
virtual ItemContainer * | get_items () |
Returns the list of items belonging to the Category. More... | |
virtual ItemContainer * | get_items (ItemFunctor &functor) |
Returns the list of items belonging to the Category, filtered by the passed functor. More... | |
virtual ItemMap * | get_removed_children () |
Returns a list of items that have been removed from the Category. More... | |
virtual ItemMap * | get_added_children () |
Returns a list of items that have been added to the Category. More... | |
virtual void | add_item (Item *) |
Adds the passed item to this ModelCategory. More... | |
virtual void | remove_item (Item *item) |
Removes the passed item from this ModelCategory. More... | |
virtual void | remove_items (ModelItemContainer *items) |
Removes all the passed items from this ModelCategory. More... | |
virtual void | reset () |
Resets the Category state. More... | |
virtual void | purge () |
![]() | |
~Category () | |
void | set_id (long id) |
long | get_id () |
void | set_name (const std::string name) |
std::string | get_name () |
virtual size_t | item_count () |
Returns the number of items associated with this category. More... | |
virtual bool | has_items () |
Returns true if there are any items associated with this category. More... | |
void | foreach_item (const SlotForeachItem &slot) |
Executes a callback function for each associated item. More... | |
void | execute (ItemFunctor &functor) |
Executes the passed ItemFunctor. More... | |
![]() | |
GuiState () | |
bool | is_dirty () |
void | set_dirty (bool dirty=true) |
bool | is_deleted () |
void | set_deleted (bool deleted) |
void | set_new_flag (bool flag) |
bool | is_new () |
Protected Attributes | |
ItemMap * | m_removed_children |
List of items removed from the Category. More... | |
ItemMap * | m_added_children |
List of items added to the Category. More... | |
![]() | |
long | m_id |
Unique id. More... | |
std::string | m_name |
The category name. More... | |
ItemContainer | m_items |
List of associated items. More... | |
![]() | |
bool | m_dirty |
bool | m_deleted |
bool | m_new |
Friends | |
class | KitModel |
Represents a Category combined with GuiState attributes.
Definition at line 94 of file kitmodel.hpp.
ModelCategory::ModelCategory | ( | ) |
Definition at line 43 of file kitmodel.cpp.
References m_added_children, and m_removed_children.
ModelCategory::~ModelCategory | ( | ) |
Definition at line 49 of file kitmodel.cpp.
References m_added_children, and m_removed_children.
|
virtual |
Adds the passed item to this ModelCategory.
Also updates the lists of removed and added items.
Reimplemented from Category.
Definition at line 88 of file kitmodel.cpp.
References Category::add_item(), Item::get_id(), m_added_children, and m_removed_children.
Referenced by KitModel::add_item(), KitModel::copy_items(), and KitParser::process_category_item().
|
inlinevirtual |
Returns a list of items that have been added to the Category.
Definition at line 109 of file kitmodel.hpp.
References GuiState::reset().
|
virtual |
Returns the list of items belonging to the Category.
Items flagged as deleted are excluded.
Definition at line 151 of file kitmodel.cpp.
References GuiState::is_deleted(), and Category::m_items.
Referenced by Service::get_filtered_items(), and Service::get_items().
|
virtual |
Returns the list of items belonging to the Category, filtered by the passed functor.
Items flagged as deleted are excluded.
functor | if the operator() method returns true the item is included in the returned list. |
Definition at line 172 of file kitmodel.cpp.
References GuiState::is_deleted(), and Category::m_items.
|
virtual |
Returns the list of items belonging to the Category.
Items flagged as deleted are excluded.
Definition at line 134 of file kitmodel.cpp.
References GuiState::is_deleted(), and Category::m_items.
|
inlinevirtual |
Returns a list of items that have been removed from the Category.
Definition at line 107 of file kitmodel.hpp.
|
virtual |
Definition at line 68 of file kitmodel.cpp.
References Category::m_items.
Referenced by KitModel::purge().
|
virtual |
Removes the passed item from this ModelCategory.
Also updates the lists of removed and added items.
Reimplemented from Category.
Definition at line 106 of file kitmodel.cpp.
References Item::get_id(), m_added_children, m_removed_children, and Category::remove_item().
Referenced by remove_items().
|
virtual |
Removes all the passed items from this ModelCategory.
Also updates the lists of removed and added items.
Definition at line 122 of file kitmodel.cpp.
References remove_item().
Referenced by KitListGui::on_menu_cut().
|
virtual |
Resets the Category state.
Removes any items flagged as deleted. Sets the GuiState to it's defaults and clears the lists of added and removed items.
Reimplemented from GuiState.
Definition at line 61 of file kitmodel.cpp.
References m_added_children, m_removed_children, and GuiState::reset().
Referenced by KitModel::reset().
|
friend |
Definition at line 115 of file kitmodel.hpp.
|
protected |
List of items added to the Category.
Definition at line 99 of file kitmodel.hpp.
Referenced by add_item(), ModelCategory(), remove_item(), reset(), and ~ModelCategory().
|
protected |
List of items removed from the Category.
Definition at line 97 of file kitmodel.hpp.
Referenced by add_item(), ModelCategory(), remove_item(), reset(), and ~ModelCategory().