ContentSerializerProtocol

public protocol ContentSerializerProtocol : AsyncResultProtocol, ObjectProtocol

The ContentSerializerProtocol protocol exposes the methods and properties of an underlying GdkContentSerializer instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see ContentSerializer. Alternatively, use ContentSerializerRef as a lighweight, unowned reference if you already have an instance you just want to use.

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 [funccontent_register_serializer].

Also see [classGdk.ContentDeserializer].

  • ptr

    Untyped pointer to the underlying GdkContentSerializer instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • content_serializer_ptr Default implementation

    Typed pointer to the underlying GdkContentSerializer instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GdkContentSerializer instance.

    Declaration

    Swift

    var content_serializer_ptr: UnsafeMutablePointer<GdkContentSerializer>! { get }
  • Required Initialiser for types conforming to ContentSerializerProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

ContentSerializer Class: ContentSerializerProtocol extension (methods and fields)

  • getCancellable() Extension method

    Gets the cancellable for the current operation.

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

    Declaration

    Swift

    @inlinable
    func getCancellable() -> GIO.CancellableRef!
  • getGtype() Extension method

    Gets the GType to of the object to serialize.

    Declaration

    Swift

    @inlinable
    func getGtype() -> GType
  • getMimeType() Extension method

    Gets the mime type to serialize to.

    Declaration

    Swift

    @inlinable
    func getMimeType() -> String!
  • getOutputStream() Extension method

    Gets the output stream for the current operation.

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

    Declaration

    Swift

    @inlinable
    func getOutputStream() -> GIO.OutputStreamRef!
  • getPriority() Extension method

    Gets the I/O priority for the current operation.

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

    Declaration

    Swift

    @inlinable
    func getPriority() -> Int
  • getTaskData() Extension method

    Gets the data that was associated with the current operation.

    See [methodGdk.ContentSerializer.set_task_data].

    Declaration

    Swift

    @inlinable
    func getTaskData() -> gpointer!
  • getUserData() Extension method

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

    Declaration

    Swift

    @inlinable
    func getUserData() -> gpointer!
  • getValue() Extension method

    Gets the GValue to read the object to serialize from.

    Declaration

    Swift

    @inlinable
    func getValue() -> GLibObject.ValueRef!
  • return_(error:) Extension method

    Indicate that the serialization has ended with an error.

    This function consumes error.

    Declaration

    Swift

    @inlinable
    func return_<GLibErrorT>(error: GLibErrorT) where GLibErrorT : ErrorProtocol
  • returnSuccess() Extension method

    Indicate that the serialization has been successfully completed.

    Declaration

    Swift

    @inlinable
    func returnSuccess()
  • setTask(data:notify:) Extension method

    Associate data with the current serialization operation.

    Declaration

    Swift

    @inlinable
    func setTask(data: gpointer! = nil, notify: GDestroyNotify?)
  • cancellable Extension method

    Gets the cancellable for the current operation.

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

    Declaration

    Swift

    @inlinable
    var cancellable: GIO.CancellableRef! { get }
  • gtype Extension method

    Gets the GType to of the object to serialize.

    Declaration

    Swift

    @inlinable
    var gtype: GType { get }
  • mimeType Extension method

    Gets the mime type to serialize to.

    Declaration

    Swift

    @inlinable
    var mimeType: String! { get }
  • outputStream Extension method

    Gets the output stream for the current operation.

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

    Declaration

    Swift

    @inlinable
    var outputStream: GIO.OutputStreamRef! { get }
  • priority Extension method

    Gets the I/O priority for the current operation.

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

    Declaration

    Swift

    @inlinable
    var priority: Int { get }
  • taskData Extension method

    Gets the data that was associated with the current operation.

    See [methodGdk.ContentSerializer.set_task_data].

    Declaration

    Swift

    @inlinable
    var taskData: gpointer! { get }
  • userData Extension method

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

    Declaration

    Swift

    @inlinable
    var userData: gpointer! { get }
  • value Extension method

    Gets the GValue to read the object to serialize from.

    Declaration

    Swift

    @inlinable
    var value: GLibObject.ValueRef! { get }