gi-gtk-3.0.43: Gtk 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.Structs.SelectionData

Contents

- Exported types
- Methods
  - copy
  - free
  - getData
  - getDataType
  - getDisplay
  - getFormat
  - getLength
  - getPixbuf
  - getSelection
  - getTarget
  - getTargets
  - getText
  - getUris
  - set
  - setPixbuf
  - setText
  - setUris
  - targetsIncludeImage
  - targetsIncludeRichText
  - targetsIncludeText
  - targetsIncludeUri

Description

No description available in the introspection data.

Synopsis

- newtype SelectionData = SelectionData (ManagedPtr SelectionData)
- selectionDataCopy :: (HasCallStack, MonadIO m) => SelectionData -> m SelectionData
- selectionDataFree :: (HasCallStack, MonadIO m) => SelectionData -> m ()
- selectionDataGetData :: (HasCallStack, MonadIO m) => SelectionData -> m ByteString
- selectionDataGetDataType :: (HasCallStack, MonadIO m) => SelectionData -> m Atom
- selectionDataGetDisplay :: (HasCallStack, MonadIO m) => SelectionData -> m Display
- selectionDataGetFormat :: (HasCallStack, MonadIO m) => SelectionData -> m Int32
- selectionDataGetLength :: (HasCallStack, MonadIO m) => SelectionData -> m Int32
- selectionDataGetPixbuf :: (HasCallStack, MonadIO m) => SelectionData -> m (Maybe Pixbuf)
- selectionDataGetSelection :: (HasCallStack, MonadIO m) => SelectionData -> m Atom
- selectionDataGetTarget :: (HasCallStack, MonadIO m) => SelectionData -> m Atom
- selectionDataGetTargets :: (HasCallStack, MonadIO m) => SelectionData -> m (Bool, [Atom])
- selectionDataGetText :: (HasCallStack, MonadIO m) => SelectionData -> m (Maybe Text)
- selectionDataGetUris :: (HasCallStack, MonadIO m) => SelectionData -> m [Text]
- selectionDataSet :: (HasCallStack, MonadIO m) => SelectionData -> Atom -> Int32 -> ByteString -> m ()
- selectionDataSetPixbuf :: (HasCallStack, MonadIO m, IsPixbuf a) => SelectionData -> a -> m Bool
- selectionDataSetText :: (HasCallStack, MonadIO m) => SelectionData -> Text -> Int32 -> m Bool
- selectionDataSetUris :: (HasCallStack, MonadIO m) => SelectionData -> [Text] -> m Bool
- selectionDataTargetsIncludeImage :: (HasCallStack, MonadIO m) => SelectionData -> Bool -> m Bool
- selectionDataTargetsIncludeRichText :: (HasCallStack, MonadIO m, IsTextBuffer a) => SelectionData -> a -> m Bool
- selectionDataTargetsIncludeText :: (HasCallStack, MonadIO m) => SelectionData -> m Bool
- selectionDataTargetsIncludeUri :: (HasCallStack, MonadIO m) => SelectionData -> m Bool

# Exported types

newtype SelectionData Source #

Memory-managed wrapper type.

Constructors

SelectionData (ManagedPtr SelectionData) |

#### Instances

Instances details

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

# Methods

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

Expand

#### Methods

copy, free, set, targetsIncludeImage, targetsIncludeRichText, targetsIncludeText, targetsIncludeUri.

#### Getters

getDataType, getData, getDisplay, getFormat, getLength, getPixbuf, getSelection, getTarget, getTargets, getText, getUris.

#### Setters

setPixbuf, setText, setUris.

## copy

selectionDataCopy Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `data`: a pointer to a `SelectionData`-struct.
-> m SelectionData | Returns: a pointer to a copy of `data`.

Makes a copy of a `SelectionData`-struct and its data.

## free

selectionDataFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `data`: a pointer to a `SelectionData`-struct.
-> m () |

Frees a `SelectionData`-struct returned from `selectionDataCopy`.

## getData

selectionDataGetData Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a pointer to a `SelectionData`-struct.
-> m ByteString | Returns: the raw data of the selection

Retrieves the raw data of the selection along with its length.

Since: 3.0

## getDataType

selectionDataGetDataType Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a pointer to a `SelectionData`-struct.
-> m Atom | Returns: the data type of the selection.

Retrieves the data type of the selection.

Since: 2.14

## getDisplay

selectionDataGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a pointer to a `SelectionData`-struct.
-> m Display | Returns: the display of the selection.

Retrieves the display of the selection.

Since: 2.14

## getFormat

selectionDataGetFormat Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a pointer to a `SelectionData`-struct.
-> m Int32 | Returns: the format of the selection.

Retrieves the format of the selection.

Since: 2.14

## getLength

selectionDataGetLength Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a pointer to a `SelectionData`-struct.
-> m Int32 | Returns: the length of the data of the selection.

Retrieves the length of the raw data of the selection.

Since: 2.14

## getPixbuf

selectionDataGetPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData`
-> m (Maybe Pixbuf) | Returns: if the selection data contained a recognized image type and it could be converted to a `Pixbuf`, a newly allocated pixbuf is returned, otherwise `Nothing`. If the result is non-`Nothing` it must be freed with `objectUnref`.

Gets the contents of the selection data as a `Pixbuf`.

Since: 2.6

## getSelection

selectionDataGetSelection Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a pointer to a `SelectionData`-struct.
-> m Atom | Returns: the selection `Atom` of the selection data.

Retrieves the selection `Atom` of the selection data.

Since: 2.16

## getTarget

selectionDataGetTarget Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a pointer to a `SelectionData`-struct.
-> m Atom | Returns: the target of the selection.

Retrieves the target of the selection.

Since: 2.14

## getTargets

selectionDataGetTargets Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData` object
-> m (Bool, [Atom]) | Returns: `True` if `selectionData` contains a valid array of targets, otherwise `False`.

Gets the contents of `selectionData` as an array of targets. This can be used to interpret the results of getting the standard TARGETS target that is always supplied for any selection.

## getText

selectionDataGetText Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData`
-> m (Maybe Text) | Returns: if the selection data contained a recognized text type and it could be converted to UTF-8, a newly allocated string containing the converted text, otherwise `Nothing`. If the result is non-`Nothing` it must be freed with `free`.

Gets the contents of the selection data as a UTF-8 string.

## getUris

selectionDataGetUris Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData`
-> m [Text] | Returns: if the selection data contains a list of URIs, a newly allocated `Nothing`-terminated string array containing the URIs, otherwise `Nothing`. If the result is non-`Nothing` it must be freed with `strfreev`.

Gets the contents of the selection data as array of URIs.

Since 3.24.37, this may involve using the FileTransfer portal to send files between sandboxed apps.

Since: 2.6

## set

selectionDataSet Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a pointer to a `SelectionData`-struct.
-> Atom | `type`: the type of selection data
-> Int32 | `format`: format (number of bits in a unit)
-> ByteString | `data`: pointer to the data (will be copied)
-> m () |

Stores new data into a `SelectionData` object. Should only be called from a selection handler callback. Zero-terminates the stored data.

## setPixbuf

selectionDataSetPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsPixbuf a) |
=> SelectionData | `selectionData`: a `SelectionData`
-> a | `pixbuf`: a `Pixbuf`
-> m Bool | Returns: `True` if the selection was successfully set, otherwise `False`.

Sets the contents of the selection from a `Pixbuf` The pixbuf is converted to the form determined by `selectionData`->target.

Since: 2.6

## setText

selectionDataSetText Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData`
-> Text | `str`: a UTF-8 string
-> Int32 | `len`: the length of `str`, or -1 if `str` is nul-terminated.
-> m Bool | Returns: `True` if the selection was successfully set, otherwise `False`.

Sets the contents of the selection from a UTF-8 encoded string. The string is converted to the form determined by `selectionData`->target.

## setUris

selectionDataSetUris Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData`
-> [Text] | `uris`: a `Nothing`-terminated array of strings holding URIs
-> m Bool | Returns: `True` if the selection was successfully set, otherwise `False`.

Sets the contents of the selection from a list of URIs. The string is converted to the form determined by `selectionData`->target.

Since 3.24.37, this may involve using the FileTransfer portal to send files between sandboxed apps.

Since: 2.6

## targetsIncludeImage

selectionDataTargetsIncludeImage Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData` object
-> Bool | `writable`: whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format
-> m Bool | Returns: `True` if `selectionData` holds a list of targets, and a suitable target for images is included, otherwise `False`.

Given a `SelectionData` object holding a list of targets, determines if any of the targets in `targets` can be used to provide a `Pixbuf`.

Since: 2.6

## targetsIncludeRichText

selectionDataTargetsIncludeRichText Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) |
=> SelectionData | `selectionData`: a `SelectionData` object
-> a | `buffer`: a `TextBuffer`
-> m Bool | Returns: `True` if `selectionData` holds a list of targets, and a suitable target for rich text is included, otherwise `False`.

Given a `SelectionData` object holding a list of targets, determines if any of the targets in `targets` can be used to provide rich text.

Since: 2.10

## targetsIncludeText

selectionDataTargetsIncludeText Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData` object
-> m Bool | Returns: `True` if `selectionData` holds a list of targets, and a suitable target for text is included, otherwise `False`.

Given a `SelectionData` object holding a list of targets, determines if any of the targets in `targets` can be used to provide text.

## targetsIncludeUri

selectionDataTargetsIncludeUri Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SelectionData | `selectionData`: a `SelectionData` object
-> m Bool | Returns: `True` if `selectionData` holds a list of targets, and a suitable target for URI lists is included, otherwise `False`.

Given a `SelectionData` object holding a list of targets, determines if any of the targets in `targets` can be used to provide a list or URIs.

Since: 2.10