ContentFormats

open class ContentFormats : ContentFormatsProtocol

The ContentFormats type acts as a reference-counted owner of an underlying GdkContentFormats instance. It provides the methods that can operate on this data type through ContentFormatsProtocol conformance. Use ContentFormats as a strong reference or owner of a GdkContentFormats instance.

The GdkContentFormats structure is used to advertise and negotiate the format of content.

You will encounter GdkContentFormats when interacting with objects controlling operations that pass data between different widgets, window or application, like [classGdk.Drag], [classGdk.Drop], [classGdk.Clipboard] or [classGdk.ContentProvider].

GDK supports content in 2 forms: GType and mime type. Using GTypes is meant only for in-process content transfers. Mime types are meant to be used for data passing both in-process and out-of-process. The details of how data is passed is described in the documentation of the actual implementations. To transform between the two forms, [classGdk.ContentSerializer] and [classGdk.ContentDeserializer] are used.

A GdkContentFormats describes a set of possible formats content can be exchanged in. It is assumed that this set is ordered. GTypes are more important than mime types. Order between different GTypes or mime types is the order they were added in, most important first. Functions that care about order, such as [methodGdk.ContentFormats.union], will describe in their documentation how they interpret that order, though in general the order of the first argument is considered the primary order of the result, followed by the order of further arguments.

For debugging purposes, the function [methodGdk.ContentFormats.to_string] exists. It will print a comma-separated list of formats from most important to least important.

GdkContentFormats is an immutable struct. After creation, you cannot change the types it represents. Instead, new GdkContentFormats have to be created. The [structGdk.ContentFormatsBuilder]` structure is meant to help in this endeavor.

  • ptr
    Untyped pointer to the underlying `GdkContentFormats` instance.
    

    For type-safe access, use the generated, typed pointer content_formats_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!
  • Designated initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the ContentFormats instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafeMutablePointer<GdkContentFormats>)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the ContentFormats instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafePointer<GdkContentFormats>)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a non-mutating gpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the ContentFormats instance.

    Declaration

    Swift

    @inlinable
    public init!(gpointer op: gpointer?)

    Parameters

    op

    gpointer to the underlying object

  • Optional initialiser from a non-mutating gconstpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the ContentFormats instance.

    Declaration

    Swift

    @inlinable
    public init!(gconstpointer op: gconstpointer?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the ContentFormats instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafePointer<GdkContentFormats>?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the ContentFormats instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafeMutablePointer<GdkContentFormats>?)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from the underlying C data type. Will retain GdkContentFormats. i.e., ownership is transferred to the ContentFormats instance.

    Declaration

    Swift

    @inlinable
    public init(retaining op: UnsafeMutablePointer<GdkContentFormats>)

    Parameters

    op

    pointer to the underlying object

  • Reference intialiser for a related type that implements ContentFormatsProtocol Will retain GdkContentFormats.

    Declaration

    Swift

    @inlinable
    public init<T>(_ other: T) where T : ContentFormatsProtocol

    Parameters

    other

    an instance of a related type that implements ContentFormatsProtocol

  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    public init<T>(cPointer p: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    public init(raw p: UnsafeRawPointer)

    Parameters

    p

    raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingRaw raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    public required init(raw p: UnsafeMutableRawPointer)

    Parameters

    p

    mutable raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingRaw raw: UnsafeMutableRawPointer)

    Parameters

    raw

    mutable raw pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    public init(opaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingOpaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Creates a new GdkContentFormats from an array of mime types.

    The mime types must be valid and different from each other or the behavior of the return value is undefined. If you cannot guarantee this, use GdkContentFormatsBuilder instead.

    Declaration

    Swift

    @inlinable
    public init(mimeTypes: UnsafeMutablePointer<UnsafePointer<CChar>?>! = nil, nMimeTypes: Int)
  • Creates a new GdkContentFormats for a given GType.

    Declaration

    Swift

    @inlinable
    public init(gtype type: GType)
  • Creates a new GdkContentFormats for a given GType.

    Declaration

    Swift

    @inlinable
    public static func newForG(gtype type: GType) -> ContentFormats!