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

Contents

- Exported types
- Methods
  - getExpression
  - getSortOrder
  - new
  - setExpression
  - setSortOrder
- Properties
  - expression
  - sortOrder

Description

Sorts items numerically.

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

Synopsis

- newtype NumericSorter = NumericSorter (ManagedPtr NumericSorter)
- class (GObject o, IsDescendantOf NumericSorter o) => IsNumericSorter o
- toNumericSorter :: (MonadIO m, IsNumericSorter o) => o -> m NumericSorter
- numericSorterGetExpression :: (HasCallStack, MonadIO m, IsNumericSorter a) => a -> m (Maybe Expression)
- numericSorterGetSortOrder :: (HasCallStack, MonadIO m, IsNumericSorter a) => a -> m SortType
- numericSorterNew :: (HasCallStack, MonadIO m, IsExpression a) => Maybe a -> m NumericSorter
- numericSorterSetExpression :: (HasCallStack, MonadIO m, IsNumericSorter a, IsExpression b) => a -> Maybe b -> m ()
- numericSorterSetSortOrder :: (HasCallStack, MonadIO m, IsNumericSorter a) => a -> SortType -> m ()
- clearNumericSorterExpression :: (MonadIO m, IsNumericSorter o) => o -> m ()
- constructNumericSorterExpression :: (IsNumericSorter o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o)
- getNumericSorterExpression :: (MonadIO m, IsNumericSorter o) => o -> m (Maybe Expression)
- setNumericSorterExpression :: (MonadIO m, IsNumericSorter o, IsExpression a) => o -> a -> m ()
- constructNumericSorterSortOrder :: (IsNumericSorter o, MonadIO m) => SortType -> m (GValueConstruct o)
- getNumericSorterSortOrder :: (MonadIO m, IsNumericSorter o) => o -> m SortType
- setNumericSorterSortOrder :: (MonadIO m, IsNumericSorter o) => o -> SortType -> m ()

# Exported types

newtype NumericSorter Source #

Memory-managed wrapper type.

Constructors

NumericSorter (ManagedPtr NumericSorter) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf NumericSorter o) => IsNumericSorter o Source #

Type class for types which can be safely cast to `NumericSorter`, for instance with `toNumericSorter`.

#### Instances

Instances details

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

toNumericSorter :: (MonadIO m, IsNumericSorter o) => o -> m NumericSorter Source #

Cast to `NumericSorter`, 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

getData, getExpression, getOrder, getProperty, getQdata, getSortOrder.

#### Setters

setData, setDataFull, setExpression, setProperty, setSortOrder.

## getExpression

numericSorterGetExpression Source #

Arguments

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

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

## getSortOrder

numericSorterGetSortOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumericSorter a) |
=> a | `self`: a `GtkNumericSorter`
-> m SortType | Returns: the order of the numbers

Gets whether this sorter will sort smaller numbers first.

## new

numericSorterNew Source #

Arguments

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

Creates a new numeric sorter using the given `expression`.

Smaller numbers will be sorted first. You can call `numericSorterSetSortOrder` to change this.

## setExpression

numericSorterSetExpression Source #

Arguments

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

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

Unless an expression is set on `self`, the sorter will always compare items as invalid.

The expression must have a return type that can be compared numerically, such as `G_TYPE_INT` or `G_TYPE_DOUBLE`.

## setSortOrder

numericSorterSetSortOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumericSorter a) |
=> a | `self`: a `GtkNumericSorter`
-> SortType | `sortOrder`: whether to sort smaller numbers first
-> m () |

Sets whether to sort smaller numbers before larger ones.

# Properties

## expression

The expression to evaluate on items to get a number to compare with.

clearNumericSorterExpression :: (MonadIO m, IsNumericSorter o) => o -> m () Source #

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

    clear #expression

constructNumericSorterExpression :: (IsNumericSorter 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`.

getNumericSorterExpression :: (MonadIO m, IsNumericSorter o) => o -> m (Maybe Expression) Source #

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

    get numericSorter #expression

setNumericSorterExpression :: (MonadIO m, IsNumericSorter o, IsExpression a) => o -> a -> m () Source #

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

    set numericSorter [ #expression := value ]

## sortOrder

Whether the sorter will sort smaller numbers first.

constructNumericSorterSortOrder :: (IsNumericSorter o, MonadIO m) => SortType -> m (GValueConstruct o) Source #

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

getNumericSorterSortOrder :: (MonadIO m, IsNumericSorter o) => o -> m SortType Source #

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

    get numericSorter #sortOrder

setNumericSorterSortOrder :: (MonadIO m, IsNumericSorter o) => o -> SortType -> m () Source #

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

    set numericSorter [ #sortOrder := value ]