Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- 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.
Instances
Eq StringSorter Source # | |
Defined in GI.Gtk.Objects.StringSorter (==) :: StringSorter -> StringSorter -> Bool # (/=) :: StringSorter -> StringSorter -> Bool # | |
GObject StringSorter Source # | |
Defined in GI.Gtk.Objects.StringSorter | |
ManagedPtrNewtype StringSorter Source # | |
Defined in GI.Gtk.Objects.StringSorter | |
TypedObject StringSorter Source # | |
Defined in GI.Gtk.Objects.StringSorter | |
HasParentTypes StringSorter Source # | |
Defined in GI.Gtk.Objects.StringSorter | |
IsGValue (Maybe StringSorter) Source # | Convert |
Defined in GI.Gtk.Objects.StringSorter gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe StringSorter -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe StringSorter) # | |
type ParentTypes StringSorter Source # | |
Defined in GI.Gtk.Objects.StringSorter |
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
(GObject o, IsDescendantOf StringSorter o) => IsStringSorter o Source # | |
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
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 #
:: (HasCallStack, MonadIO m, IsStringSorter a) | |
=> a |
|
-> m Collation | Returns: The collation method |
Gets which collation method the sorter uses.
Since: 4.10
getExpression
stringSorterGetExpression Source #
:: (HasCallStack, MonadIO m, IsStringSorter a) | |
=> a |
|
-> m (Maybe Expression) | Returns: a |
Gets the expression that is evaluated to obtain strings from items.
getIgnoreCase
stringSorterGetIgnoreCase Source #
:: (HasCallStack, MonadIO m, IsStringSorter a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether the sorter ignores case differences.
new
:: (HasCallStack, MonadIO m, IsExpression a) | |
=> Maybe a |
|
-> m StringSorter | Returns: a new |
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 #
:: (HasCallStack, MonadIO m, IsStringSorter a) | |
=> a |
|
-> Collation |
|
-> m () |
Sets the collation method to use for sorting.
Since: 4.10
setExpression
stringSorterSetExpression Source #
:: (HasCallStack, MonadIO m, IsStringSorter a, IsExpression b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the expression that is evaluated to obtain strings from items.
The expression must have the type G_TYPE_STRING
.
setIgnoreCase
stringSorterSetIgnoreCase Source #
:: (HasCallStack, MonadIO m, IsStringSorter a) | |
=> a |
|
-> Bool |
|
-> 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 ]