{-# LINE 2 "./Graphics/UI/Gtk/ModelView/TreeRowReference.chs" #-}-- -*-haskell-*--- GIMP Toolkit (GTK) Class TreeRowReference---- Author : Duncan Coutts---- Created: 14 April 2005---- Copyright (C) 2005 Axel Simon, Duncan Coutts---- This library is free software; you can redistribute it and/or-- modify it under the terms of the GNU Lesser General Public-- License as published by the Free Software Foundation; either-- version 2.1 of the License, or (at your option) any later version.---- This library is distributed in the hope that it will be useful,-- but WITHOUT ANY WARRANTY; without even the implied warranty of-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU-- Lesser General Public License for more details.---- |-- Maintainer : gtk2hs-users@lists.sourceforge.net-- Stability : provisional-- Portability : portable (depends on GHC)---- A persistent index into a tree model.--moduleGraphics.UI.Gtk.ModelView.TreeRowReference(-- * Detail---- | A 'RowReference' is an index into a-- 'Graphics.UI.Gtk.ModelView.TreeModel.TreeModel' that is persistent even if-- rows are inserted, deleted or reordered.---- * TypesTreeRowReference,-- * ConstructorstreeRowReferenceNew,-- * MethodstreeRowReferenceGetPath,treeRowReferenceValid,)whereimportControl.Monad(liftM)importSystem.Glib.FFIimportGraphics.UI.Gtk.Types{-# LINE 51 "./Graphics/UI/Gtk/ModelView/TreeRowReference.chs" #-}importGraphics.UI.Gtk.ModelView.Types{-# LINE 52 "./Graphics/UI/Gtk/ModelView/TreeRowReference.chs" #-}{-# LINE 54 "./Graphics/UI/Gtk/ModelView/TreeRowReference.chs" #-}-- | Tree Row Reference : like a 'TreePath' it points to a subtree or node, but-- it is persistent. It identifies the same node (so long as it exists) even-- when items are added, removed, or reordered.--newtypeTreeRowReference=TreeRowReference(ForeignPtr(TreeRowReference)){-# LINE 60 "./Graphics/UI/Gtk/ModelView/TreeRowReference.chs" #-}---------------------- Constructors-- | Creates a row reference based on a path. This reference will keep pointing-- to the node pointed to by the given path, so long as it exists. Returns @Nothing@ if there is no node at the given path.--treeRowReferenceNew::TreeModelClassself=>self->TreePath->IO(MaybeTreeRowReference)treeRowReferenceNewselfpath=withTreePathpath$\path->dorowRefPtr<-(\(TreeModelarg1)(NativeTreePatharg2)->withForeignPtrarg1$\argPtr1->gtk_tree_row_reference_newargPtr1arg2)(toTreeModelself)pathifrowRefPtr==nullPtrthenreturnNothingelseliftM(Just.TreeRowReference)$newForeignPtrrowRefPtrtree_row_reference_free---------------------- Methods-- | Returns a path that the row reference currently points to.---- * The returned path may be the empty list if the reference was invalid.--treeRowReferenceGetPath::TreeRowReference->IOTreePathtreeRowReferenceGetPathref=(\(TreeRowReferencearg1)->withForeignPtrarg1$\argPtr1->gtk_tree_row_reference_get_pathargPtr1)ref>>=fromTreePath-- path must be freed-- | Returns True if the reference refers to a current valid path.--treeRowReferenceValid::TreeRowReference->IOBooltreeRowReferenceValidself=liftMtoBool$(\(TreeRowReferencearg1)->withForeignPtrarg1$\argPtr1->gtk_tree_row_reference_validargPtr1){-# LINE 95 "./Graphics/UI/Gtk/ModelView/TreeRowReference.chs" #-}selfforeignimportccallunsafe"&gtk_tree_row_reference_free"tree_row_reference_free::FinalizerPtrTreeRowReferenceforeignimportccallsafe"gtk_tree_row_reference_new"gtk_tree_row_reference_new::((PtrTreeModel)->((PtrNativeTreePath)->(IO(PtrTreeRowReference))))foreignimportccallunsafe"gtk_tree_row_reference_get_path"gtk_tree_row_reference_get_path::((PtrTreeRowReference)->(IO(PtrNativeTreePath)))foreignimportccallunsafe"gtk_tree_row_reference_valid"gtk_tree_row_reference_valid::((PtrTreeRowReference)->(IOCInt))