Kitlist
A list manager for maintaining kit lists
Loading...
Searching...
No Matches
fdsd::fc::KitListFinalcut Class Reference

Main Text-based User Interface (FINALCUT) for the application. More...

#include "kitlist_finalcut.hpp"

Inheritance diagram for fdsd::fc::KitListFinalcut:
KitListBaseApp

Public Member Functions

 KitListFinalcut ()
 Default constructor.
int run (int argc, char *argv[], const std::string filename)
 Runs the FINAL CUT text based user interface.
Public Member Functions inherited from KitListBaseApp
 KitListBaseApp ()
 Default constructor.
virtual ~KitListBaseApp ()
 Destructor.
bool is_dirty () const
void set_dirty (bool dirty=true) const
auto get_current_checked_item_count () const
void new_file ()
 Create a new Model and sets the associated filename to be empty.
virtual void load_file (const std::string &filename)
 Loads the specified file.
virtual bool save ()
 Saves the current Model using the current filename.
virtual bool save (std::string filename)
const std::shared_ptr< Categoryset_category_name (const int32_t id, const std::string &name)
 Updates the name of passed Category.
const std::shared_ptr< Itemset_item_name (const int32_t id, const std::string &name)
 Updates the name of the passed Item.
const std::shared_ptr< Itemset_item_checked (const int32_t id, const bool state)
 Updates the checked state of the passed Item.
virtual const std::shared_ptr< Itemchange_checked_state (int32_t id, Model::check_action action)
 Switches the checked state of the Item referenced by the specified ID according to the specified action.
void change_all_current_items_checked_states (Model::check_action action) const
 Switches the checked state of all items in the currently selected Category.
void set_filename (const std::string &filename)
 Sets a new filename to associate with the Model.
const std::string get_filename () const
virtual void initialization_complete ()
 Sets initialized to true.
int32_t new_item (const std::string &name, bool checked) const
 creates a new Item in the model using the passed parameters, incrementing Model::max_item_id and assigning it to the Item.
void delete_category (int32_t id) const
 Deletes the Category having the passed ID.
void delete_item (int32_t id) const
 Deletes the Item having the passed ID.
void remove_items (const std::vector< std::shared_ptr< Item > > &items) const
 Removes references to each of the Item instances in the list from the currently selected Category.
void remove_item (int32_t id) const
 Removes references to the item from the currently selected Category.
int32_t new_category (const std::string &name) const
 Creates a new Category in the Model using the passed parameters, incrementing Model::max_category_id and assigning it to the Category.
const std::shared_ptr< Itemget_item (int32_t id) const
 Gets an Item by ID.
const std::shared_ptr< Categoryget_category (int32_t id) const
 Gets a Category by ID.
const std::vector< std::shared_ptr< Item > > get_all_items_for_current_selected_category () const
 Returns all items for the currently selected Category.
const std::vector< std::shared_ptr< Item > > filter_items_for_current_selected_category () const
 Filters the list of Item instances based on the currently selected category (Model::selected_category) and checked status (Model::filter).
auto count_filter_items_for_current_selected_category () const
 Returns a count of the filtered items in the currently selected category.
void remove_all_current_checked_items ()
 Removes all checked items from the current category.
void delete_all_current_checked_items ()
 Deletes all checked items.
void associate_item_with_category (int32_t item_id, std::shared_ptr< Category > category)
 Updates the relationships between an Item and a Category that are already in the model, but using only the item's ID as a reference.
void copy_items_to_categories (std::vector< std::shared_ptr< Item > > &items, std::vector< std::shared_ptr< Category > > &categories) const
 Copies all of the passed items to each of the passed categories, updating the model relationships.
void copy_checked_items_to_categories (std::vector< int32_t > cids) const
 Copies all currently checked items for the currently selected Category to the list of categories.
void copy_item_to_categories (int32_t item_id, std::vector< int32_t > cids)
 Copies the specified item to the list of categories.
void select_category (int32_t id)
 Sets the selected Category to that of the passed ID.
int32_t get_selected_category () const
 Gets the ID of the currently selected Category.
const std::vector< std::shared_ptr< Category > > get_categories () const
 Gets the list of categories.
const std::vector< std::shared_ptr< Item > > get_all_items () const
 Gets all items, without filtering.
void set_filter (Model::state_filter state) const
 Sets filtering of checked items.
Model::state_filter get_filter () const
 The current filter.
void sort_categories () const
 Sorts all the model's categories.
void sort () const
 Sorts everything within the model.

Additional Inherited Members

Public Attributes inherited from KitListBaseApp
const std::string all_items_text = "-- Show all items --"
 Constant string indicating the option to select no category and therefor display all items.
Static Public Attributes inherited from KitListBaseApp
static const std::string DEFAULT_FILE_EXTENSION = ".kit"
 The application's default filename extension. .kit.
Protected Member Functions inherited from KitListBaseApp
virtual void update_menu_state (bool is_dirty)
 Called whenever there is a change to the Model state.
virtual void category_entry_changed (const std::shared_ptr< Category > category)
 Called when a Category name has changed.
virtual void item_entry_changed (const std::shared_ptr< Item > item)
 Called when a Item instance's state has changed.
virtual void category_name_changed (const std::shared_ptr< Category > category)
virtual void item_name_changed (const std::shared_ptr< Item > item)
virtual void item_checked_changed (const std::shared_ptr< Item > item)
virtual void model_state_changed (bool is_dirty)
 Called whenever the Model state is changed.

Detailed Description

Main Text-based User Interface (FINALCUT) for the application.

Implemented using the FINAL CUT library.

Definition at line 51 of file kitlist_finalcut.hpp.

Constructor & Destructor Documentation

◆ KitListFinalcut()

fdsd::fc::KitListFinalcut::KitListFinalcut ( )
inline

Default constructor.

Definition at line 55 of file kitlist_finalcut.hpp.

Member Function Documentation

◆ run()

int KitListFinalcut::run ( int argc,
char * argv[],
const std::string filename )

Runs the FINAL CUT text based user interface.

Returns
When this application is compiled to enable wxWidgets, the actual exit code will be decided by wxWidgets. Returns zero if successful, non-zero otherwise.
See also
KitListGui::OnCmdLineParsed

Definition at line 462 of file kitlist_finalcut.cpp.


The documentation for this class was generated from the following files:
Copyright 2008-2025 Frank Dean