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

GI.Gtk.Objects.StringSorter

Description

GtkStringSorter is a GtkSorter that compares strings.

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.

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

Synopsis

Exported types

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

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 ]