| 1 |
/* Copyright (C) 2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
_DEFS(gtkmm,gtk) |
| 18 |
|
| 19 |
#include <gtkmm/treemodel.h> |
| 20 |
#include <gtkmm/treepath.h> |
| 21 |
|
| 22 |
|
| 23 |
namespace Gtk |
| 24 |
{ |
| 25 |
|
| 26 |
/** Typedefed as Gtk::TreeModel::RowReference. |
| 27 |
* This reference will keep pointing to |
| 28 |
* the node pointed to by the Path, so long as it exists. It listens to all |
| 29 |
* signals emitted by the Model, and updates its Path appropriately. |
| 30 |
* @ingroup TreeView |
| 31 |
*/ |
| 32 |
class GTKMM_API TreeRowReference |
| 33 |
{ |
| 34 |
_CLASS_BOXEDTYPE(TreeRowReference, GtkTreeRowReference, NONE, gtk_tree_row_reference_copy, gtk_tree_row_reference_free, GTKMM_API) |
| 35 |
_IGNORE(gtk_tree_row_reference_new, gtk_tree_row_reference_copy, gtk_tree_row_reference_free) |
| 36 |
public: |
| 37 |
TreeRowReference(const Glib::RefPtr<TreeModel>& model, const TreeModel::Path& path); |
| 38 |
|
| 39 |
_DEPRECATE_IFDEF_START |
| 40 |
/** This typedef is just to make it more obvious that |
| 41 |
* our operator const void* should be used like operator bool(). |
| 42 |
* |
| 43 |
* @deprecated Use the explicit operator bool() instead. |
| 44 |
*/ |
| 45 |
typedef const void* BoolExpr; |
| 46 |
|
| 47 |
/** The same as is_valid(). |
| 48 |
* For instance, |
| 49 |
* @code |
| 50 |
* if(treerowreference) |
| 51 |
* do_something() |
| 52 |
* @endcode |
| 53 |
* |
| 54 |
* @deprecated Use the explicit operator bool() instead. |
| 55 |
*/ |
| 56 |
operator BoolExpr() const; |
| 57 |
_DEPRECATE_IFDEF_END |
| 58 |
|
| 59 |
/** The same as is_valid(). |
| 60 |
* For instance, |
| 61 |
* @code |
| 62 |
* if(treerowreference) |
| 63 |
* do_something() |
| 64 |
* @endcode |
| 65 |
* |
| 66 |
* @newin{3,22} |
| 67 |
*/ |
| 68 |
explicit operator bool() const; |
| 69 |
|
| 70 |
_WRAP_METHOD(TreeModel::Path get_path() const, gtk_tree_row_reference_get_path) |
| 71 |
|
| 72 |
_WRAP_METHOD(Glib::RefPtr<TreeModel> get_model(), gtk_tree_row_reference_get_model, refreturn) |
| 73 |
_WRAP_METHOD(Glib::RefPtr<const TreeModel> get_model() const, gtk_tree_row_reference_get_model, refreturn, constversion) |
| 74 |
|
| 75 |
_WRAP_METHOD(bool is_valid() const, gtk_tree_row_reference_valid) |
| 76 |
}; |
| 77 |
|
| 78 |
} // namespace Gtk |