Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
TreeSortable
is an interface to be implemented by tree models which
support sorting. The TreeView
uses the methods provided by this interface
to sort the model.
Synopsis
- newtype TreeSortable = TreeSortable (ManagedPtr TreeSortable)
- class (GObject o, IsDescendantOf TreeSortable o) => IsTreeSortable o
- toTreeSortable :: (MonadIO m, IsTreeSortable o) => o -> m TreeSortable
- treeSortableGetSortColumnId :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> m (Bool, Int32, SortType)
- treeSortableHasDefaultSortFunc :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> m Bool
- treeSortableSetDefaultSortFunc :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> TreeIterCompareFunc -> m ()
- treeSortableSetSortColumnId :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> Int32 -> SortType -> m ()
- treeSortableSetSortFunc :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> Int32 -> TreeIterCompareFunc -> m ()
- treeSortableSortColumnChanged :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> m ()
- type C_TreeSortableSortColumnChangedCallback = Ptr () -> Ptr () -> IO ()
- type TreeSortableSortColumnChangedCallback = IO ()
- afterTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId
- genClosure_TreeSortableSortColumnChanged :: MonadIO m => TreeSortableSortColumnChangedCallback -> m (GClosure C_TreeSortableSortColumnChangedCallback)
- mk_TreeSortableSortColumnChangedCallback :: C_TreeSortableSortColumnChangedCallback -> IO (FunPtr C_TreeSortableSortColumnChangedCallback)
- noTreeSortableSortColumnChangedCallback :: Maybe TreeSortableSortColumnChangedCallback
- onTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId
- wrap_TreeSortableSortColumnChangedCallback :: TreeSortableSortColumnChangedCallback -> C_TreeSortableSortColumnChangedCallback
Exported types
newtype TreeSortable Source #
Memory-managed wrapper type.
TreeSortable (ManagedPtr TreeSortable) |
Instances
Eq TreeSortable Source # | |
Defined in GI.Gtk.Interfaces.TreeSortable (==) :: TreeSortable -> TreeSortable -> Bool # (/=) :: TreeSortable -> TreeSortable -> Bool # | |
GObject TreeSortable Source # | |
Defined in GI.Gtk.Interfaces.TreeSortable | |
ManagedPtrNewtype TreeSortable Source # | |
Defined in GI.Gtk.Interfaces.TreeSortable toManagedPtr :: TreeSortable -> ManagedPtr TreeSortable | |
TypedObject TreeSortable Source # | |
Defined in GI.Gtk.Interfaces.TreeSortable | |
HasParentTypes TreeSortable Source # | |
Defined in GI.Gtk.Interfaces.TreeSortable | |
IsGValue (Maybe TreeSortable) Source # | Convert |
Defined in GI.Gtk.Interfaces.TreeSortable gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TreeSortable -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TreeSortable) | |
type ParentTypes TreeSortable Source # | |
Defined in GI.Gtk.Interfaces.TreeSortable |
class (GObject o, IsDescendantOf TreeSortable o) => IsTreeSortable o Source #
Type class for types which can be safely cast to TreeSortable
, for instance with toTreeSortable
.
Instances
(GObject o, IsDescendantOf TreeSortable o) => IsTreeSortable o Source # | |
Defined in GI.Gtk.Interfaces.TreeSortable |
toTreeSortable :: (MonadIO m, IsTreeSortable o) => o -> m TreeSortable Source #
Cast to TreeSortable
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, filterNew, forceFloating, foreach, freezeNotify, getv, hasDefaultSortFunc, isFloating, iterChildren, iterHasChild, iterNChildren, iterNext, iterNthChild, iterParent, iterPrevious, notify, notifyByPspec, ref, refNode, refSink, rowChanged, rowDeleted, rowHasChildToggled, rowInserted, rowsReordered, runDispose, sortColumnChanged, stealData, stealQdata, thawNotify, unref, unrefNode, watchClosure.
Getters
getColumnType, getData, getFlags, getIter, getIterFirst, getIterFromString, getNColumns, getPath, getProperty, getQdata, getSortColumnId, getStringFromIter, getValue.
Setters
setData, setDataFull, setDefaultSortFunc, setProperty, setSortColumnId, setSortFunc.
getSortColumnId
treeSortableGetSortColumnId Source #
:: (HasCallStack, MonadIO m, IsTreeSortable a) | |
=> a |
|
-> m (Bool, Int32, SortType) | Returns: |
Fills in sortColumnId
and order
with the current sort column and the
order. It returns True
unless the sortColumnId
is
TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
or
TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID
.
hasDefaultSortFunc
treeSortableHasDefaultSortFunc Source #
:: (HasCallStack, MonadIO m, IsTreeSortable a) | |
=> a |
|
-> m Bool | Returns: |
Returns True
if the model has a default sort function. This is used
primarily by GtkTreeViewColumns in order to determine if a model can
go back to the default state, or not.
setDefaultSortFunc
treeSortableSetDefaultSortFunc Source #
:: (HasCallStack, MonadIO m, IsTreeSortable a) | |
=> a |
|
-> TreeIterCompareFunc |
|
-> m () |
Sets the default comparison function used when sorting to be sortFunc
.
If the current sort column id of sortable
is
TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
, then the model will sort using
this function.
If sortFunc
is Nothing
, then there will be no default comparison function.
This means that once the model has been sorted, it can’t go back to the
default state. In this case, when the current sort column id of sortable
is TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
, the model will be unsorted.
setSortColumnId
treeSortableSetSortColumnId Source #
:: (HasCallStack, MonadIO m, IsTreeSortable a) | |
=> a |
|
-> Int32 |
|
-> SortType |
|
-> m () |
Sets the current sort column to be sortColumnId
. The sortable
will
resort itself to reflect this change, after emitting a
sortColumnChanged signal. sortColumnId
may either be
a regular column id, or one of the following special values:
TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
: the default sort function will be used, if it is setTREE_SORTABLE_UNSORTED_SORT_COLUMN_ID
: no sorting will occur
setSortFunc
treeSortableSetSortFunc Source #
:: (HasCallStack, MonadIO m, IsTreeSortable a) | |
=> a |
|
-> Int32 |
|
-> TreeIterCompareFunc |
|
-> m () |
Sets the comparison function used when sorting to be sortFunc
. If the
current sort column id of sortable
is the same as sortColumnId
, then
the model will sort using this function.
sortColumnChanged
treeSortableSortColumnChanged Source #
:: (HasCallStack, MonadIO m, IsTreeSortable a) | |
=> a |
|
-> m () |
Emits a sortColumnChanged signal on sortable
.
Signals
sortColumnChanged
type C_TreeSortableSortColumnChangedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type TreeSortableSortColumnChangedCallback = IO () Source #
The sortColumnChanged signal is emitted when the sort column
or sort order of sortable
is changed. The signal is emitted before
the contents of sortable
are resorted.
afterTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the sortColumnChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
treeSortable #sortColumnChanged callback
genClosure_TreeSortableSortColumnChanged :: MonadIO m => TreeSortableSortColumnChangedCallback -> m (GClosure C_TreeSortableSortColumnChangedCallback) Source #
Wrap the callback into a GClosure
.
mk_TreeSortableSortColumnChangedCallback :: C_TreeSortableSortColumnChangedCallback -> IO (FunPtr C_TreeSortableSortColumnChangedCallback) Source #
Generate a function pointer callable from C code, from a C_TreeSortableSortColumnChangedCallback
.
noTreeSortableSortColumnChangedCallback :: Maybe TreeSortableSortColumnChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
TreeSortableSortColumnChangedCallback
onTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the sortColumnChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
treeSortable #sortColumnChanged callback