| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gtk.Objects.FilterListModel
Description
FilterListModel is a list model that filters a given other
listmodel.
It hides some elements from the other model according to
criteria given by a FilterListModelFilterFunc.
Synopsis
- newtype FilterListModel = FilterListModel (ManagedPtr FilterListModel)
- class (GObject o, IsDescendantOf FilterListModel o) => IsFilterListModel o
- toFilterListModel :: (MonadIO m, IsFilterListModel o) => o -> m FilterListModel
- filterListModelGetModel :: (HasCallStack, MonadIO m, IsFilterListModel a) => a -> m (Maybe ListModel)
- filterListModelHasFilter :: (HasCallStack, MonadIO m, IsFilterListModel a) => a -> m Bool
- filterListModelNew :: (HasCallStack, MonadIO m, IsListModel a) => a -> Maybe FilterListModelFilterFunc -> m FilterListModel
- filterListModelNewForType :: (HasCallStack, MonadIO m) => GType -> m FilterListModel
- filterListModelRefilter :: (HasCallStack, MonadIO m, IsFilterListModel a) => a -> m ()
- filterListModelSetFilterFunc :: (HasCallStack, MonadIO m, IsFilterListModel a) => a -> Maybe FilterListModelFilterFunc -> m ()
- filterListModelSetModel :: (HasCallStack, MonadIO m, IsFilterListModel a, IsListModel b) => a -> Maybe b -> m ()
- getFilterListModelHasFilter :: (MonadIO m, IsFilterListModel o) => o -> m Bool
- constructFilterListModelItemType :: (IsFilterListModel o, MonadIO m) => GType -> m (GValueConstruct o)
- getFilterListModelItemType :: (MonadIO m, IsFilterListModel o) => o -> m GType
- constructFilterListModelModel :: (IsFilterListModel o, MonadIO m, IsListModel a) => a -> m (GValueConstruct o)
- getFilterListModelModel :: (MonadIO m, IsFilterListModel o) => o -> m (Maybe ListModel)
Exported types
newtype FilterListModel Source #
Memory-managed wrapper type.
Constructors
| FilterListModel (ManagedPtr FilterListModel) |
Instances
| Eq FilterListModel Source # | |
Defined in GI.Gtk.Objects.FilterListModel Methods (==) :: FilterListModel -> FilterListModel -> Bool (/=) :: FilterListModel -> FilterListModel -> Bool | |
| GObject FilterListModel Source # | |
Defined in GI.Gtk.Objects.FilterListModel | |
| ManagedPtrNewtype FilterListModel Source # | |
Defined in GI.Gtk.Objects.FilterListModel Methods toManagedPtr :: FilterListModel -> ManagedPtr FilterListModel | |
| TypedObject FilterListModel Source # | |
Defined in GI.Gtk.Objects.FilterListModel Methods glibType :: IO GType | |
| IsGValue FilterListModel Source # | Convert |
Defined in GI.Gtk.Objects.FilterListModel | |
| HasParentTypes FilterListModel Source # | |
Defined in GI.Gtk.Objects.FilterListModel | |
| type ParentTypes FilterListModel Source # | |
Defined in GI.Gtk.Objects.FilterListModel type ParentTypes FilterListModel = '[Object, ListModel] | |
class (GObject o, IsDescendantOf FilterListModel o) => IsFilterListModel o Source #
Type class for types which can be safely cast to FilterListModel, for instance with toFilterListModel.
Instances
| (GObject o, IsDescendantOf FilterListModel o) => IsFilterListModel o Source # | |
Defined in GI.Gtk.Objects.FilterListModel | |
toFilterListModel :: (MonadIO m, IsFilterListModel o) => o -> m FilterListModel Source #
Cast to FilterListModel, for types for which this is known to be safe. For general casts, use castTo.
Methods
Overloaded methods
getModel
filterListModelGetModel Source #
Arguments
| :: (HasCallStack, MonadIO m, IsFilterListModel a) | |
| => a |
|
| -> m (Maybe ListModel) | Returns: The model that gets filtered |
Gets the model currently filtered or Nothing if none.
hasFilter
filterListModelHasFilter Source #
Arguments
| :: (HasCallStack, MonadIO m, IsFilterListModel a) | |
| => a |
|
| -> m Bool | Returns: |
Checks if a filter function is currently set on self
new
Arguments
| :: (HasCallStack, MonadIO m, IsListModel a) | |
| => a |
|
| -> Maybe FilterListModelFilterFunc |
|
| -> m FilterListModel | Returns: a new |
Creates a new FilterListModel that will filter model using the given
filterFunc.
newForType
filterListModelNewForType Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GType |
|
| -> m FilterListModel | Returns: a new |
Creates a new empty filter list model set up to return items of type itemType.
It is up to the application to set a proper filter function and model to ensure
the item type is matched.
refilter
filterListModelRefilter Source #
Arguments
| :: (HasCallStack, MonadIO m, IsFilterListModel a) | |
| => a |
|
| -> m () |
Causes self to refilter all items in the model.
Calling this function is necessary when data used by the filter function has changed.
setFilterFunc
filterListModelSetFilterFunc Source #
Arguments
| :: (HasCallStack, MonadIO m, IsFilterListModel a) | |
| => a |
|
| -> Maybe FilterListModelFilterFunc |
|
| -> m () |
Sets the function used to filter items. The function will be called for every
item and if it returns True the item is considered visible.
setModel
filterListModelSetModel Source #
Arguments
| :: (HasCallStack, MonadIO m, IsFilterListModel a, IsListModel b) | |
| => a |
|
| -> Maybe b |
|
| -> m () |
Sets the model to be filtered.
Note that GTK makes no effort to ensure that model conforms to
the item type of self. It assumes that the caller knows what they
are doing and have set up an appropriate filter function to ensure
that item types match.
Properties
hasFilter
If a filter is set for this model
getFilterListModelHasFilter :: (MonadIO m, IsFilterListModel o) => o -> m Bool Source #
Get the value of the “has-filter” property.
When overloading is enabled, this is equivalent to
get filterListModel #hasFilter
itemType
The GType for elements of this object
constructFilterListModelItemType :: (IsFilterListModel o, MonadIO m) => GType -> m (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.
getFilterListModelItemType :: (MonadIO m, IsFilterListModel o) => o -> m GType Source #
Get the value of the “item-type” property.
When overloading is enabled, this is equivalent to
get filterListModel #itemType
model
The model being filtered
constructFilterListModelModel :: (IsFilterListModel o, MonadIO m, IsListModel a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “model” property. This is rarely needed directly, but it is used by new.
getFilterListModelModel :: (MonadIO m, IsFilterListModel o) => o -> m (Maybe ListModel) Source #
Get the value of the “model” property.
When overloading is enabled, this is equivalent to
get filterListModel #model