#ifndef DCFILELIST_H #define DCFILELIST_H //$Id: DCFileList.h,v 1.14 2006/06/05 16:45:39 markus Rel $ // 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 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include #include namespace Gtk { class Menu; } class DCFileList : public XGP::XFileList { public: DCFileList (); virtual ~DCFileList (); class FileCols : public XGP::FileColumns { public: Gtk::TreeModelColumn timeOrig; Gtk::TreeModelColumn timeComp; Gtk::TreeModelColumn status; Gtk::TreeModelColumn fileOrig; Gtk::TreeModelColumn fileComp; FileCols () : XGP::FileColumns () { add (timeOrig); add (timeComp); add (status); add (fileOrig); add (fileComp); } }; //@Section access to model const FileCols& getColumns () const { return cols; } unsigned int rows () const { return const_cast (this)->files->children ().size (); } void appendDirectory (const std::string& dir); void appendFile (const std::string& prefix, const YGP::File* orig, const YGP::File* comp, const std::string& stat); Gtk::TreeRow row (unsigned int row) const { return (files->children ())[row]; } void clear (); void finish () { directories.clear (); } void deleteRow (const Gtk::TreeIter& row); protected: virtual std::string getFilename (const Gtk::TreeIter& line) const; virtual void setFilename (Gtk::TreeIter& line, const std::string& file); virtual void addMenus (Gtk::Menu& menu, const Gtk::TreeIter& line); private: DCFileList (const DCFileList& other); const DCFileList& operator= (const DCFileList& other); void startDiff (const Gtk::TreeIter& line); void execute (const char* file, const Gtk::TreeIter& line); void execute2 (const char* file, const Gtk::TreeIter& line); const FileCols cols; Glib::RefPtr files; std::map directories; }; #endif