Class: Gdk::ContentSerializer

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

A GdkContentSerializer is used to serialize content for
inter-application data transfers.

The GdkContentSerializer transforms an object that is identified
by a GType into a serialized form (i.e. a byte stream) that is
identified by a mime type.

GTK provides serializers and deserializers for common data types
such as text, colors, images or file lists. To register your own
serialization functions, use [funcGdk.content_register_serializer].

Also see [classGdk.ContentDeserializer].

Instance Method Summary collapse

Instance Method Details

#cancellable ⇒ Gio::Cancellable

Gets the cancellable for the current operation.

This is the GCancellable that was passed to [funccontent_serialize_async].

Returns:

  • (Gio::Cancellable) —

    the cancellable for the current operation

#gtype ⇒ GLib::Type

Gets the GType to of the object to serialize.

Returns:

  • (GLib::Type) —

    the GType for the current operation

#mime_type ⇒ String

Gets the mime type to serialize to.

Returns:

  • (String) —

    the mime type for the current operation

#output_stream ⇒ Gio::OutputStream

Gets the output stream for the current operation.

This is the stream that was passed to [funccontent_serialize_async].

Returns:

  • (Gio::OutputStream) —

    the output stream for the current operation

#priority ⇒ Integer

Gets the I/O priority for the current operation.

This is the priority that was passed to [funccontent_serialize_async].

Returns:

  • (Integer) —

    the I/O priority for the current operation

#return_error(error) ⇒ nil

Indicate that the serialization has ended with an error.

This function consumes error.

Parameters:

  • error (GLib::Error) —

    a GError

Returns:

  • (nil)

#return_success ⇒ nil

Indicate that the serialization has been successfully completed.

Returns:

  • (nil)

#set_task_data(data, notify) ⇒ nil

Associate data with the current serialization operation.

Parameters:

  • data (GObject) —

    data to associate with this operation

  • notify (GLib::DestroyNotify) —

    destroy notify for data

Returns:

  • (nil)

#task_data ⇒ GObject

Gets the data that was associated with the current operation.

See [methodGdk.ContentSerializer.set_task_data].

Returns:

  • (GObject) —

    the task data for serializer

#user_data ⇒ GObject

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

Returns:

  • (GObject) —

    the user data for this serializer

#value ⇒ GObject::Value

Gets the GValue to read the object to serialize from.

Returns:

  • (GObject::Value) —

    the GValue for the current operation