Ardour  9.0-pre0-582-g084a23a80d
treeselection.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREESELECTION_H
4 #define _GTKMM_TREESELECTION_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: treeselection.hg,v 1.6 2006/04/12 11:11:25 murrayc Exp $ */
11 
12 /* Copyright(C) 1998-1999 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or(at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 
30 #include <gtkmm/treepath.h>
31 #include <gtkmm/enums.h>
32 #include <gtkmm/treemodel.h>
33 #include <gtkmm/treeiter.h>
34 
35 
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 typedef struct _GtkTreeSelection GtkTreeSelection;
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 
41 
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 namespace Gtk
44 { class TreeSelection_Class; } // namespace Gtk
45 #endif //DOXYGEN_SHOULD_SKIP_THIS
46 
47 namespace Gtk
48 {
49 
50 class TreeView;
51 class TreeModel;
52 class TreePath;
53 
79 class TreeSelection : public Glib::Object
80 {
81 
82 #ifndef DOXYGEN_SHOULD_SKIP_THIS
83 
84 public:
85  typedef TreeSelection CppObjectType;
86  typedef TreeSelection_Class CppClassType;
87  typedef GtkTreeSelection BaseObjectType;
88  typedef GtkTreeSelectionClass BaseClassType;
89 
90 private: friend class TreeSelection_Class;
91  static CppClassType treeselection_class_;
92 
93 private:
94  // noncopyable
96  TreeSelection& operator=(const TreeSelection&);
97 
98 protected:
99  explicit TreeSelection(const Glib::ConstructParams& construct_params);
100  explicit TreeSelection(GtkTreeSelection* castitem);
101 
102 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
103 
104 public:
105  virtual ~TreeSelection();
106 
109  static GType get_type() G_GNUC_CONST;
110 
111 #ifndef DOXYGEN_SHOULD_SKIP_THIS
112 
113 
114  static GType get_base_type() G_GNUC_CONST;
115 #endif
116 
118  GtkTreeSelection* gobj() { return reinterpret_cast<GtkTreeSelection*>(gobject_); }
119 
121  const GtkTreeSelection* gobj() const { return reinterpret_cast<GtkTreeSelection*>(gobject_); }
122 
125 
126 private:
127 
128 
129 protected:
130 
131 
132 public:
133 
141 
148 
153  typedef sigc::slot<bool, const Glib::RefPtr<TreeModel>&, const TreeModel::Path&, bool> SlotSelect;
154 
163  void set_select_function(const SlotSelect& slot);
164 
165 
166  // This would be our SignalProxy_Select* data.
167 
168 
174 
179  const TreeView* get_tree_view() const;
180 
184  Glib::RefPtr<TreeModel> get_model(); // convenience function, not in GTK+
185  Glib::RefPtr<const TreeModel> get_model() const; // convenience function, not in GTK+
186 
187  //TODO: Add TreeModel::const_iterator get_selected() const, when we have a real const_iterator.
188 
196 
204  TreeModel::iterator get_selected(Glib::RefPtr<TreeModel>& model);
205 
206  typedef Glib::ListHandle<TreeModel::Path, TreePath_Traits> ListHandle_Path;
207 
215 
223  ListHandle_Path get_selected_rows(Glib::RefPtr<TreeModel>& model);
224 
225 
230  int count_selected_rows() const;
231 
232  //TODO: Consider deprecating these selected_foreach() methods, because get_selected_rows() should be enough.
233 
234  //TODO: SlotForEachIter should take a const_iterator, when we have a real const iterator.
241  typedef sigc::slot<void, const TreeModel::iterator&> SlotForeachIter;
242 
249  void selected_foreach_iter(const SlotForeachIter& slot) const;
250 
257  typedef sigc::slot<void, const TreeModel::Path&> SlotForeachPath;
258 
265  void selected_foreach_path(const SlotForeachPath& slot) const;
266 
267 
274  typedef sigc::slot<void, const TreeModel::Path&, const TreeModel::iterator&> SlotForeachPathAndIter;
275 
282  void selected_foreach(const SlotForeachPathAndIter& slot) const;
283 
284 
289  void select(const TreeModel::Path& path);
290 
295  void select(const TreeModel::iterator& iter);
296 
301  void select(const TreeModel::Row& row);
302 
309  void select(const TreeModel::Path& start_path, const TreeModel::Path& end_path);
310 
311 
316  void unselect(const TreeModel::Path& path);
317 
324  void unselect(const TreeModel::Path& start_path, const TreeModel::Path& end_path);
325 
330  void unselect(const TreeModel::iterator& iter);
331 
332 
339  bool is_selected(const TreeModel::Path& path) const;
340 
346  bool is_selected(const TreeModel::iterator& iter) const;
347 
348 
352  void select_all();
353 
356  void unselect_all();
357 
358 
365  Glib::SignalProxy0< void > signal_changed();
366 
367 
368 public:
369 
370 public:
371  //C++ methods used to invoke GTK+ virtual functions:
372 
373 protected:
374  //GTK+ Virtual Functions (override these to change behaviour):
375 
376  //Default Signal Handlers::
378  virtual void on_changed();
379 
380 
381 };
382 
383 } // namespace Gtk
384 
385 
386 namespace Glib
387 {
396  Glib::RefPtr<Gtk::TreeSelection> wrap(GtkTreeSelection* object, bool take_copy = false);
397 }
398 
399 
400 #endif /* _GTKMM_TREESELECTION_H */
401 
sigc::slot< void, const TreeModel::iterator & > SlotForeachIter
void select(const TreeModel::Row &row)
virtual void on_changed()
This is a default handler for the signal signal_changed().
sigc::slot< bool, const Glib::RefPtr< TreeModel > &, const TreeModel::Path &, bool > SlotSelect
void select(const TreeModel::Path &start_path, const TreeModel::Path &end_path)
Glib::RefPtr< Gtk::TreeSelection > wrap(GtkTreeSelection *object, bool take_copy=false)
sigc::slot< void, const TreeModel::Path &, const TreeModel::iterator & > SlotForeachPathAndIter
ListHandle_Path get_selected_rows() const
static GType get_type() G_GNUC_CONST
ListHandle_Path get_selected_rows(Glib::RefPtr< TreeModel > &model)
int count_selected_rows() const
Glib::RefPtr< const TreeModel > get_model() const
virtual ~TreeSelection()
void selected_foreach_iter(const SlotForeachIter &slot) const
TreeView * get_tree_view()
void selected_foreach_path(const SlotForeachPath &slot) const
void unselect(const TreeModel::iterator &iter)
void unselect(const TreeModel::Path &start_path, const TreeModel::Path &end_path)
TreeModel::iterator get_selected(Glib::RefPtr< TreeModel > &model)
void select(const TreeModel::iterator &iter)
void unselect(const TreeModel::Path &path)
void set_select_function(const SlotSelect &slot)
void set_mode(SelectionMode type)
GtkTreeSelection * gobj()
Provides access to the underlying C GObject.
GtkTreeSelection * gobj_copy()
Provides access to the underlying C instance. The caller is responsible for unrefing it....
sigc::slot< void, const TreeModel::Path & > SlotForeachPath
SelectionMode get_mode() const
void select(const TreeModel::Path &path)
Glib::ListHandle< TreeModel::Path, TreePath_Traits > ListHandle_Path
const TreeView * get_tree_view() const
bool is_selected(const TreeModel::iterator &iter) const
Glib::SignalProxy0< void > signal_changed()
const GtkTreeSelection * gobj() const
Provides access to the underlying C GObject.
void selected_foreach(const SlotForeachPathAndIter &slot) const
bool is_selected(const TreeModel::Path &path) const
Glib::RefPtr< TreeModel > get_model()
TreeModel::iterator get_selected()
Definition: ardour_ui.h:188