GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

treeselection.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00021 00022 #ifndef GFC_GTK_TREE_SELECTION_HH 00023 #define GFC_GTK_TREE_SELECTION_HH 00024 00025 #ifndef GFC_G_OBJECT_HH 00026 #include <gfc/glib/object.hh> 00027 #endif 00028 00029 #ifndef GFC_GTK_ENUMS_HH 00030 #include <gfc/gtk/enums.hh> 00031 #endif 00032 00033 #ifndef __GTK_TREE_SELECTION_H__ 00034 #include <gtk/gtktreeselection.h> 00035 #endif 00036 00037 #ifndef _CPP_VECTOR 00038 #include <vector> 00039 #endif 00040 00041 namespace GFC { 00042 00043 namespace Gtk { 00044 00045 class TreeIter; 00046 class TreeModel; 00047 class TreePath; 00048 class TreeView; 00049 00070 00071 class TreeSelection : public G::Object 00072 { 00073 friend class G::Object; 00074 00075 TreeSelection(const TreeSelection&); 00076 TreeSelection& operator=(const TreeSelection&); 00077 00078 protected: 00081 00082 explicit TreeSelection(GtkTreeSelection *tree_selection, bool owns_reference = true); 00089 00093 00094 typedef G::Signal<void> ChangedSignalType; 00095 typedef G::SignalProxy<TypeInstance, ChangedSignalType> ChangedSignalProxy; 00096 static const ChangedSignalType changed_signal; 00101 00103 00104 public: 00105 typedef sigc::slot<bool, TreeModel&, const TreePath&, bool> SelectSlot; 00119 00120 typedef sigc::slot<void, TreeModel&, const TreePath&, const TreeIter&> ForeachSlot; 00132 00135 00136 virtual ~TreeSelection(); 00138 00142 00143 GtkTreeSelection* gtk_tree_selection() const; 00145 00146 operator GtkTreeSelection* () const; 00148 00149 SelectionMode get_mode() const; 00152 00153 TreeView* get_tree_view() const; 00155 00156 bool any_selected() const; 00158 00159 bool get_selected(TreeIter *iter, TreeModel **model = 0) const; 00169 00170 bool get_selected_rows(std::vector<Pointer<TreePath> >& rows, TreeModel **model = 0); 00179 00180 int count_selected_rows() const; 00182 00183 bool path_is_selected(const TreePath& path) const; 00189 00190 bool iter_is_selected(const TreeIter& iter) const; 00193 00197 00198 void set_mode(SelectionMode type); 00204 00205 void set_select_function(const SelectSlot& select); 00213 00214 void selected_foreach(const ForeachSlot& each); 00220 00221 void select_path(const TreePath& path); 00224 00225 void unselect_path(const TreePath& path); 00228 00229 void select_iter(const TreeIter& iter); 00232 00233 void unselect_iter(const TreeIter& iter); 00236 00237 void select_all(); 00239 00240 void unselect_all(); 00242 00243 void select_range(const TreePath& start_path, const TreePath& end_path); 00247 00248 void unselect_range(const TreePath& start_path, const TreePath& end_path); 00252 00256 00257 const ChangedSignalProxy sig_changed(); 00261 00263 }; 00264 00265 } // namespace Gtk 00266 00267 } // namespace GFC 00268 00269 #include <gfc/gtk/inline/treeselection.inl> 00270 00271 #endif // GFC_GTK_TREE_SELECTION_HH 00272

Generated on Tue Aug 24 00:34:32 2004 for GFC-UI by doxygen 1.3.8