Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- newtype ListStore = ListStore (ManagedPtr ListStore)
- class (GObject o, IsDescendantOf ListStore o) => IsListStore o
- toListStore :: (MonadIO m, IsListStore o) => o -> m ListStore
- noListStore :: Maybe ListStore
- listStoreAppend :: (HasCallStack, MonadIO m, IsListStore a, IsObject b) => a -> b -> m ()
- listStoreInsert :: (HasCallStack, MonadIO m, IsListStore a, IsObject b) => a -> Word32 -> b -> m ()
- listStoreInsertSorted :: (HasCallStack, MonadIO m, IsListStore a, IsObject b) => a -> b -> CompareDataFunc -> m Word32
- listStoreNew :: (HasCallStack, MonadIO m) => GType -> m ListStore
- listStoreRemove :: (HasCallStack, MonadIO m, IsListStore a) => a -> Word32 -> m ()
- listStoreRemoveAll :: (HasCallStack, MonadIO m, IsListStore a) => a -> m ()
- listStoreSort :: (HasCallStack, MonadIO m, IsListStore a) => a -> CompareDataFunc -> m ()
- listStoreSplice :: (HasCallStack, MonadIO m, IsListStore a) => a -> Word32 -> Word32 -> [Object] -> m ()
- constructListStoreItemType :: IsListStore o => GType -> IO (GValueConstruct o)
- getListStoreItemType :: (MonadIO m, IsListStore o) => o -> m GType
Exported types
Memory-managed wrapper type.
Instances
GObject ListStore Source # | |
Defined in GI.Gio.Objects.ListStore gobjectType :: IO GType # | |
HasParentTypes ListStore Source # | |
Defined in GI.Gio.Objects.ListStore | |
type ParentTypes ListStore Source # | |
Defined in GI.Gio.Objects.ListStore |
class (GObject o, IsDescendantOf ListStore o) => IsListStore o Source #
Type class for types which can be safely cast to ListStore
, for instance with toListStore
.
Instances
(GObject o, IsDescendantOf ListStore o) => IsListStore o Source # | |
Defined in GI.Gio.Objects.ListStore |
toListStore :: (MonadIO m, IsListStore o) => o -> m ListStore Source #
Methods
append
:: (HasCallStack, MonadIO m, IsListStore a, IsObject b) | |
=> a |
|
-> b |
|
-> m () |
Appends item
to store
. item
must be of type ListStore
:item-type
.
This function takes a ref on item
.
Use listStoreSplice
to append multiple items at the same time
efficiently.
Since: 2.44
insert
:: (HasCallStack, MonadIO m, IsListStore a, IsObject b) | |
=> a |
|
-> Word32 |
|
-> b |
|
-> m () |
Inserts item
into store
at position
. item
must be of type
ListStore
:item-type
or derived from it. position
must be smaller
than the length of the list, or equal to it to append.
This function takes a ref on item
.
Use listStoreSplice
to insert multiple items at the same time
efficiently.
Since: 2.44
insertSorted
listStoreInsertSorted Source #
:: (HasCallStack, MonadIO m, IsListStore a, IsObject b) | |
=> a |
|
-> b |
|
-> CompareDataFunc |
|
-> m Word32 | Returns: the position at which |
Inserts item
into store
at a position to be determined by the
compareFunc
.
The list must already be sorted before calling this function or the result is undefined. Usually you would approach this by only ever inserting items by way of this function.
This function takes a ref on item
.
Since: 2.44
new
remove
:: (HasCallStack, MonadIO m, IsListStore a) | |
=> a |
|
-> Word32 |
|
-> m () |
Removes the item from store
that is at position
. position
must be
smaller than the current length of the list.
Use listStoreSplice
to remove multiple items at the same time
efficiently.
Since: 2.44
removeAll
:: (HasCallStack, MonadIO m, IsListStore a) | |
=> a |
|
-> m () |
Removes all items from store
.
Since: 2.44
sort
:: (HasCallStack, MonadIO m, IsListStore a) | |
=> a |
|
-> CompareDataFunc |
|
-> m () |
Sort the items in store
according to compareFunc
.
Since: 2.46
splice
:: (HasCallStack, MonadIO m, IsListStore a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> [Object] |
|
-> m () |
Changes store
by removing nRemovals
items and adding nAdditions
items to it. additions
must contain nAdditions
items of type
ListStore
:item-type
. Nothing
is not permitted.
This function is more efficient than listStoreInsert
and
listStoreRemove
, because it only emits
ListModel
::items-changed
once for the change.
This function takes a ref on each item in additions
.
The parameters position
and nRemovals
must be correct (ie:
position
+ nRemovals
must be less than or equal to the length of
the list at the time this function is called).
Since: 2.44
Properties
itemType
The type of items contained in this list store. Items must be
subclasses of Object
.
Since: 2.44
constructListStoreItemType :: IsListStore o => GType -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “item-type
” property. This is rarely needed directly, but it is used by new
.
getListStoreItemType :: (MonadIO m, IsListStore o) => o -> m GType Source #
Get the value of the “item-type
” property.
When overloading is enabled, this is equivalent to
get
listStore #itemType