gi-gdk4-4.0.10: Gdk 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.Gdk.Objects.ContentDeserializer

Contents

- Exported types
- Methods
  - getCancellable
  - getGtype
  - getInputStream
  - getMimeType
  - getPriority
  - getTaskData
  - getUserData
  - getValue
  - returnError
  - returnSuccess
  - setTaskData

Description

Deserializes content received via inter-application data transfers.

The `GdkContentDeserializer` transforms serialized content that is identified by a mime type into an object identified by a GType.

GTK provides serializers and deserializers for common data types such as text, colors, images or file lists. To register your own deserialization functions, use [func`contentRegisterDeserializer`].

Also see `ContentSerializer`.

Synopsis

- newtype ContentDeserializer = ContentDeserializer (ManagedPtr ContentDeserializer)
- class (GObject o, IsDescendantOf ContentDeserializer o) => IsContentDeserializer o
- toContentDeserializer :: (MonadIO m, IsContentDeserializer o) => o -> m ContentDeserializer
- contentDeserializerGetCancellable :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m (Maybe Cancellable)
- contentDeserializerGetGtype :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m GType
- contentDeserializerGetInputStream :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m InputStream
- contentDeserializerGetMimeType :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m Text
- contentDeserializerGetPriority :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m Int32
- contentDeserializerGetTaskData :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m (Ptr ())
- contentDeserializerGetUserData :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m (Ptr ())
- contentDeserializerGetValue :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m GValue
- contentDeserializerReturnError :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> GError -> m ()
- contentDeserializerReturnSuccess :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> m ()
- contentDeserializerSetTaskData :: (HasCallStack, MonadIO m, IsContentDeserializer a) => a -> Ptr () -> DestroyNotify -> m ()

# Exported types

newtype ContentDeserializer Source #

Memory-managed wrapper type.

Constructors

ContentDeserializer (ManagedPtr ContentDeserializer) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf ContentDeserializer o) => IsContentDeserializer o Source #

Type class for types which can be safely cast to `ContentDeserializer`, for instance with `toContentDeserializer`.

#### Instances

Instances details

(GObject o, IsDescendantOf ContentDeserializer o) => IsContentDeserializer o Source # |
Instance details Defined in GI.Gdk.Objects.ContentDeserializer

toContentDeserializer :: (MonadIO m, IsContentDeserializer o) => o -> m ContentDeserializer Source #

Cast to `ContentDeserializer`, 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, forceFloating, freezeNotify, getv, isFloating, isTagged, legacyPropagateError, notify, notifyByPspec, ref, refSink, returnError, returnSuccess, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getCancellable, getData, getGtype, getInputStream, getMimeType, getPriority, getProperty, getQdata, getSourceObject, getTaskData, getUserData, getValue.

#### Setters

setData, setDataFull, setProperty, setTaskData.

## getCancellable

contentDeserializerGetCancellable Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m (Maybe Cancellable) | Returns: the cancellable for the current operation

Gets the cancellable for the current operation.

This is the `GCancellable` that was passed to `contentDeserializeAsync`.

## getGtype

contentDeserializerGetGtype Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m GType | Returns: the `GType` for the current operation

Gets the `GType` to create an instance of.

## getInputStream

contentDeserializerGetInputStream Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m InputStream | Returns: the input stream for the current operation

Gets the input stream for the current operation.

This is the stream that was passed to `contentDeserializeAsync`.

## getMimeType

contentDeserializerGetMimeType Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m Text | Returns: the mime type for the current operation

Gets the mime type to deserialize from.

## getPriority

contentDeserializerGetPriority Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m Int32 | Returns: the I/O priority for the current operation

Gets the I/O priority for the current operation.

This is the priority that was passed to `contentDeserializeAsync`.

## getTaskData

contentDeserializerGetTaskData Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m (Ptr ()) | Returns: the task data for `deserializer`

Gets the data that was associated with the current operation.

See `contentDeserializerSetTaskData`.

## getUserData

contentDeserializerGetUserData Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m (Ptr ()) | Returns: the user data for this deserializer

Gets the user data that was passed when the deserializer was registered.

## getValue

contentDeserializerGetValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m GValue | Returns: the `GValue` for the current operation

Gets the `GValue` to store the deserialized object in.

## returnError

contentDeserializerReturnError Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> GError | `error`: a `GError`
-> m () |

Indicate that the deserialization has ended with an error.

This function consumes `error`.

## returnSuccess

contentDeserializerReturnSuccess Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> m () |

Indicate that the deserialization has been successfully completed.

## setTaskData

contentDeserializerSetTaskData Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentDeserializer a) |
=> a | `deserializer`: a `GdkContentDeserializer`
-> Ptr () | `data`: data to associate with this operation
-> DestroyNotify | `notify`: destroy notify for `data`
-> m () |

Associate data with the current deserialization operation.