gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.StringFilter

Description

GtkStringFilter determines whether to include items by comparing strings to a fixed search term.

The strings are obtained from the items by evaluating a GtkExpression set with stringFilterSetExpression, and they are compared against a search term set with stringFilterSetSearch.

GtkStringFilter has several different modes of comparison - it can match the whole string, just a prefix, or any substring. Use stringFilterSetMatchMode choose a mode.

It is also possible to make case-insensitive comparisons, with stringFilterSetIgnoreCase.

Synopsis

Exported types

newtype StringFilter Source #

Memory-managed wrapper type.

Constructors

StringFilter (ManagedPtr StringFilter) 

Instances

Instances details
Eq StringFilter Source # 
Instance details

Defined in GI.Gtk.Objects.StringFilter

GObject StringFilter Source # 
Instance details

Defined in GI.Gtk.Objects.StringFilter

ManagedPtrNewtype StringFilter Source # 
Instance details

Defined in GI.Gtk.Objects.StringFilter

Methods

toManagedPtr :: StringFilter -> ManagedPtr StringFilter

TypedObject StringFilter Source # 
Instance details

Defined in GI.Gtk.Objects.StringFilter

Methods

glibType :: IO GType

HasParentTypes StringFilter Source # 
Instance details

Defined in GI.Gtk.Objects.StringFilter

IsGValue (Maybe StringFilter) Source #

Convert StringFilter to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.StringFilter

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe StringFilter -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe StringFilter)

type ParentTypes StringFilter Source # 
Instance details

Defined in GI.Gtk.Objects.StringFilter

type ParentTypes StringFilter = '[Filter, Object]

class (GObject o, IsDescendantOf StringFilter o) => IsStringFilter o Source #

Type class for types which can be safely cast to StringFilter, for instance with toStringFilter.

Instances

Instances details
(GObject o, IsDescendantOf StringFilter o) => IsStringFilter o Source # 
Instance details

Defined in GI.Gtk.Objects.StringFilter

toStringFilter :: (MonadIO m, IsStringFilter o) => o -> m StringFilter Source #

Cast to StringFilter, for types for which this is known to be safe. For general casts, use castTo.

Methods

getExpression

stringFilterGetExpression Source #

Arguments

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

self: a GtkStringFilter

-> m (Maybe Expression)

Returns: a GtkExpression

Gets the expression that the string filter uses to obtain strings from items.

getIgnoreCase

stringFilterGetIgnoreCase Source #

Arguments

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

self: a GtkStringFilter

-> m Bool

Returns: True if the filter ignores case

Returns whether the filter ignores case differences.

getMatchMode

stringFilterGetMatchMode Source #

Arguments

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

self: a GtkStringFilter

-> m StringFilterMatchMode

Returns: the match mode of the filter

Returns the match mode that the filter is using.

getSearch

stringFilterGetSearch Source #

Arguments

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

self: a GtkStringFilter

-> m (Maybe Text)

Returns: The search term

Gets the search term.

new

stringFilterNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsExpression a) 
=> Maybe a

expression: The expression to evaluate

-> m StringFilter

Returns: a new GtkStringFilter

Creates a new string filter.

You will want to set up the filter by providing a string to search for and by providing a property to look up on the item.

setExpression

stringFilterSetExpression Source #

Arguments

:: (HasCallStack, MonadIO m, IsStringFilter a, IsExpression b) 
=> a

self: a GtkStringFilter

-> Maybe b

expression: a GtkExpression

-> m () 

Sets the expression that the string filter uses to obtain strings from items.

The expression must have a value type of G_TYPE_STRING.

setIgnoreCase

stringFilterSetIgnoreCase Source #

Arguments

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

self: a GtkStringFilter

-> Bool

ignoreCase: True to ignore case

-> m () 

Sets whether the filter ignores case differences.

setMatchMode

stringFilterSetMatchMode Source #

Arguments

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

self: a GtkStringFilter

-> StringFilterMatchMode

mode: the new match mode

-> m () 

Sets the match mode for the filter.

setSearch

stringFilterSetSearch Source #

Arguments

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

self: a GtkStringFilter

-> Maybe Text

search: The string to search for or Nothing to clear the search

-> m () 

Sets the string to search for.

Properties

expression

The expression to evaluate on item to get a string to compare with.

clearStringFilterExpression :: (MonadIO m, IsStringFilter o) => o -> m () Source #

Set the value of the “expression” property to Nothing. When overloading is enabled, this is equivalent to

clear #expression

constructStringFilterExpression :: (IsStringFilter o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “expression” property. This is rarely needed directly, but it is used by new.

getStringFilterExpression :: (MonadIO m, IsStringFilter o) => o -> m (Maybe Expression) Source #

Get the value of the “expression” property. When overloading is enabled, this is equivalent to

get stringFilter #expression

setStringFilterExpression :: (MonadIO m, IsStringFilter o, IsExpression a) => o -> a -> m () Source #

Set the value of the “expression” property. When overloading is enabled, this is equivalent to

set stringFilter [ #expression := value ]

ignoreCase

If matching is case sensitive.

constructStringFilterIgnoreCase :: (IsStringFilter o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “ignore-case” property. This is rarely needed directly, but it is used by new.

getStringFilterIgnoreCase :: (MonadIO m, IsStringFilter o) => o -> m Bool Source #

Get the value of the “ignore-case” property. When overloading is enabled, this is equivalent to

get stringFilter #ignoreCase

setStringFilterIgnoreCase :: (MonadIO m, IsStringFilter o) => o -> Bool -> m () Source #

Set the value of the “ignore-case” property. When overloading is enabled, this is equivalent to

set stringFilter [ #ignoreCase := value ]

matchMode

If exact matches are necessary or if substrings are allowed.

constructStringFilterMatchMode :: (IsStringFilter o, MonadIO m) => StringFilterMatchMode -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “match-mode” property. This is rarely needed directly, but it is used by new.

getStringFilterMatchMode :: (MonadIO m, IsStringFilter o) => o -> m StringFilterMatchMode Source #

Get the value of the “match-mode” property. When overloading is enabled, this is equivalent to

get stringFilter #matchMode

setStringFilterMatchMode :: (MonadIO m, IsStringFilter o) => o -> StringFilterMatchMode -> m () Source #

Set the value of the “match-mode” property. When overloading is enabled, this is equivalent to

set stringFilter [ #matchMode := value ]

search

The search term.

clearStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> m () Source #

Set the value of the “search” property to Nothing. When overloading is enabled, this is equivalent to

clear #search

constructStringFilterSearch :: (IsStringFilter o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “search” property. This is rarely needed directly, but it is used by new.

getStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> m (Maybe Text) Source #

Get the value of the “search” property. When overloading is enabled, this is equivalent to

get stringFilter #search

setStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> Text -> m () Source #

Set the value of the “search” property. When overloading is enabled, this is equivalent to

set stringFilter [ #search := value ]