1. Andreas Tscharner
  2. lrc


lrc / src / gui / ListHandler.hxx

 * ListHandler.hxx
 * Copyright 2012 Andreas Tscharner <andy@vis.ethz.ch>
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.

/*! \file ListHandler.hxx
 * This file contains the definition of the ListHandler class. This class is
 * responsible to manage the list in the TreeView, especially for adding and
 * removing new entries
 * \author Andreas Tscharner
 * \date 2012-08-31


#include <gtkmm/liststore.h>
#include <gtkmm/treeselection.h>
#include "ResColumnModel.hxx"

/*! \class ListHandler
 *  \brief Class to handle the list in the Gtk::TreeView
 * This class handles the list in the Gtk::TreeView. It is especially
 * responsible to add new entries to the list and remove the ones that are
 * no longer used. Finally it provides the data as resource entries if the
 * user selects "Save (as)"
class ListHandler
		Glib::RefPtr<Gtk::ListStore> m_listResEntries; //!< Reference to list store for the main list view
		ResColumnModel *m_resColModel;                 //!< Class that defines the column model for the list store

		/*! \brief Constructor
		 * The constructor expects a reference to the list store and a
		 * pointer to the instance of the column model
		 * \param[in] p_listResEntries Reference to TreeView ListStore
		 * \param[in] p_resColModel Pointer to single instance of
		 *            ResColumnModel
		ListHandler(Glib::RefPtr<Gtk::ListStore>, ResColumnModel *);

		/*! \brief Add new files to TreeView
		 * This method adds the new (given) files into the TreeView. It
		 * checks for duplicates and removes them if any
		 * \param[in] p_newFiles List of (new) files
		 * \retval NO_ERROR Files successfully added
		int newFilesAdded(std::vector<std::string>);

		/*! \brief Remove the selected resource
		 * This method removes the currently selected resources from the list
		 * without confirmation
		 * \param[in] p_selection Selection in view
		 * \retval NO_ERROR Resource successfully removed
		int removeSelected(Glib::RefPtr<Gtk::TreeSelection>);

#endif /* __LISTHANDLER_HXX__ */