Class ContentSerializer

All Implemented Interfaces:
PointerInterface

public class ContentSerializer extends Object
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 [func@Gdk.content_register_serializer].

Also see [class@Gdk.ContentDeserializer].

https://docs.gtk.org/gdk4/class.ContentSerializer.html

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getCancellable

      public Cancellable getCancellable()
      Gets the cancellable for the current operation.

      This is the `GCancellable` that was passed to [func@content_serialize_async].
      Returns:
      the cancellable for the current operation
    • getGtype

      public long getGtype()
      Gets the `GType` to of the object to serialize.
      Returns:
      the `GType` for the current operation
    • getMimeType

      public Str getMimeType()
      Gets the mime type to serialize to.
      Returns:
      the mime type for the current operation
    • getOutputStream

      public OutputStream getOutputStream()
      Gets the output stream for the current operation.

      This is the stream that was passed to [func@content_serialize_async].
      Returns:
      the output stream for the current operation
    • getPriority

      public int getPriority()
      Gets the I/O priority for the current operation.

      This is the priority that was passed to [func@content_serialize_async].
      Returns:
      the I/O priority for the current operation
    • getTaskData

      public Pointer getTaskData()
      Gets the data that was associated with the current operation.

      See [method@Gdk.ContentSerializer.set_task_data].
      Returns:
      the task data for @serializer
    • getUserData

      public Pointer getUserData()
      Gets the user data that was passed when the serializer was registered.
      Returns:
      the user data for this serializer
    • getValue

      public Value getValue()
      Gets the `GValue` to read the object to serialize from.
      Returns:
      the `GValue` for the current operation
    • returnError

      public void returnError(@Nonnull Error error)
      Indicate that the serialization has ended with an error.

      This function consumes @error.
      Parameters:
      error - a `GError`
    • returnSuccess

      public void returnSuccess()
      Indicate that the serialization has been successfully completed.
    • setTaskData

      public void setTaskData(@Nullable Pointer data, ContentSerializer.OnDestroyNotify notify)
      Associate data with the current serialization operation.
      Parameters:
      data - data to associate with this operation
      notify - destroy notify for @data
    • asAsyncResult

      public AsyncResult asAsyncResult()
      Implements interface AsyncResult. Call this to get access to interface functions.
      Returns:
      AsyncResult
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()