Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GtkStringSorter is a Sorter
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
- 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
- stringSorterSetExpression :: (HasCallStack, MonadIO m, IsStringSorter a, IsExpression b) => a -> Maybe b -> m ()
- stringSorterSetIgnoreCase :: (HasCallStack, MonadIO m, IsStringSorter a) => a -> Bool -> 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.
StringSorter (ManagedPtr StringSorter) |
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 toManagedPtr :: StringSorter -> ManagedPtr 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
getData, getExpression, getIgnoreCase, getOrder, getProperty, getQdata.
Setters
setData, setDataFull, setExpression, setIgnoreCase, setProperty.
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.
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
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 matching 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 ]