gi-atk-2.0.22: Atk bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Atk.Interfaces.Selection

Contents

- Exported types
- Methods
  - Overloaded methods
  - addSelection
  - clearSelection
  - getSelectionCount
  - isChildSelected
  - refSelection
  - removeSelection
  - selectAllSelection
- Signals
  - selectionChanged

Description

`Selection` should be implemented by UI components with children which are exposed by `atk_object_ref_child` and `atk_object_get_n_children`, if the use of the parent UI component ordinarily involves selection of one or more of the objects corresponding to those `Object` children - for example, selectable lists.

Note that other types of "selection" (for instance text selection) are accomplished a other ATK interfaces - `Selection` is limited to the selection/deselection of children.

Synopsis

- newtype Selection = Selection (ManagedPtr Selection)
- class (GObject o, IsDescendantOf Selection o) => IsSelection o
- toSelection :: (MonadIO m, IsSelection o) => o -> m Selection
- selectionAddSelection :: (HasCallStack, MonadIO m, IsSelection a) => a -> Int32 -> m Bool
- selectionClearSelection :: (HasCallStack, MonadIO m, IsSelection a) => a -> m Bool
- selectionGetSelectionCount :: (HasCallStack, MonadIO m, IsSelection a) => a -> m Int32
- selectionIsChildSelected :: (HasCallStack, MonadIO m, IsSelection a) => a -> Int32 -> m Bool
- selectionRefSelection :: (HasCallStack, MonadIO m, IsSelection a) => a -> Int32 -> m (Maybe Object)
- selectionRemoveSelection :: (HasCallStack, MonadIO m, IsSelection a) => a -> Int32 -> m Bool
- selectionSelectAllSelection :: (HasCallStack, MonadIO m, IsSelection a) => a -> m Bool
- type C_SelectionSelectionChangedCallback = Ptr () -> Ptr () -> IO ()
- type SelectionSelectionChangedCallback = IO ()
- afterSelectionSelectionChanged :: (IsSelection a, MonadIO m) => a -> SelectionSelectionChangedCallback -> m SignalHandlerId
- genClosure_SelectionSelectionChanged :: MonadIO m => SelectionSelectionChangedCallback -> m (GClosure C_SelectionSelectionChangedCallback)
- mk_SelectionSelectionChangedCallback :: C_SelectionSelectionChangedCallback -> IO (FunPtr C_SelectionSelectionChangedCallback)
- noSelectionSelectionChangedCallback :: Maybe SelectionSelectionChangedCallback
- onSelectionSelectionChanged :: (IsSelection a, MonadIO m) => a -> SelectionSelectionChangedCallback -> m SignalHandlerId
- wrap_SelectionSelectionChangedCallback :: SelectionSelectionChangedCallback -> C_SelectionSelectionChangedCallback

# Exported types

newtype Selection Source #

Memory-managed wrapper type.

Constructors

Selection (ManagedPtr Selection) |

#### Instances

Instances details

Eq Selection Source # |
Instance details Defined in GI.Atk.Interfaces.Selection Methods (==) :: Selection -> Selection -> Bool # (/=) :: Selection -> Selection -> Bool #
GObject Selection Source # |
Instance details Defined in GI.Atk.Interfaces.Selection
TypedObject Selection Source # |
Instance details Defined in GI.Atk.Interfaces.Selection Methods glibType :: IO GType Source #
ManagedPtrNewtype Selection Source # |
Instance details Defined in GI.Atk.Interfaces.Selection Methods toManagedPtr :: Selection -> ManagedPtr Selection Source #
IsGValue Selection Source # | Convert `Selection` to and from `GValue` with `toGValue` and `fromGValue`.
Instance details Defined in GI.Atk.Interfaces.Selection Methods toGValue :: Selection -> IO GValue Source # fromGValue :: GValue -> IO Selection Source #
HasParentTypes Selection Source # |
Instance details Defined in GI.Atk.Interfaces.Selection
type ParentTypes Selection Source # |
Instance details Defined in GI.Atk.Interfaces.Selection type ParentTypes Selection = '[Object]

class (GObject o, IsDescendantOf Selection o) => IsSelection o Source #

Type class for types which can be safely cast to `Selection`, for instance with `toSelection`.

#### Instances

Instances details

(GObject o, IsDescendantOf Selection o) => IsSelection o Source # |
Instance details Defined in GI.Atk.Interfaces.Selection

toSelection :: (MonadIO m, IsSelection o) => o -> m Selection Source #

Cast to `Selection`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

## Overloaded methods

## addSelection

selectionAddSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsSelection a) |
=> a | `selection`: a `Object` instance that implements AtkSelectionIface
-> Int32 | `i`: a `gint` specifying the child index.
-> m Bool | Returns: TRUE if success, FALSE otherwise.

Adds the specified accessible child of the object to the object's selection.

## clearSelection

selectionClearSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsSelection a) |
=> a | `selection`: a `Object` instance that implements AtkSelectionIface
-> m Bool | Returns: TRUE if success, FALSE otherwise.

Clears the selection in the object so that no children in the object are selected.

## getSelectionCount

selectionGetSelectionCount Source #

Arguments

:: (HasCallStack, MonadIO m, IsSelection a) |
=> a | `selection`: a `Object` instance that implements AtkSelectionIface
-> m Int32 | Returns: a gint representing the number of items selected, or 0 if `selection` does not implement this interface.

Gets the number of accessible children currently selected. Note: callers should not rely on `Nothing` or on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or the `atk_get_accessible_value()` convenience method.

## isChildSelected

selectionIsChildSelected Source #

Arguments

:: (HasCallStack, MonadIO m, IsSelection a) |
=> a | `selection`: a `Object` instance that implements AtkSelectionIface
-> Int32 | `i`: a `gint` specifying the child index.
-> m Bool | Returns: a gboolean representing the specified child is selected, or 0 if `selection` does not implement this interface.

Determines if the current child of this object is selected Note: callers should not rely on `Nothing` or on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or the `atk_get_accessible_value()` convenience method.

## refSelection

selectionRefSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsSelection a) |
=> a | `selection`: a `Object` instance that implements AtkSelectionIface
-> Int32 | `i`: a `gint` specifying the index in the selection set. (e.g. the ith selection as opposed to the ith child).
-> m (Maybe Object) | Returns: an `Object` representing the selected accessible, or `Nothing` if `selection` does not implement this interface.

Gets a reference to the accessible object representing the specified selected child of the object. Note: callers should not rely on `Nothing` or on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or the `atk_get_accessible_value()` convenience method.

## removeSelection

selectionRemoveSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsSelection a) |
=> a | `selection`: a `Object` instance that implements AtkSelectionIface
-> Int32 | `i`: a `gint` specifying the index in the selection set. (e.g. the ith selection as opposed to the ith child).
-> m Bool | Returns: TRUE if success, FALSE otherwise.

Removes the specified child of the object from the object's selection.

## selectAllSelection

selectionSelectAllSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsSelection a) |
=> a | `selection`: a `Object` instance that implements AtkSelectionIface
-> m Bool | Returns: TRUE if success, FALSE otherwise.

Causes every child of the object to be selected if the object supports multiple selections.

# Signals

## selectionChanged

type C_SelectionSelectionChangedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SelectionSelectionChangedCallback = IO () Source #

The "selection-changed" signal is emitted by an object which implements AtkSelection interface when the selection changes.

afterSelectionSelectionChanged :: (IsSelection a, MonadIO m) => a -> SelectionSelectionChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the selectionChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after selection #selectionChanged callback

genClosure_SelectionSelectionChanged :: MonadIO m => SelectionSelectionChangedCallback -> m (GClosure C_SelectionSelectionChangedCallback) Source #

Wrap the callback into a `GClosure`.

mk_SelectionSelectionChangedCallback :: C_SelectionSelectionChangedCallback -> IO (FunPtr C_SelectionSelectionChangedCallback) Source #

Generate a function pointer callable from C code, from a `C_SelectionSelectionChangedCallback`.

noSelectionSelectionChangedCallback :: Maybe SelectionSelectionChangedCallback Source #

A convenience synonym for ``Nothing` :: `Maybe` `SelectionSelectionChangedCallback``.

onSelectionSelectionChanged :: (IsSelection a, MonadIO m) => a -> SelectionSelectionChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the selectionChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on selection #selectionChanged callback

wrap_SelectionSelectionChangedCallback :: SelectionSelectionChangedCallback -> C_SelectionSelectionChangedCallback Source #

Wrap a `SelectionSelectionChangedCallback` into a `C_SelectionSelectionChangedCallback`.