gi-atk-2.0.27: Atk bindings

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

GI.Atk.Interfaces.EditableText

Contents

- Exported types
- Methods
  - copyText
  - cutText
  - deleteText
  - insertText
  - pasteText
  - setRunAttributes
  - setTextContents

Description

The ATK interface implemented by components containing user-editable text content.

`EditableText` should be implemented by UI components which contain text which the user can edit, via the `Object` corresponding to that component (see `Object`).

`EditableText` is a subclass of `Text`, and as such, an object which implements `EditableText` is by definition an `Text` implementor as well.

See [iface`atkText`]

Synopsis

- newtype EditableText = EditableText (ManagedPtr EditableText)
- class (ManagedPtrNewtype o, IsDescendantOf EditableText o) => IsEditableText o
- editableTextCopyText :: (HasCallStack, MonadIO m, IsEditableText a) => a -> Int32 -> Int32 -> m ()
- editableTextCutText :: (HasCallStack, MonadIO m, IsEditableText a) => a -> Int32 -> Int32 -> m ()
- editableTextDeleteText :: (HasCallStack, MonadIO m, IsEditableText a) => a -> Int32 -> Int32 -> m ()
- editableTextInsertText :: (HasCallStack, MonadIO m, IsEditableText a) => a -> Text -> Int32 -> Int32 -> m ()
- editableTextPasteText :: (HasCallStack, MonadIO m, IsEditableText a) => a -> Int32 -> m ()
- editableTextSetRunAttributes :: (HasCallStack, MonadIO m, IsEditableText a) => a -> [Ptr ()] -> Int32 -> Int32 -> m Bool
- editableTextSetTextContents :: (HasCallStack, MonadIO m, IsEditableText a) => a -> Text -> m ()

# Exported types

newtype EditableText Source #

Memory-managed wrapper type.

Constructors

EditableText (ManagedPtr EditableText) |

#### Instances

Instances details

Eq EditableText Source # |
Instance details Defined in GI.Atk.Interfaces.EditableText Methods (==) :: EditableText -> EditableText -> Bool Source # (/=) :: EditableText -> EditableText -> Bool Source #
BoxedPtr EditableText Source # |
Instance details Defined in GI.Atk.Interfaces.EditableText Methods boxedPtrCopy :: EditableText -> IO EditableText Source # boxedPtrFree :: EditableText -> IO () Source #
ManagedPtrNewtype EditableText Source # |
Instance details Defined in GI.Atk.Interfaces.EditableText Methods toManagedPtr :: EditableText -> ManagedPtr EditableText Source #

class (ManagedPtrNewtype o, IsDescendantOf EditableText o) => IsEditableText o Source #

Type class for types which implement `EditableText`.

#### Instances

Instances details

(ManagedPtrNewtype o, IsDescendantOf EditableText o) => IsEditableText o Source # |
Instance details Defined in GI.Atk.Interfaces.EditableText

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

copyText, cutText, deleteText, insertText, pasteText.

#### Getters

None.

#### Setters

setRunAttributes, setTextContents.

## copyText

editableTextCopyText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEditableText a) |
=> a | `text`: an `EditableText`
-> Int32 | `startPos`: start position
-> Int32 | `endPos`: end position
-> m () |

Copy text from `startPos` up to, but not including `endPos` to the clipboard.

## cutText

editableTextCutText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEditableText a) |
=> a | `text`: an `EditableText`
-> Int32 | `startPos`: start position
-> Int32 | `endPos`: end position
-> m () |

Copy text from `startPos` up to, but not including `endPos` to the clipboard and then delete from the widget.

## deleteText

editableTextDeleteText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEditableText a) |
=> a | `text`: an `EditableText`
-> Int32 | `startPos`: start position
-> Int32 | `endPos`: end position
-> m () |

Delete text `startPos` up to, but not including `endPos`.

## insertText

editableTextInsertText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEditableText a) |
=> a | `text`: an `EditableText`
-> Text | `string`: the text to insert
-> Int32 | `length`: the length of text to insert, in bytes
-> Int32 | `position`: The caller initializes this to the position at which to insert the text. After the call it points at the position after the newly inserted text.
-> m () |

Insert text at a given position.

## pasteText

editableTextPasteText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEditableText a) |
=> a | `text`: an `EditableText`
-> Int32 | `position`: position to paste
-> m () |

Paste text from clipboard to specified `position`.

## setRunAttributes

editableTextSetRunAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsEditableText a) |
=> a | `text`: an `EditableText`
-> [Ptr ()] | `attribSet`: an `AtkAttributeSet`
-> Int32 | `startOffset`: start of range in which to set attributes
-> Int32 | `endOffset`: end of range in which to set attributes
-> m Bool | Returns: `True` if attributes successfully set for the specified range, otherwise `False`

Sets the attributes for a specified range. See the ATK_ATTRIBUTE macros (such as `ATK_ATTRIBUTE_LEFT_MARGIN`) for examples of attributes that can be set. Note that other attributes that do not have corresponding ATK_ATTRIBUTE macros may also be set for certain text widgets.

## setTextContents

editableTextSetTextContents Source #

Arguments

:: (HasCallStack, MonadIO m, IsEditableText a) |
=> a | `text`: an `EditableText`
-> Text | `string`: string to set for text contents of `text`
-> m () |

Set text contents of `text`.