gi-gtk-4.0.1: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

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

Exported types

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

Instances details
(GObject o, IsDescendantOf FilterListModel o) => IsFilterListModel o Source # 
Instance details

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

self: a FilterListModel

-> 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

self: a FilterListModel

-> m Bool

Returns: True if a filter function is set

Checks if a filter function is currently set on self

new

filterListModelNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsListModel a) 
=> a

model: the model to sort

-> Maybe FilterListModelFilterFunc

filterFunc: filter function or Nothing to not filter items

-> m FilterListModel

Returns: a new FilterListModel

Creates a new FilterListModel that will filter model using the given filterFunc.

newForType

filterListModelNewForType Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GType

itemType: the type of the items that will be returned

-> m FilterListModel

Returns: a new FilterListModel

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

self: a FilterListModel

-> 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

self: a FilterListModel

-> Maybe FilterListModelFilterFunc

filterFunc: filter function or Nothing to not filter items

-> 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

self: a FilterListModel

-> Maybe b

model: The model to be filtered

-> 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 => 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.

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, IsListModel a) => a -> IO (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