/* * Copyright 2005,2006 Fabrice Colin * * 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 Library 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. */ #ifndef _ENGINESTREE_HH #define _ENGINESTREE_HH #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "QueryProperties.h" #include "ModelColumns.h" #include "PinotSettings.h" class EnginesTree : public Gtk::TreeView { public: EnginesTree(Gtk::VBox *enginesVbox, PinotSettings &settings); virtual ~EnginesTree(); /// Gets a list of selected items. std::list getSelection(void); /// Gets an iterator. Gtk::TreeModel::iterator getIter(Gtk::TreeModel::Path enginePath); /// Gets the column record. EnginesModelColumns &getColumnRecord(void); /// Populate the tree. void populate(bool indexesOnly = false); /// Clear the tree. void clear(void); /// Save the tree's state. void save(void); /// Returns the double-click signal. sigc::signal2& getDoubleClickSignal(void); protected: Glib::RefPtr m_refStore; PinotSettings &m_settings; Glib::RefPtr m_engineFolderIconPixbuf; EnginesModelColumns m_enginesColumns; sigc::signal2 m_signalDoubleClick; void renderEngineIcon(Gtk::CellRenderer *renderer, const Gtk::TreeModel::iterator &iter); /// Handles button presses. void onButtonPressEvent(GdkEventButton *ev); /// Handles attempts to select rows. bool onSelectionSelect(const Glib::RefPtr& model, const Gtk::TreeModel::Path& node_path, bool path_currently_selected); /// Handles GTK style changes. void onStyleChanged(const Glib::RefPtr &previous_style); private: EnginesTree(const EnginesTree &other); EnginesTree &operator=(const EnginesTree &other); }; #endif // _ENGINESTREE_HH