:right-sidebar: True ContentFormatsBuilder =================================================================== .. currentmodule:: gi.repository.Gdk .. class:: ContentFormatsBuilder(**kwargs) :no-contents-entry: A ``GdkContentFormatsBuilder`` is an auxiliary struct used to create new ``GdkContentFormats``\, and should not be kept around. Constructors ------------ .. rst-class:: interim-class .. class:: ContentFormatsBuilder :no-index: .. classmethod:: new() -> ~gi.repository.Gdk.ContentFormatsBuilder Create a new ``GdkContentFormatsBuilder`` object. The resulting builder would create an empty ``GdkContentFormats``\. Use addition functions to add types to it. Methods ------- .. rst-class:: interim-class .. class:: ContentFormatsBuilder :no-index: .. method:: add_formats(formats: ~gi.repository.Gdk.ContentFormats) -> None Appends all formats from ``formats`` to ``builder``\, skipping those that already exist. :param formats: the formats to add .. method:: add_gtype(type: ~gobject.GType) -> None Appends ``type`` to ``builder`` if it has not already been added. :param type: a ``GType`` .. method:: add_mime_type(mime_type: str) -> None Appends ``mime_type`` to ``builder`` if it has not already been added. :param mime_type: a mime type .. method:: to_formats() -> ~gi.repository.Gdk.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 :obj:`~gi.repository.Gdk.ContentFormatsBuilder.free_to_formats`\.