Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

treeselection.h

Go to the documentation of this file.
00001 /*  Inti: Integrated Foundation Classes
00002  *  Copyright (C) 2002-2003 The Inti Development Team.
00003  *  Copyright (C) 2000 Red Hat, Inc.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU Library General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Library General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019  
00022 
00023 #ifndef INTI_GTK_TREE_SELECTION_H
00024 #define INTI_GTK_TREE_SELECTION_H
00025 
00026 #ifndef INTI_G_OBJECT_H
00027 #include <inti/glib/object.h>
00028 #endif
00029 
00030 #ifndef INTI_GTK_ENUMS_H
00031 #include <inti/gtk/enums.h>
00032 #endif
00033 
00034 #ifndef __GTK_TREE_SELECTION_H__
00035 #include <gtk/gtktreeselection.h>
00036 #endif
00037 
00038 #ifndef _CPP_VECTOR
00039 #include <vector>
00040 #endif
00041 
00042 namespace Inti {
00043 
00044 namespace Gtk {
00045         
00046 class TreeIter;
00047 class TreeModel;
00048 class TreePath;
00049 class TreeSelectionClass;
00050 class TreeView;
00051 
00072  
00073 class TreeSelection : public G::Object
00074 {
00075         friend class G::Object;
00076         friend class TreeSelectionClass;
00077 
00078         TreeSelection(const TreeSelection&);
00079         TreeSelection& operator=(const TreeSelection&);
00080 
00081 protected:
00084 
00085         explicit TreeSelection(GtkTreeSelection *tree_selection, bool reference = true);
00092 
00096 
00097         virtual void on_changed();
00101                 
00103 //  Signals
00104 
00105         typedef G::Signal0<void> ChangedSignalType;
00106         typedef G::SignalProxy<TypeInstance, ChangedSignalType> ChangedSignalProxy;
00107         static const ChangedSignalType changed_signal;
00108 
00109 public:
00110         typedef Slot3<bool, TreeModel*, const TreePath&, bool> SelectSlot;
00124 
00125         typedef Slot3<void, TreeModel*, const TreePath&, const TreeIter&> ForeachSlot;
00137 
00140 
00141         virtual ~TreeSelection();
00143         
00147 
00148         GtkTreeSelection* gtk_tree_selection() const { return (GtkTreeSelection*)instance; }
00150 
00151         GtkTreeSelectionClass* gtk_tree_selection_class() const;
00153 
00154         operator GtkTreeSelection* () const;
00156 
00157         SelectionMode get_mode() const;
00160 
00161         TreeView* get_tree_view() const;
00163         
00164         bool any_selected() const;
00166 
00167         bool get_selected(TreeIter *iter, TreeModel **model = 0) const;
00177 
00178         bool get_selected_rows(std::vector<Pointer<TreePath> >& rows, TreeModel **model = 0);
00187 
00188         int count_selected_rows() const;
00190 
00191         bool path_is_selected(const TreePath& path) const;
00197 
00198         bool iter_is_selected(const TreeIter& iter) const;
00201                 
00205         
00206         void set_mode(SelectionMode type);
00212          
00213         void set_select_function(const SelectSlot *select);
00221         
00222         void selected_foreach(const ForeachSlot *each);
00228         
00229         void select_path(const TreePath& path);
00232          
00233         void unselect_path(const TreePath& path);
00236          
00237         void select_iter(const TreeIter& iter);
00240 
00241         void unselect_iter(const TreeIter& iter);
00244 
00245         void select_all();
00247         
00248         void unselect_all();
00250  
00251         void select_range(const TreePath& start_path, const TreePath& end_path);
00255 
00256         void unselect_range(const TreePath& start_path, const TreePath& end_path);
00260 
00264         
00265         const ChangedSignalProxy sig_changed()
00266         {
00267                 return ChangedSignalProxy(this, &changed_signal);
00268         }
00272                 
00274 };
00275 
00276 } // namespace Gtk
00277 
00278 } // namespace Inti
00279 
00280 #endif // INTI_GTK_TREE_SELECTION_H
00281 
Main Page - Footer


Generated on Sun Sep 14 20:08:04 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002