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

Contents

- Exported types
- Methods
  - Overloaded methods
  - addSelection
  - freeRanges
  - getBoundedRanges
  - getCaretOffset
  - getCharacterAtOffset
  - getCharacterCount
  - getCharacterExtents
  - getDefaultAttributes
  - getNSelections
  - getOffsetAtPoint
  - getRangeExtents
  - getRunAttributes
  - getSelection
  - getStringAtOffset
  - getText
  - getTextAfterOffset
  - getTextAtOffset
  - getTextBeforeOffset
  - removeSelection
  - scrollSubstringTo
  - scrollSubstringToPoint
  - setCaretOffset
  - setSelection
- Signals
  - textAttributesChanged
  - textCaretMoved
  - textChanged
  - textInsert
  - textRemove
  - textSelectionChanged

Description

`Text` should be implemented by `AtkObjects` on behalf of widgets that have text content which is either attributed or otherwise non-trivial. `AtkObjects` whose text content is simple, unattributed, and very brief may expose that content via `atk_object_get_name` instead; however if the text is editable, multi-line, typically longer than three or four words, attributed, selectable, or if the object already uses the 'name' ATK property for other information, the `Text` interface should be used to expose the text content. In the case of editable text content, `EditableText` (a subtype of the `Text` interface) should be implemented instead.

`Text` provides not only traversal facilities and change notification for text content, but also caret tracking and glyph bounding box calculations. Note that the text strings are exposed as UTF-8, and are therefore potentially multi-byte, and caret-to-byte offset mapping makes no assumptions about the character length; also bounding box glyph-to-offset mapping may be complex for languages which use ligatures.

Synopsis

- newtype Text = Text (ManagedPtr Text)
- class (GObject o, IsDescendantOf Text o) => IsText o
- toText :: (MonadIO m, IsText o) => o -> m Text
- textAddSelection :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> Int32 -> m Bool
- textFreeRanges :: (HasCallStack, MonadIO m) => [TextRange] -> m ()
- textGetBoundedRanges :: (HasCallStack, MonadIO m, IsText a) => a -> TextRectangle -> CoordType -> TextClipType -> TextClipType -> m [TextRange]
- textGetCaretOffset :: (HasCallStack, MonadIO m, IsText a) => a -> m Int32
- textGetCharacterAtOffset :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> m Char
- textGetCharacterCount :: (HasCallStack, MonadIO m, IsText a) => a -> m Int32
- textGetCharacterExtents :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> CoordType -> m (Int32, Int32, Int32, Int32)
- textGetDefaultAttributes :: (HasCallStack, MonadIO m, IsText a) => a -> m [Ptr ()]
- textGetNSelections :: (HasCallStack, MonadIO m, IsText a) => a -> m Int32
- textGetOffsetAtPoint :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> Int32 -> CoordType -> m Int32
- textGetRangeExtents :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> Int32 -> CoordType -> m TextRectangle
- textGetRunAttributes :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> m ([Ptr ()], Int32, Int32)
- textGetSelection :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> m (Text, Int32, Int32)
- textGetStringAtOffset :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> TextGranularity -> m (Maybe Text, Int32, Int32)
- textGetText :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> Int32 -> m Text
- textGetTextAfterOffset :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> TextBoundary -> m (Text, Int32, Int32)
- textGetTextAtOffset :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> TextBoundary -> m (Text, Int32, Int32)
- textGetTextBeforeOffset :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> TextBoundary -> m (Text, Int32, Int32)
- textRemoveSelection :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> m Bool
- textScrollSubstringTo :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> Int32 -> ScrollType -> m Bool
- textScrollSubstringToPoint :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> Int32 -> CoordType -> Int32 -> Int32 -> m Bool
- textSetCaretOffset :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> m Bool
- textSetSelection :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> Int32 -> Int32 -> m Bool
- type C_TextTextAttributesChangedCallback = Ptr () -> Ptr () -> IO ()
- type TextTextAttributesChangedCallback = IO ()
- afterTextTextAttributesChanged :: (IsText a, MonadIO m) => a -> TextTextAttributesChangedCallback -> m SignalHandlerId
- genClosure_TextTextAttributesChanged :: MonadIO m => TextTextAttributesChangedCallback -> m (GClosure C_TextTextAttributesChangedCallback)
- mk_TextTextAttributesChangedCallback :: C_TextTextAttributesChangedCallback -> IO (FunPtr C_TextTextAttributesChangedCallback)
- noTextTextAttributesChangedCallback :: Maybe TextTextAttributesChangedCallback
- onTextTextAttributesChanged :: (IsText a, MonadIO m) => a -> TextTextAttributesChangedCallback -> m SignalHandlerId
- wrap_TextTextAttributesChangedCallback :: TextTextAttributesChangedCallback -> C_TextTextAttributesChangedCallback
- type C_TextTextCaretMovedCallback = Ptr () -> Int32 -> Ptr () -> IO ()
- type TextTextCaretMovedCallback = Int32 -> IO ()
- afterTextTextCaretMoved :: (IsText a, MonadIO m) => a -> TextTextCaretMovedCallback -> m SignalHandlerId
- genClosure_TextTextCaretMoved :: MonadIO m => TextTextCaretMovedCallback -> m (GClosure C_TextTextCaretMovedCallback)
- mk_TextTextCaretMovedCallback :: C_TextTextCaretMovedCallback -> IO (FunPtr C_TextTextCaretMovedCallback)
- noTextTextCaretMovedCallback :: Maybe TextTextCaretMovedCallback
- onTextTextCaretMoved :: (IsText a, MonadIO m) => a -> TextTextCaretMovedCallback -> m SignalHandlerId
- wrap_TextTextCaretMovedCallback :: TextTextCaretMovedCallback -> C_TextTextCaretMovedCallback
- type C_TextTextChangedCallback = Ptr () -> Int32 -> Int32 -> Ptr () -> IO ()
- type TextTextChangedCallback = Int32 -> Int32 -> IO ()
- afterTextTextChanged :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextChangedCallback -> m SignalHandlerId
- genClosure_TextTextChanged :: MonadIO m => TextTextChangedCallback -> m (GClosure C_TextTextChangedCallback)
- mk_TextTextChangedCallback :: C_TextTextChangedCallback -> IO (FunPtr C_TextTextChangedCallback)
- noTextTextChangedCallback :: Maybe TextTextChangedCallback
- onTextTextChanged :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextChangedCallback -> m SignalHandlerId
- wrap_TextTextChangedCallback :: TextTextChangedCallback -> C_TextTextChangedCallback
- type C_TextTextInsertCallback = Ptr () -> Int32 -> Int32 -> CString -> Ptr () -> IO ()
- type TextTextInsertCallback = Int32 -> Int32 -> Text -> IO ()
- afterTextTextInsert :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextInsertCallback -> m SignalHandlerId
- genClosure_TextTextInsert :: MonadIO m => TextTextInsertCallback -> m (GClosure C_TextTextInsertCallback)
- mk_TextTextInsertCallback :: C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback)
- noTextTextInsertCallback :: Maybe TextTextInsertCallback
- onTextTextInsert :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextInsertCallback -> m SignalHandlerId
- wrap_TextTextInsertCallback :: TextTextInsertCallback -> C_TextTextInsertCallback
- type C_TextTextRemoveCallback = Ptr () -> Int32 -> Int32 -> CString -> Ptr () -> IO ()
- type TextTextRemoveCallback = Int32 -> Int32 -> Text -> IO ()
- afterTextTextRemove :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextRemoveCallback -> m SignalHandlerId
- genClosure_TextTextRemove :: MonadIO m => TextTextRemoveCallback -> m (GClosure C_TextTextRemoveCallback)
- mk_TextTextRemoveCallback :: C_TextTextRemoveCallback -> IO (FunPtr C_TextTextRemoveCallback)
- noTextTextRemoveCallback :: Maybe TextTextRemoveCallback
- onTextTextRemove :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextRemoveCallback -> m SignalHandlerId
- wrap_TextTextRemoveCallback :: TextTextRemoveCallback -> C_TextTextRemoveCallback
- type C_TextTextSelectionChangedCallback = Ptr () -> Ptr () -> IO ()
- type TextTextSelectionChangedCallback = IO ()
- afterTextTextSelectionChanged :: (IsText a, MonadIO m) => a -> TextTextSelectionChangedCallback -> m SignalHandlerId
- genClosure_TextTextSelectionChanged :: MonadIO m => TextTextSelectionChangedCallback -> m (GClosure C_TextTextSelectionChangedCallback)
- mk_TextTextSelectionChangedCallback :: C_TextTextSelectionChangedCallback -> IO (FunPtr C_TextTextSelectionChangedCallback)
- noTextTextSelectionChangedCallback :: Maybe TextTextSelectionChangedCallback
- onTextTextSelectionChanged :: (IsText a, MonadIO m) => a -> TextTextSelectionChangedCallback -> m SignalHandlerId
- wrap_TextTextSelectionChangedCallback :: TextTextSelectionChangedCallback -> C_TextTextSelectionChangedCallback

# Exported types

newtype Text Source #

Memory-managed wrapper type.

Constructors

Text (ManagedPtr Text) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf Text o) => IsText o Source #

Type class for types which can be safely cast to `Text`, for instance with `toText`.

#### Instances

Instances details

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

toText :: (MonadIO m, IsText o) => o -> m Text Source #

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

# Methods

## Overloaded methods

## addSelection

textAddSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `startOffset`: the starting character offset of the selected region
-> Int32 | `endOffset`: the offset of the first character after the selected region.
-> m Bool | Returns: `True` if successful, `False` otherwise

Adds a selection bounded by the specified offsets.

## freeRanges

textFreeRanges Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> [TextRange] | `ranges`: A pointer to an array of `TextRange` which is to be freed.
-> m () |

Frees the memory associated with an array of AtkTextRange. It is assumed that the array was returned by the function atk_text_get_bounded_ranges and is NULL terminated.

Since: 1.3

## getBoundedRanges

textGetBoundedRanges Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> TextRectangle | `rect`: An AtkTextRectangle giving the dimensions of the bounding box.
-> CoordType | `coordType`: Specify whether coordinates are relative to the screen or widget window.
-> TextClipType | `xClipType`: Specify the horizontal clip type.
-> TextClipType | `yClipType`: Specify the vertical clip type.
-> m [TextRange] | Returns: Array of AtkTextRange. The last element of the array returned by this function will be NULL.

Get the ranges of text in the specified bounding box.

Since: 1.3

## getCaretOffset

textGetCaretOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> m Int32 | Returns: the character offset of the position of the caret or -1 if the caret is not located inside the element or in the case of any other failure.

Gets the offset of the position of the caret (cursor).

## getCharacterAtOffset

textGetCharacterAtOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `offset`: a character offset within `text`
-> m Char | Returns: the character at `offset` or 0 in the case of failure.

Gets the specified text.

## getCharacterCount

textGetCharacterCount Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> m Int32 | Returns: the number of characters or -1 in case of failure.

Gets the character count.

## getCharacterExtents

textGetCharacterExtents Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `offset`: The offset of the text character for which bounding information is required.
-> CoordType | `coords`: specify whether coordinates are relative to the screen or widget window
-> m (Int32, Int32, Int32, Int32) |

If the extent can not be obtained (e.g. missing support), all of x, y, width, height are set to -1.

Get the bounding box containing the glyph representing the character at a particular text offset.

## getDefaultAttributes

textGetDefaultAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> m [Ptr ()] | Returns: an `AtkAttributeSet` which contains the default text attributes for this `Text`. This `AtkAttributeSet` should be freed by a call to `attributeSetFree`.

Creates an `AtkAttributeSet` which consists of the default values of attributes for the text. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.

## getNSelections

textGetNSelections Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> m Int32 | Returns: The number of selected regions, or -1 in the case of failure.

Gets the number of selected regions.

## getOffsetAtPoint

textGetOffsetAtPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `x`: screen x-position of character
-> Int32 | `y`: screen y-position of character
-> CoordType | `coords`: specify whether coordinates are relative to the screen or widget window
-> m Int32 | Returns: the offset to the character which is located at the specified `x` and `y` coordinates of -1 in case of failure.

Gets the offset of the character located at coordinates `x` and `y`. `x` and `y` are interpreted as being relative to the screen or this widget's window depending on `coords`.

## getRangeExtents

textGetRangeExtents Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `startOffset`: The offset of the first text character for which boundary information is required.
-> Int32 | `endOffset`: The offset of the text character after the last character for which boundary information is required.
-> CoordType | `coordType`: Specify whether coordinates are relative to the screen or widget window.
-> m TextRectangle |

Get the bounding box for text within the specified range.

If the extents can not be obtained (e.g. or missing support), the rectangle fields are set to -1.

Since: 1.3

## getRunAttributes

textGetRunAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `offset`: the character offset at which to get the attributes, -1 means the offset of the character to be inserted at the caret location.
-> m ([Ptr ()], Int32, Int32) | Returns: an `AtkAttributeSet` which contains the attributes explicitly set at `offset`. This `AtkAttributeSet` should be freed by a call to `attributeSetFree`.

Creates an `AtkAttributeSet` which consists of the attributes explicitly set at the position `offset` in the text. `startOffset` and `endOffset` are set to the start and end of the range around `offset` where the attributes are invariant. Note that `endOffset` is the offset of the first character after the range. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.

## getSelection

textGetSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `selectionNum`: The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.
-> m (Text, Int32, Int32) | Returns: a newly allocated string containing the selected text. Use `free` to free the returned string.

Gets the text from the specified selection.

## getStringAtOffset

textGetStringAtOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `offset`: position
-> TextGranularity | `granularity`: An `TextGranularity`
-> m (Maybe Text, Int32, Int32) | Returns: a newly allocated string containing the text at the `offset` bounded by the specified `granularity`. Use `free` to free the returned string. Returns `Nothing` if the offset is invalid or no implementation is available.

Gets a portion of the text exposed through an `Text` according to a given `offset` and a specific `granularity`, along with the start and end offsets defining the boundaries of such a portion of text.

If `granularity` is ATK_TEXT_GRANULARITY_CHAR the character at the offset is returned.

If `granularity` is ATK_TEXT_GRANULARITY_WORD the returned string is from the word start at or before the offset to the word start after the offset.

The returned string will contain the word at the offset if the offset is inside a word and will contain the word before the offset if the offset is not inside a word.

If `granularity` is ATK_TEXT_GRANULARITY_SENTENCE the returned string is from the sentence start at or before the offset to the sentence start after the offset.

The returned string will contain the sentence at the offset if the offset is inside a sentence and will contain the sentence before the offset if the offset is not inside a sentence.

If `granularity` is ATK_TEXT_GRANULARITY_LINE the returned string is from the line start at or before the offset to the line start after the offset.

If `granularity` is ATK_TEXT_GRANULARITY_PARAGRAPH the returned string is from the start of the paragraph at or before the offset to the start of the following paragraph after the offset.

Since: 2.10

## getText

textGetText Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `startOffset`: a starting character offset within `text`
-> Int32 | `endOffset`: an ending character offset within `text`, or -1 for the end of the string.
-> m Text | Returns: a newly allocated string containing the text from `startOffset` up to, but not including `endOffset`. Use `free` to free the returned string.

Gets the specified text.

## getTextAfterOffset

textGetTextAfterOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `offset`: position
-> TextBoundary | `boundaryType`: An `TextBoundary`
-> m (Text, Int32, Int32) | Returns: a newly allocated string containing the text after `offset` bounded by the specified `boundaryType`. Use `free` to free the returned string.

Deprecated: (Since version 2.9.3)Please use `textGetStringAtOffset` instead.

Gets the specified text.

## getTextAtOffset

textGetTextAtOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `offset`: position
-> TextBoundary | `boundaryType`: An `TextBoundary`
-> m (Text, Int32, Int32) | Returns: a newly allocated string containing the text at `offset` bounded by the specified `boundaryType`. Use `free` to free the returned string.

Deprecated: This method is deprecated since ATK version2.9.4. Please use `textGetStringAtOffset` instead.

Gets the specified text.

If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character at the offset is returned.

If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start at or before the offset to the word start after the offset.

The returned string will contain the word at the offset if the offset is inside a word and will contain the word before the offset if the offset is not inside a word.

If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start at or before the offset to the sentence start after the offset.

The returned string will contain the sentence at the offset if the offset is inside a sentence and will contain the sentence before the offset if the offset is not inside a sentence.

If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start at or before the offset to the line start after the offset.

## getTextBeforeOffset

textGetTextBeforeOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `offset`: position
-> TextBoundary | `boundaryType`: An `TextBoundary`
-> m (Text, Int32, Int32) | Returns: a newly allocated string containing the text before `offset` bounded by the specified `boundaryType`. Use `free` to free the returned string.

Deprecated: (Since version 2.9.3)Please use `textGetStringAtOffset` instead.

Gets the specified text.

## removeSelection

textRemoveSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `selectionNum`: The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.
-> m Bool | Returns: `True` if successful, `False` otherwise

Removes the specified selection.

## scrollSubstringTo

textScrollSubstringTo Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `startOffset`: start offset in the `text`
-> Int32 | `endOffset`: end offset in the `text`, or -1 for the end of the text.
-> ScrollType | `type`: specify where the object should be made visible.
-> m Bool | Returns: whether scrolling was successful.

Makes a substring of `text` visible on the screen by scrolling all necessary parents.

Since: 2.32

## scrollSubstringToPoint

textScrollSubstringToPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `startOffset`: start offset in the `text`
-> Int32 | `endOffset`: end offset in the `text`, or -1 for the end of the text.
-> CoordType | `coords`: specify whether coordinates are relative to the screen or to the parent object.
-> Int32 | `x`: x-position where to scroll to
-> Int32 | `y`: y-position where to scroll to
-> m Bool | Returns: whether scrolling was successful.

Move the top-left of a substring of `text` to a given position of the screen by scrolling all necessary parents.

Since: 2.32

## setCaretOffset

textSetCaretOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `offset`: the character offset of the new caret position
-> m Bool | Returns: `True` if successful, `False` otherwise.

Sets the caret (cursor) position to the specified `offset`.

In the case of rich-text content, this method should either grab focus or move the sequential focus navigation starting point (if the application supports this concept) as if the user had clicked on the new caret position. Typically, this means that the target of this operation is the node containing the new caret position or one of its ancestors. In other words, after this method is called, if the user advances focus, it should move to the first focusable node following the new caret position.

Calling this method should also scroll the application viewport in a way that matches the behavior of the application's typical caret motion or tab navigation as closely as possible. This also means that if the application's caret motion or focus navigation does not trigger a scroll operation, this method should not trigger one either. If the application does not have a caret motion or focus navigation operation, this method should try to scroll the new caret position into view while minimizing unnecessary scroll motion.

## setSelection

textSetSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `text`: an `Text`
-> Int32 | `selectionNum`: The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.
-> Int32 | `startOffset`: the new starting character offset of the selection
-> Int32 | `endOffset`: the new end position of (e.g. offset immediately past) the selection
-> m Bool | Returns: `True` if successful, `False` otherwise

Changes the start and end offset of the specified selection.

# Signals

## textAttributesChanged

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

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

type TextTextAttributesChangedCallback = IO () Source #

The "text-attributes-changed" signal is emitted when the text attributes of the text of an object which implements AtkText changes.

afterTextTextAttributesChanged :: (IsText a, MonadIO m) => a -> TextTextAttributesChangedCallback -> m SignalHandlerId Source #

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

    after text #textAttributesChanged callback

genClosure_TextTextAttributesChanged :: MonadIO m => TextTextAttributesChangedCallback -> m (GClosure C_TextTextAttributesChangedCallback) Source #

Wrap the callback into a `GClosure`.

mk_TextTextAttributesChangedCallback :: C_TextTextAttributesChangedCallback -> IO (FunPtr C_TextTextAttributesChangedCallback) Source #

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

noTextTextAttributesChangedCallback :: Maybe TextTextAttributesChangedCallback Source #

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

onTextTextAttributesChanged :: (IsText a, MonadIO m) => a -> TextTextAttributesChangedCallback -> m SignalHandlerId Source #

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

    on text #textAttributesChanged callback

wrap_TextTextAttributesChangedCallback :: TextTextAttributesChangedCallback -> C_TextTextAttributesChangedCallback Source #

Wrap a `TextTextAttributesChangedCallback` into a `C_TextTextAttributesChangedCallback`.

## textCaretMoved

type C_TextTextCaretMovedCallback = Ptr () -> Int32 -> Ptr () -> IO () Source #

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

type TextTextCaretMovedCallback Source #

Arguments

= Int32 | `arg1`: The new position of the text caret.
-> IO () |

The "text-caret-moved" signal is emitted when the caret position of the text of an object which implements AtkText changes.

afterTextTextCaretMoved :: (IsText a, MonadIO m) => a -> TextTextCaretMovedCallback -> m SignalHandlerId Source #

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

    after text #textCaretMoved callback

genClosure_TextTextCaretMoved :: MonadIO m => TextTextCaretMovedCallback -> m (GClosure C_TextTextCaretMovedCallback) Source #

Wrap the callback into a `GClosure`.

mk_TextTextCaretMovedCallback :: C_TextTextCaretMovedCallback -> IO (FunPtr C_TextTextCaretMovedCallback) Source #

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

noTextTextCaretMovedCallback :: Maybe TextTextCaretMovedCallback Source #

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

onTextTextCaretMoved :: (IsText a, MonadIO m) => a -> TextTextCaretMovedCallback -> m SignalHandlerId Source #

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

    on text #textCaretMoved callback

wrap_TextTextCaretMovedCallback :: TextTextCaretMovedCallback -> C_TextTextCaretMovedCallback Source #

Wrap a `TextTextCaretMovedCallback` into a `C_TextTextCaretMovedCallback`.

## textChanged

type C_TextTextChangedCallback = Ptr () -> Int32 -> Int32 -> Ptr () -> IO () Source #

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

type TextTextChangedCallback Source #

Arguments

= Int32 | `arg1`: The position (character offset) of the insertion or deletion.
-> Int32 | `arg2`: The length (in characters) of text inserted or deleted.
-> IO () |

Deprecated: (Since version 2.9.4)Use `Object`::`text-insert` ort`Object`::`text-remove` instead.

The "text-changed" signal is emitted when the text of the object which implements the AtkText interface changes, This signal will have a detail which is either "insert" or "delete" which identifies whether the text change was an insertion or a deletion.

afterTextTextChanged :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextChangedCallback -> m SignalHandlerId Source #

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

    after text #textChanged callback

This signal admits a optional parameter `detail`. If it's not `Nothing`, we will connect to “`text-changed::detail`” instead.

genClosure_TextTextChanged :: MonadIO m => TextTextChangedCallback -> m (GClosure C_TextTextChangedCallback) Source #

Wrap the callback into a `GClosure`.

mk_TextTextChangedCallback :: C_TextTextChangedCallback -> IO (FunPtr C_TextTextChangedCallback) Source #

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

noTextTextChangedCallback :: Maybe TextTextChangedCallback Source #

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

onTextTextChanged :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextChangedCallback -> m SignalHandlerId Source #

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

    on text #textChanged callback

This signal admits a optional parameter `detail`. If it's not `Nothing`, we will connect to “`text-changed::detail`” instead.

wrap_TextTextChangedCallback :: TextTextChangedCallback -> C_TextTextChangedCallback Source #

Wrap a `TextTextChangedCallback` into a `C_TextTextChangedCallback`.

## textInsert

type C_TextTextInsertCallback = Ptr () -> Int32 -> Int32 -> CString -> Ptr () -> IO () Source #

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

type TextTextInsertCallback Source #

Arguments

= Int32 | `arg1`: The position (character offset) of the insertion.
-> Int32 | `arg2`: The length (in characters) of text inserted.
-> Text | `arg3`: The new text inserted
-> IO () |

The "text-insert" signal is emitted when a new text is inserted. If the signal was not triggered by the user (e.g. typing or pasting text), the "system" detail should be included.

afterTextTextInsert :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextInsertCallback -> m SignalHandlerId Source #

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

    after text #textInsert callback

This signal admits a optional parameter `detail`. If it's not `Nothing`, we will connect to “`text-insert::detail`” instead.

genClosure_TextTextInsert :: MonadIO m => TextTextInsertCallback -> m (GClosure C_TextTextInsertCallback) Source #

Wrap the callback into a `GClosure`.

mk_TextTextInsertCallback :: C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback) Source #

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

noTextTextInsertCallback :: Maybe TextTextInsertCallback Source #

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

onTextTextInsert :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextInsertCallback -> m SignalHandlerId Source #

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

    on text #textInsert callback

This signal admits a optional parameter `detail`. If it's not `Nothing`, we will connect to “`text-insert::detail`” instead.

wrap_TextTextInsertCallback :: TextTextInsertCallback -> C_TextTextInsertCallback Source #

Wrap a `TextTextInsertCallback` into a `C_TextTextInsertCallback`.

## textRemove

type C_TextTextRemoveCallback = Ptr () -> Int32 -> Int32 -> CString -> Ptr () -> IO () Source #

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

type TextTextRemoveCallback Source #

Arguments

= Int32 | `arg1`: The position (character offset) of the removal.
-> Int32 | `arg2`: The length (in characters) of text removed.
-> Text | `arg3`: The old text removed
-> IO () |

The "text-remove" signal is emitted when a new text is removed. If the signal was not triggered by the user (e.g. typing or pasting text), the "system" detail should be included.

afterTextTextRemove :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextRemoveCallback -> m SignalHandlerId Source #

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

    after text #textRemove callback

This signal admits a optional parameter `detail`. If it's not `Nothing`, we will connect to “`text-remove::detail`” instead.

genClosure_TextTextRemove :: MonadIO m => TextTextRemoveCallback -> m (GClosure C_TextTextRemoveCallback) Source #

Wrap the callback into a `GClosure`.

mk_TextTextRemoveCallback :: C_TextTextRemoveCallback -> IO (FunPtr C_TextTextRemoveCallback) Source #

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

noTextTextRemoveCallback :: Maybe TextTextRemoveCallback Source #

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

onTextTextRemove :: (IsText a, MonadIO m) => a -> Maybe Text -> TextTextRemoveCallback -> m SignalHandlerId Source #

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

    on text #textRemove callback

This signal admits a optional parameter `detail`. If it's not `Nothing`, we will connect to “`text-remove::detail`” instead.

wrap_TextTextRemoveCallback :: TextTextRemoveCallback -> C_TextTextRemoveCallback Source #

Wrap a `TextTextRemoveCallback` into a `C_TextTextRemoveCallback`.

## textSelectionChanged

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

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

type TextTextSelectionChangedCallback = IO () Source #

The "text-selection-changed" signal is emitted when the selected text of an object which implements AtkText changes.

afterTextTextSelectionChanged :: (IsText a, MonadIO m) => a -> TextTextSelectionChangedCallback -> m SignalHandlerId Source #

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

    after text #textSelectionChanged callback

genClosure_TextTextSelectionChanged :: MonadIO m => TextTextSelectionChangedCallback -> m (GClosure C_TextTextSelectionChangedCallback) Source #

Wrap the callback into a `GClosure`.

mk_TextTextSelectionChangedCallback :: C_TextTextSelectionChangedCallback -> IO (FunPtr C_TextTextSelectionChangedCallback) Source #

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

noTextTextSelectionChangedCallback :: Maybe TextTextSelectionChangedCallback Source #

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

onTextTextSelectionChanged :: (IsText a, MonadIO m) => a -> TextTextSelectionChangedCallback -> m SignalHandlerId Source #

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

    on text #textSelectionChanged callback

wrap_TextTextSelectionChangedCallback :: TextTextSelectionChangedCallback -> C_TextTextSelectionChangedCallback Source #

Wrap a `TextTextSelectionChangedCallback` into a `C_TextTextSelectionChangedCallback`.