gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.StringFilter

Contents

- Exported types
- Methods
  - getExpression
  - getIgnoreCase
  - getMatchMode
  - getSearch
  - new
  - setExpression
  - setIgnoreCase
  - setMatchMode
  - setSearch
- Properties
  - expression
  - ignoreCase
  - matchMode
  - search

Description

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

The strings are obtained from the items by evaluating an expression 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

- newtype StringFilter = StringFilter (ManagedPtr StringFilter)
- class (GObject o, IsDescendantOf StringFilter o) => IsStringFilter o
- toStringFilter :: (MonadIO m, IsStringFilter o) => o -> m StringFilter
- stringFilterGetExpression :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> m (Maybe Expression)
- stringFilterGetIgnoreCase :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> m Bool
- stringFilterGetMatchMode :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> m StringFilterMatchMode
- stringFilterGetSearch :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> m (Maybe Text)
- stringFilterNew :: (HasCallStack, MonadIO m, IsExpression a) => Maybe a -> m StringFilter
- stringFilterSetExpression :: (HasCallStack, MonadIO m, IsStringFilter a, IsExpression b) => a -> Maybe b -> m ()
- stringFilterSetIgnoreCase :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> Bool -> m ()
- stringFilterSetMatchMode :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> StringFilterMatchMode -> m ()
- stringFilterSetSearch :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> Maybe Text -> m ()
- clearStringFilterExpression :: (MonadIO m, IsStringFilter o) => o -> m ()
- constructStringFilterExpression :: (IsStringFilter o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o)
- getStringFilterExpression :: (MonadIO m, IsStringFilter o) => o -> m (Maybe Expression)
- setStringFilterExpression :: (MonadIO m, IsStringFilter o, IsExpression a) => o -> a -> m ()
- constructStringFilterIgnoreCase :: (IsStringFilter o, MonadIO m) => Bool -> m (GValueConstruct o)
- getStringFilterIgnoreCase :: (MonadIO m, IsStringFilter o) => o -> m Bool
- setStringFilterIgnoreCase :: (MonadIO m, IsStringFilter o) => o -> Bool -> m ()
- constructStringFilterMatchMode :: (IsStringFilter o, MonadIO m) => StringFilterMatchMode -> m (GValueConstruct o)
- getStringFilterMatchMode :: (MonadIO m, IsStringFilter o) => o -> m StringFilterMatchMode
- setStringFilterMatchMode :: (MonadIO m, IsStringFilter o) => o -> StringFilterMatchMode -> m ()
- clearStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> m ()
- constructStringFilterSearch :: (IsStringFilter o, MonadIO m) => Text -> m (GValueConstruct o)
- getStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> m (Maybe Text)
- setStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> Text -> m ()

# 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 Methods (==) :: StringFilter -> StringFilter -> Bool Source # (/=) :: StringFilter -> StringFilter -> Bool Source #
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 Source #
TypedObject StringFilter Source # |
Instance details Defined in GI.Gtk.Objects.StringFilter Methods glibType :: IO GType Source #
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 Source # gvalueSet_ :: Ptr GValue -> Maybe StringFilter -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe StringFilter) Source #
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

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, changed, forceFloating, freezeNotify, getv, isFloating, match, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getExpression, getIgnoreCase, getMatchMode, getProperty, getQdata, getSearch, getStrictness.

#### Setters

setData, setDataFull, setExpression, setIgnoreCase, setMatchMode, setProperty, setSearch.

## getExpression

stringFilterGetExpression Source #

Arguments

:: (HasCallStack, MonadIO m, IsStringFilter a) |
=> a | `self`: a string filter
-> m (Maybe Expression) | Returns: the expression

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 string filter
-> 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 string filter
-> 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 string filter
-> 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 string filter
-> Maybe b | `expression`: the expression
-> 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 string filter
-> 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 string filter
-> 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 string filter
-> Maybe Text | `search`: the string to search for
-> m () |

Sets the string to search for.

# Properties

## expression

The expression to evaluate on each 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 ]