ContentFormatsBuilder

class ContentFormatsBuilder(**kwargs)

A GdkContentFormatsBuilder is an auxiliary struct used to create new GdkContentFormats, and should not be kept around.

Constructors

class ContentFormatsBuilder
classmethod new() ContentFormatsBuilder

Create a new GdkContentFormatsBuilder object.

The resulting builder would create an empty GdkContentFormats. Use addition functions to add types to it.

Methods

class ContentFormatsBuilder
add_formats(formats: ContentFormats) None

Appends all formats from formats to builder, skipping those that already exist.

Parameters:

formats – the formats to add

add_gtype(type: type) None

Appends type to builder if it has not already been added.

Parameters:

type – a GType

add_mime_type(mime_type: str) None

Appends mime_type to builder if it has not already been added.

Parameters:

mime_type – a mime type

to_formats() ContentFormats

Creates a new GdkContentFormats from the given builder.

The given GdkContentFormatsBuilder is reset once this function returns; you cannot call this function multiple times on the same builder instance.

This function is intended primarily for bindings. C code should use free_to_formats.