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

#cancellableGio::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

#gtypeGLib::Type

Gets the GType to of the object to serialize.

Returns:

  • (GLib::Type)

    the GType for the current operation

#mime_typeString

Gets the mime type to serialize to.

Returns:

  • (String)

    the mime type for the current operation

#output_streamGio::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

#priorityInteger

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_successnil

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_dataGObject

Gets the data that was associated with the current operation.

See [methodGdk.ContentSerializer.set_task_data].

Returns:

  • (GObject)

    the task data for serializer

#user_dataGObject

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

Returns:

  • (GObject)

    the user data for this serializer

#valueGObject::Value

Gets the GValue to read the object to serialize from.

Returns:

  • (GObject::Value)

    the GValue for the current operation