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

Contents

- Exported types
- Methods
  - getCollation
  - getExpression
  - getIgnoreCase
  - new
  - setCollation
  - setExpression
  - setIgnoreCase
- Properties
  - collation
  - expression
  - ignoreCase

Description

Sorts items by comparing strings.

To obtain the strings to compare, this sorter evaluates a `Expression`.

It does the comparison in a linguistically correct way using the current locale by normalizing Unicode strings and possibly case-folding them before performing the comparison.

Synopsis

- newtype StringSorter = StringSorter (ManagedPtr StringSorter)
- class (GObject o, IsDescendantOf StringSorter o) => IsStringSorter o
- toStringSorter :: (MonadIO m, IsStringSorter o) => o -> m StringSorter
- stringSorterGetCollation :: (HasCallStack, MonadIO m, IsStringSorter a) => a -> m Collation
- stringSorterGetExpression :: (HasCallStack, MonadIO m, IsStringSorter a) => a -> m (Maybe Expression)
- stringSorterGetIgnoreCase :: (HasCallStack, MonadIO m, IsStringSorter a) => a -> m Bool
- stringSorterNew :: (HasCallStack, MonadIO m, IsExpression a) => Maybe a -> m StringSorter
- stringSorterSetCollation :: (HasCallStack, MonadIO m, IsStringSorter a) => a -> Collation -> m ()
- stringSorterSetExpression :: (HasCallStack, MonadIO m, IsStringSorter a, IsExpression b) => a -> Maybe b -> m ()
- stringSorterSetIgnoreCase :: (HasCallStack, MonadIO m, IsStringSorter a) => a -> Bool -> m ()
- constructStringSorterCollation :: (IsStringSorter o, MonadIO m) => Collation -> m (GValueConstruct o)
- getStringSorterCollation :: (MonadIO m, IsStringSorter o) => o -> m Collation
- setStringSorterCollation :: (MonadIO m, IsStringSorter o) => o -> Collation -> m ()
- clearStringSorterExpression :: (MonadIO m, IsStringSorter o) => o -> m ()
- constructStringSorterExpression :: (IsStringSorter o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o)
- getStringSorterExpression :: (MonadIO m, IsStringSorter o) => o -> m (Maybe Expression)
- setStringSorterExpression :: (MonadIO m, IsStringSorter o, IsExpression a) => o -> a -> m ()
- constructStringSorterIgnoreCase :: (IsStringSorter o, MonadIO m) => Bool -> m (GValueConstruct o)
- getStringSorterIgnoreCase :: (MonadIO m, IsStringSorter o) => o -> m Bool
- setStringSorterIgnoreCase :: (MonadIO m, IsStringSorter o) => o -> Bool -> m ()

# Exported types

newtype StringSorter Source #

Memory-managed wrapper type.

Constructors

StringSorter (ManagedPtr StringSorter) |

#### Instances

Instances details

Eq StringSorter Source # |
Instance details Defined in GI.Gtk.Objects.StringSorter Methods (==) :: StringSorter -> StringSorter -> Bool Source # (/=) :: StringSorter -> StringSorter -> Bool Source #
GObject StringSorter Source # |
Instance details Defined in GI.Gtk.Objects.StringSorter
ManagedPtrNewtype StringSorter Source # |
Instance details Defined in GI.Gtk.Objects.StringSorter Methods toManagedPtr :: StringSorter -> ManagedPtr StringSorter Source #
TypedObject StringSorter Source # |
Instance details Defined in GI.Gtk.Objects.StringSorter Methods glibType :: IO GType Source #
HasParentTypes StringSorter Source # |
Instance details Defined in GI.Gtk.Objects.StringSorter
IsGValue (Maybe StringSorter) Source # | Convert `StringSorter` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.StringSorter Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe StringSorter -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe StringSorter) Source #
type ParentTypes StringSorter Source # |
Instance details Defined in GI.Gtk.Objects.StringSorter type ParentTypes StringSorter = '[Sorter, Object]

class (GObject o, IsDescendantOf StringSorter o) => IsStringSorter o Source #

Type class for types which can be safely cast to `StringSorter`, for instance with `toStringSorter`.

#### Instances

Instances details

(GObject o, IsDescendantOf StringSorter o) => IsStringSorter o Source # |
Instance details Defined in GI.Gtk.Objects.StringSorter

toStringSorter :: (MonadIO m, IsStringSorter o) => o -> m StringSorter Source #

Cast to `StringSorter`, 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, compare, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getCollation, getData, getExpression, getIgnoreCase, getOrder, getProperty, getQdata.

#### Setters

setCollation, setData, setDataFull, setExpression, setIgnoreCase, setProperty.

## getCollation

stringSorterGetCollation Source #

Arguments

:: (HasCallStack, MonadIO m, IsStringSorter a) |
=> a | `self`: a `GtkStringSorter`
-> m Collation | Returns: The collation method

Gets which collation method the sorter uses.

Since: 4.10

## getExpression

stringSorterGetExpression Source #

Arguments

:: (HasCallStack, MonadIO m, IsStringSorter a) |
=> a | `self`: a `GtkStringSorter`
-> m (Maybe Expression) | Returns: a `GtkExpression`

Gets the expression that is evaluated to obtain strings from items.

## getIgnoreCase

stringSorterGetIgnoreCase Source #

Arguments

:: (HasCallStack, MonadIO m, IsStringSorter a) |
=> a | `self`: a `GtkStringSorter`
-> m Bool | Returns: `True` if `self` is ignoring case differences

Gets whether the sorter ignores case differences.

## new

stringSorterNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsExpression a) |
=> Maybe a | `expression`: The expression to evaluate
-> m StringSorter | Returns: a new `GtkStringSorter`

Creates a new string sorter that compares items using the given `expression`.

Unless an expression is set on it, this sorter will always compare items as invalid.

## setCollation

stringSorterSetCollation Source #

Arguments

:: (HasCallStack, MonadIO m, IsStringSorter a) |
=> a | `self`: a `GtkStringSorter`
-> Collation | `collation`: the collation method
-> m () |

Sets the collation method to use for sorting.

Since: 4.10

## setExpression

stringSorterSetExpression Source #

Arguments

:: (HasCallStack, MonadIO m, IsStringSorter a, IsExpression b) |
=> a | `self`: a `GtkStringSorter`
-> Maybe b | `expression`: a `GtkExpression`
-> m () |

Sets the expression that is evaluated to obtain strings from items.

The expression must have the type `G_TYPE_STRING`.

## setIgnoreCase

stringSorterSetIgnoreCase Source #

Arguments

:: (HasCallStack, MonadIO m, IsStringSorter a) |
=> a | `self`: a `GtkStringSorter`
-> Bool | `ignoreCase`: `True` to ignore case differences
-> m () |

Sets whether the sorter will ignore case differences.

# Properties

## collation

The collation method to use for sorting.

The `GTK_COLLATION_NONE` value is useful when the expression already returns collation keys, or strings that need to be compared byte-by-byte.

The default value, `GTK_COLLATION_UNICODE`, compares strings according to the Unicode collation algorithm.

Since: 4.10

constructStringSorterCollation :: (IsStringSorter o, MonadIO m) => Collation -> m (GValueConstruct o) Source #

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

getStringSorterCollation :: (MonadIO m, IsStringSorter o) => o -> m Collation Source #

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

    get stringSorter #collation

setStringSorterCollation :: (MonadIO m, IsStringSorter o) => o -> Collation -> m () Source #

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

    set stringSorter [ #collation := value ]

## expression

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

clearStringSorterExpression :: (MonadIO m, IsStringSorter o) => o -> m () Source #

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

    clear #expression

constructStringSorterExpression :: (IsStringSorter 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`.

getStringSorterExpression :: (MonadIO m, IsStringSorter o) => o -> m (Maybe Expression) Source #

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

    get stringSorter #expression

setStringSorterExpression :: (MonadIO m, IsStringSorter o, IsExpression a) => o -> a -> m () Source #

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

    set stringSorter [ #expression := value ]

## ignoreCase

If sorting is case sensitive.

constructStringSorterIgnoreCase :: (IsStringSorter 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`.

getStringSorterIgnoreCase :: (MonadIO m, IsStringSorter o) => o -> m Bool Source #

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

    get stringSorter #ignoreCase

setStringSorterIgnoreCase :: (MonadIO m, IsStringSorter o) => o -> Bool -> m () Source #

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

    set stringSorter [ #ignoreCase := value ]