Skip to content

Gdk.ContentDeserializer

class — extends GObject.Object, Gio.AsyncResult

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 content_register_deserializer.

Also see ContentSerializer.

Methods

get_cancellable

def get_cancellable(self) -> Gio.Cancellable | None

Gets the cancellable for the current operation.

This is the GCancellable that was passed to content_deserialize_async.

get_gtype

def get_gtype(self) -> type | GObject.Type

Gets the GType to create an instance of.

get_input_stream

def get_input_stream(self) -> Gio.InputStream

Gets the input stream for the current operation.

This is the stream that was passed to content_deserialize_async.

get_mime_type

def get_mime_type(self) -> str

Gets the mime type to deserialize from.

get_priority

def get_priority(self) -> int

Gets the I/O priority for the current operation.

This is the priority that was passed to content_deserialize_async.

get_task_data

def get_task_data(self) -> int | None

Gets the data that was associated with the current operation.

See ContentDeserializer.set_task_data.

get_user_data

def get_user_data(self) -> int | None

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

get_value

def get_value(self) -> GObject.Value

Gets the GValue to store the deserialized object in.

return_error

def return_error(self, error: GLib.Error) -> None

Indicate that the deserialization has ended with an error.

This function consumes error.

Parameters:

  • error — a GError

return_success

def return_success(self) -> None

Indicate that the deserialization has been successfully completed.

set_task_data

def set_task_data(self, data: int | None, notify: GLib.DestroyNotify) -> None

Associate data with the current deserialization operation.

Parameters:

  • data — data to associate with this operation
  • notify — destroy notify for data