add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / src / treerowreference.hg
1 /* $Id: treerowreference.hg,v 1.7 2006/04/12 11:11:25 murrayc Exp $ */
2
3 /* Copyright (C) 2002 The gtkmm Development Team
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19
20 _DEFS(gtkmm,gtk)
21
22 #include <gtkmm/treemodel.h>
23 #include <gtkmm/treepath.h>
24
25
26 namespace Gtk
27 {
28
29 /** Typedefed as Gtk::TreeModel::RowReference.
30  * This reference will keep pointing to
31  * the node pointed to by the Path, so long as it exists.  It listens to all
32  * signals emitted by the Model, and updates its Path appropriately.
33  * @ingroup TreeView
34 */
35 class TreeRowReference
36 {
37   _CLASS_BOXEDTYPE(TreeRowReference, GtkTreeRowReference, NONE, gtk_tree_row_reference_copy, gtk_tree_row_reference_free)
38   _IGNORE(gtk_tree_row_reference_new, gtk_tree_row_reference_copy, gtk_tree_row_reference_free)
39 public:
40   TreeRowReference(const Glib::RefPtr<TreeModel>& model, const TreeModel::Path& path);
41
42   ///The same as is_valid().
43   operator bool() const;
44
45   _WRAP_METHOD(TreeModel::Path get_path() const,  gtk_tree_row_reference_get_path)
46
47   _WRAP_METHOD(Glib::RefPtr<TreeModel> get_model(), gtk_tree_row_reference_get_model)
48   _WRAP_METHOD(Glib::RefPtr<const TreeModel> get_model() const, gtk_tree_row_reference_get_model, constversion)
49
50   _WRAP_METHOD(bool is_valid() const, gtk_tree_row_reference_valid)
51 };
52
53 } // namespace Gtk
54