31 #include <libxml++/libxml++.h> 35 #define NYI assert(false) 70 m_max_category_id(-1),
71 m_categories_node(NULL),
CategoryContainer get_categories()
void set_item_flag(long id)
long get_next_category_id()
Represents a Category combined with GuiState attributes.
xmlpp::Element * m_items_node
Temporary reference to the items' node.
bool add_category_item_to_dom(Item &item)
Adds the passed item to the current category's node.
KitModel * get_model(Glib::ustring filename)
void unset_item_flag(long id)
void append_items_to_category(long to_cat_id, long from_cat_id, item_choice choice)
Copies items from one category to another.
void delete_item(long id)
std::vector< Item * > ItemContainer
virtual bool require_filename()
Indicates that this implementation requires a filename.
void remove_item_from_category(long id, long cat_id)
long add_item(const std::string name)
void delete_category(long id)
long m_max_item_id
The last used ID for items.
void save_model(KitModel *model)
Saves the model as an XML document.
KitModel * get_model()
Loads the data model from the previously set filename.
long add_item(const std::string name, long cat_id)
xmlpp::Element * m_categories_node
Temporary reference to the categories' node.
void associate_item_with_category(long id, long cat_id)
Associates an existing item with an existing category.
bool add_item_to_dom(ModelItem &item)
Adds the passed item to the current items' node.
long m_max_category_id
The last used ID for categories.
Defines the methods that an implementation of this class must implement.
bool add_category_to_dom(ModelCategory &item)
Adds the passed item to the current categories' node.
Category * get_category(long cat_id, item_choice choice)
Loads a category.
Represents an Item combined with GuiState attributes.
Holds a rich graph of objects representing the application's data model.
void set_filename(Glib::ustring filename)
Glib::ustring m_filename
The filename to load or save the XML document from.
void save_model(KitModel *model, Glib::ustring filename)
Saves the model as an XML document.
void unset_category_flag(long id)
long new_category(const std::string name)
Creates a new category.
Implementation of a KitListDao using XML as the persistence store.
std::vector< Category * > CategoryContainer
void set_category_flag(long id)
ItemContainer * get_all_items(item_choice choice)
Returns a list of all items.
void update_item_checked_state(ItemContainer &items)
Persists the state of the 'checked' flag of each item.
long get_next_item_id()
Returns the next unused unique id for items.
xmlpp::Element * m_cat_items_node
Temporary reference to the categories' items' node.