29 #include <glibmm/ustring.h> 63 virtual bool filter(
bool checked) {
return m_model->
filter(checked); }
68 bool update_item(
long id,
const std::string description,
bool checked);
virtual bool filter(bool checked)
Applies the current filter.
ModelCategory * find_category(long cat_id)
Category * create_category()
Creates a new category.
Represents a Category combined with GuiState attributes.
virtual void select_items(ModelItemContainer *items, bool checked=true)
Checks or unchecks all the passed items.
std::vector< Item * > ItemContainer
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.
virtual bool require_filename()
Indicates whether the implementation of the data model requires a filename.
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.
void open_as_xml(const Glib::ustring &filename)
Loads a new data model from the named XML document.
Service(KitListDao &dao)
Loads the data model from the persistence store.
virtual void show_all()
Removes filter. All items are shown.
ItemContainer * get_items(long cat_id=-1)
Returns a list of items.
std::vector< ModelItem * > ModelItemContainer
Item * create_item(long cat_id)
Creates a new ModelItem and associates it with the specified category.
bool delete_category(long cat_id)
Flags a category as deleted.
KitModel * load_model()
Loads the data model from the persistence store.
Defines the methods that an implementation of this class must implement.
void save_as_xml(const Glib::ustring &filename)
Saves the model's state to an XML document.
CategoryContainer * get_categories()
Returns a list of all categories.
bool update_item(long id, const std::string description, bool checked)
Updates the attributes of an item.
Represents an Item combined with GuiState attributes.
Holds a rich graph of objects representing the application's data model.
virtual void toggle_selected_items(ModelItemContainer *items)
Toggles the checked state of all the passed items.
void copy_items(const ModelItemContainer &items, long cat_id)
Copies items to the specified category.
bool delete_item(long id)
Flags an item as deleted.
ItemContainer * get_filtered_items(long cat_id=-1)
Returns a list of items, applying the current filter.
std::vector< Category * > CategoryContainer
virtual bool require_filename()
void set_model_dirty(bool flag=true)
KitListDao & m_dao
Reference to the perisitence data access object.
void create_default_model()
Creates a default model.
ModelItem * find_item(long id)
virtual bool filter(bool checked)
Applies the current filter.
Business/service layer implementation.
long get_next_category_id()
virtual void show_all()
Removes filter. All items are shown.
KitModel * m_model
The application's data model.