<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GdkContentProvider">
<refmeta>
<refentrytitle role="top_of_page" id="GdkContentProvider.top_of_page">GdkContentProvider</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GdkContentProvider</refname>
<refpurpose>Provides content for data transfer between applications</refpurpose>
</refnamediv>

<refsect1 id="GdkContentProvider.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-content-provider-new-for-value">gdk_content_provider_new_for_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-content-provider-new-typed">gdk_content_provider_new_typed</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-content-provider-new-for-bytes">gdk_content_provider_new_for_bytes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-content-provider-new-union">gdk_content_provider_new_union</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentFormats"><returnvalue>GdkContentFormats</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-content-provider-ref-formats">gdk_content_provider_ref_formats</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentFormats"><returnvalue>GdkContentFormats</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-content-provider-ref-storable-formats">gdk_content_provider_ref_storable_formats</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-content-provider-content-changed">gdk_content_provider_content_changed</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-content-provider-write-mime-type-async">gdk_content_provider_write_mime_type_async</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-content-provider-write-mime-type-finish">gdk_content_provider_write_mime_type_finish</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-content-provider-get-value">gdk_content_provider_get_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkContentProvider.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GdkContentFormats"><type>GdkContentFormats</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkContentProvider--formats">formats</link></entry><entry role="property_flags">Read</entry></row>
<row><entry role="property_type"><link linkend="GdkContentFormats"><type>GdkContentFormats</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkContentProvider--storable-formats">storable-formats</link></entry><entry role="property_flags">Read</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkContentProvider.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkContentProvider-content-changed">content-changed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkContentProvider.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GdkContentProvider-struct">GdkContentProvider</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GdkContentProviderClass">GdkContentProviderClass</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkContentProvider.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GdkContentProvider
</screen>
</refsect1>

<refsect1 id="GdkContentProvider.includes"><title>Includes</title><synopsis>#include &lt;gdk/gdk.h&gt;
</synopsis></refsect1>

<refsect1 id="GdkContentProvider.description" role="desc">
<title role="desc.title">Description</title>
<para>A GdkContentProvider is used to provide content for the clipboard in
a number of formats.</para>
<para>To create a GdkContentProvider, use <link linkend="gdk-content-provider-new-for-value"><function>gdk_content_provider_new_for_value()</function></link> or
<link linkend="gdk-content-provider-new-for-bytes"><function>gdk_content_provider_new_for_bytes()</function></link>.</para>
<para>GDK knows how to handle common text and image formats out-of-the-box. See
<link linkend="GdkContentSerializer"><type>GdkContentSerializer</type></link> and <link linkend="GdkContentDeserializer"><type>GdkContentDeserializer</type></link> if you want to add support
for application-specific data formats.</para>

</refsect1>
<refsect1 id="GdkContentProvider.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-content-provider-new-for-value" role="function">
<title>gdk_content_provider_new_for_value&#160;()</title>
<indexterm zone="gdk-content-provider-new-for-value"><primary>gdk_content_provider_new_for_value</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
gdk_content_provider_new_for_value (<parameter>const <link linkend="GValue"><type>GValue</type></link> *value</parameter>);</programlisting>
<para>Create a content provider that provides the given <parameter>value</parameter>
.</para>
<refsect3 id="gdk-content-provider-new-for-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>a <link linkend="GValue"><type>GValue</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-content-provider-new-for-value.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-new-typed" role="function">
<title>gdk_content_provider_new_typed&#160;()</title>
<indexterm zone="gdk-content-provider-new-typed"><primary>gdk_content_provider_new_typed</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
gdk_content_provider_new_typed (<parameter><link linkend="GType"><type>GType</type></link> type</parameter>,
                                <parameter>...</parameter>);</programlisting>
<para>Create a content provider that provides the value of the given
<parameter>type</parameter>
.</para>
<para>The value is provided using <link linkend="G-VALUE-COLLECT:CAPS"><function>G_VALUE_COLLECT()</function></link>, so the same rules
apply as when calling <link linkend="g-object-new"><function>g_object_new()</function></link> or <link linkend="g-object-set"><function>g_object_set()</function></link>.</para>
<refsect3 id="gdk-content-provider-new-typed.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>type</para></entry>
<entry role="parameter_description"><para>Type of value to follow</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-content-provider-new-typed.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-new-for-bytes" role="function">
<title>gdk_content_provider_new_for_bytes&#160;()</title>
<indexterm zone="gdk-content-provider-new-for-bytes"><primary>gdk_content_provider_new_for_bytes</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
gdk_content_provider_new_for_bytes (<parameter>const <link linkend="char"><type>char</type></link> *mime_type</parameter>,
                                    <parameter><link linkend="GBytes"><type>GBytes</type></link> *bytes</parameter>);</programlisting>
<para>Create a content provider that provides the given <parameter>bytes</parameter>
 as data for
the given <parameter>mime_type</parameter>
.</para>
<refsect3 id="gdk-content-provider-new-for-bytes.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>mime_type</para></entry>
<entry role="parameter_description"><para>the mime type</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>bytes</para></entry>
<entry role="parameter_description"><para>a <link linkend="GBytes"><type>GBytes</type></link> with the data for <parameter>mime_type</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-content-provider-new-for-bytes.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-new-union" role="function">
<title>gdk_content_provider_new_union&#160;()</title>
<indexterm zone="gdk-content-provider-new-union"><primary>gdk_content_provider_new_union</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
gdk_content_provider_new_union (<parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> **providers</parameter>,
                                <parameter><link linkend="gsize"><type>gsize</type></link> n_providers</parameter>);</programlisting>
<para>Creates a content provider that represents all the given <parameter>providers</parameter>
.</para>
<para>Whenever data needs to be written, the union provider will try the given
<parameter>providers</parameter>
 in the given order and the first one supporting a format will
be chosen to provide it.</para>
<para>This allows an easy way to support providing data in different formats.
For example, an image may be provided by its file and by the image
contents with a call such as</para>
<informalexample><programlisting role="example"><![CDATA[
gdk_content_provider_new_union ((GdkContentProvider *[2]) {
                                  gdk_content_provider_new_typed (G_TYPE_FILE, file),
                                  gdk_content_provider_new_typed (G_TYPE_TEXTURE, texture)
                                }, 2);
]]></programlisting></informalexample>
<para></para>
<refsect3 id="gdk-content-provider-new-union.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>providers</para></entry>
<entry role="parameter_description"><para>The <link linkend="GdkContentProviders"><type>GdkContentProviders</type></link> to present the union of. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>array</acronym> length=n_providers][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>n_providers</para></entry>
<entry role="parameter_description"><para>the number of providers</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-content-provider-new-union.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-ref-formats" role="function">
<title>gdk_content_provider_ref_formats&#160;()</title>
<indexterm zone="gdk-content-provider-ref-formats"><primary>gdk_content_provider_ref_formats</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentFormats"><returnvalue>GdkContentFormats</returnvalue></link>&#160;*
gdk_content_provider_ref_formats (<parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *provider</parameter>);</programlisting>
<para>Gets the formats that the provider can provide its current contents in.</para>
<refsect3 id="gdk-content-provider-ref-formats.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>provider</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-content-provider-ref-formats.returns" role="returns">
<title>Returns</title>
<para>The formats of the provider. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-ref-storable-formats" role="function">
<title>gdk_content_provider_ref_storable_formats&#160;()</title>
<indexterm zone="gdk-content-provider-ref-storable-formats"><primary>gdk_content_provider_ref_storable_formats</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentFormats"><returnvalue>GdkContentFormats</returnvalue></link>&#160;*
gdk_content_provider_ref_storable_formats
                               (<parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *provider</parameter>);</programlisting>
<para>Gets the formats that the provider suggests other applications to store
the data in.  
An example of such an application would be a clipboard manager.</para>
<para>This can be assumed to be a subset of <link linkend="gdk-content-provider-ref-formats"><function>gdk_content_provider_ref_formats()</function></link>.</para>
<refsect3 id="gdk-content-provider-ref-storable-formats.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>provider</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-content-provider-ref-storable-formats.returns" role="returns">
<title>Returns</title>
<para>The storable formats of the provider. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-content-changed" role="function">
<title>gdk_content_provider_content_changed&#160;()</title>
<indexterm zone="gdk-content-provider-content-changed"><primary>gdk_content_provider_content_changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_content_provider_content_changed (<parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *provider</parameter>);</programlisting>
<para>Emits the <link linkend="GdkContentProvider-content-changed"><type>“content-changed”</type></link> signal.</para>
<refsect3 id="gdk-content-provider-content-changed.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>provider</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-write-mime-type-async" role="function">
<title>gdk_content_provider_write_mime_type_async&#160;()</title>
<indexterm zone="gdk-content-provider-write-mime-type-async"><primary>gdk_content_provider_write_mime_type_async</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_content_provider_write_mime_type_async
                               (<parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *provider</parameter>,
                                <parameter>const <link linkend="char"><type>char</type></link> *mime_type</parameter>,
                                <parameter><link linkend="GOutputStream"><type>GOutputStream</type></link> *stream</parameter>,
                                <parameter><link linkend="int"><type>int</type></link> io_priority</parameter>,
                                <parameter><link linkend="GCancellable"><type>GCancellable</type></link> *cancellable</parameter>,
                                <parameter><link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link> callback</parameter>,
                                <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>Asynchronously writes the contents of <parameter>provider</parameter>
 to <parameter>stream</parameter>
 in the given
<parameter>mime_type</parameter>
. When the operation is finished <parameter>callback</parameter>
 will be called. You
can then call <link linkend="gdk-content-provider-write-mime-type-finish"><function>gdk_content_provider_write_mime_type_finish()</function></link> to get the 
result of the operation.</para>
<para>The given mime type does not need to be listed in the formats returned by
<link linkend="gdk-content-provider-ref-formats"><function>gdk_content_provider_ref_formats()</function></link>. However, if the given <link linkend="GType"><type>GType</type></link> is not
supported, <link linkend="G-IO-ERROR-NOT-SUPPORTED:CAPS"><type>G_IO_ERROR_NOT_SUPPORTED</type></link> will be reported.</para>
<para>The given <parameter>stream</parameter>
 will not be closed.</para>
<refsect3 id="gdk-content-provider-write-mime-type-async.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>provider</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>mime_type</para></entry>
<entry role="parameter_description"><para>the mime type to provide the data in</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>stream</para></entry>
<entry role="parameter_description"><para>the <link linkend="GOutputStream"><type>GOutputStream</type></link> to write to</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>io_priority</para></entry>
<entry role="parameter_description"><para>the <link linkend="io-priority">I/O priority</link>
of the request. </para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cancellable</para></entry>
<entry role="parameter_description"><para>optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>callback</para></entry>
<entry role="parameter_description"><para>callback to call when the request is satisfied. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>scope async</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>user_data</para></entry>
<entry role="parameter_description"><para>the data to pass to callback function. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>closure</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-write-mime-type-finish" role="function">
<title>gdk_content_provider_write_mime_type_finish&#160;()</title>
<indexterm zone="gdk-content-provider-write-mime-type-finish"><primary>gdk_content_provider_write_mime_type_finish</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_content_provider_write_mime_type_finish
                               (<parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *provider</parameter>,
                                <parameter><link linkend="GAsyncResult"><type>GAsyncResult</type></link> *result</parameter>,
                                <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Finishes an asynchronous write operation started with
<link linkend="gdk-content-provider-write-mime-type-async"><function>gdk_content_provider_write_mime_type_async()</function></link>.</para>
<refsect3 id="gdk-content-provider-write-mime-type-finish.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>provider</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>result</para></entry>
<entry role="parameter_description"><para>a <link linkend="GAsyncResult"><type>GAsyncResult</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>a <link linkend="GError"><type>GError</type></link> location to store the error occurring, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to
ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-content-provider-write-mime-type-finish.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the operation was completed successfully. Otherwise
<parameter>error</parameter>
will be set to describe the failure.</para>
</refsect3></refsect2>
<refsect2 id="gdk-content-provider-get-value" role="function">
<title>gdk_content_provider_get_value&#160;()</title>
<indexterm zone="gdk-content-provider-get-value"><primary>gdk_content_provider_get_value</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_content_provider_get_value (<parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *provider</parameter>,
                                <parameter><link linkend="GValue"><type>GValue</type></link> *value</parameter>,
                                <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Gets the contents of <parameter>provider</parameter>
 stored in <parameter>value</parameter>
.</para>
<para>The <parameter>value</parameter>
 will have been initialized to the <link linkend="GType"><type>GType</type></link> the value should be
provided in. This given <link linkend="GType"><type>GType</type></link> does not need to be listed in the formats
returned by <link linkend="gdk-content-provider-ref-formats"><function>gdk_content_provider_ref_formats()</function></link>. However, if the given
<link linkend="GType"><type>GType</type></link> is not supported, this operation can fail and
<link linkend="G-IO-ERROR-NOT-SUPPORTED:CAPS"><type>G_IO_ERROR_NOT_SUPPORTED</type></link> will be reported.</para>
<refsect3 id="gdk-content-provider-get-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>provider</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>the <link linkend="GValue"><type>GValue</type></link> to fill</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>a <link linkend="GError"><type>GError</type></link> location to store the error occurring, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to
ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-content-provider-get-value.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the value was set successfully. Otherwise
<parameter>error</parameter>
will be set to describe the failure.</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GdkContentProvider.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkContentProvider-struct" role="struct">
<title>GdkContentProvider</title>
<indexterm zone="GdkContentProvider-struct"><primary>GdkContentProvider</primary></indexterm>
<programlisting language="C">typedef struct _GdkContentProvider GdkContentProvider;</programlisting>
<para>Should not be directly accessed.</para>
</refsect2>
<refsect2 id="GdkContentProviderClass" role="struct">
<title>struct GdkContentProviderClass</title>
<indexterm zone="GdkContentProviderClass"><primary>GdkContentProviderClass</primary></indexterm>
<programlisting language="C">struct GdkContentProviderClass {
  GObjectClass parent_class;

  /* signals */
  void                  (* content_changed)                             (GdkContentProvider     *provider);

  /* vfuncs */
  void                  (* attach_clipboard)                            (GdkContentProvider     *provider,
                                                                         GdkClipboard           *clipboard);
  void                  (* detach_clipboard)                            (GdkContentProvider     *provider,
                                                                         GdkClipboard           *clipboard);

  GdkContentFormats *   (* ref_formats)                                 (GdkContentProvider     *provider);
  GdkContentFormats *   (* ref_storable_formats)                        (GdkContentProvider     *provider);
  void                  (* write_mime_type_async)                       (GdkContentProvider     *provider,
                                                                         const char             *mime_type,
                                                                         GOutputStream          *stream,
                                                                         int                     io_priority,
                                                                         GCancellable           *cancellable,
                                                                         GAsyncReadyCallback     callback,
                                                                         gpointer                user_data);
  gboolean              (* write_mime_type_finish)                      (GdkContentProvider     *provider,
                                                                         GAsyncResult           *result,
                                                                         GError                **error);
  gboolean              (* get_value)                                   (GdkContentProvider     *provider,
                                                                         GValue                 *value,
                                                                         GError                **error);
};
</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GdkContentProvider.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GdkContentProvider--formats" role="property"><title>The <literal>“formats”</literal> property</title>
<indexterm zone="GdkContentProvider--formats"><primary>GdkContentProvider:formats</primary></indexterm>
<programlisting>  “formats”                  <link linkend="GdkContentFormats"><type>GdkContentFormats</type></link>&#160;*</programlisting>
<para>The possible formats that the provider can provide its data in.</para>
<para>Owner: GdkContentProvider</para>
<para>Flags: Read</para>
</refsect2>
<refsect2 id="GdkContentProvider--storable-formats" role="property"><title>The <literal>“storable-formats”</literal> property</title>
<indexterm zone="GdkContentProvider--storable-formats"><primary>GdkContentProvider:storable-formats</primary></indexterm>
<programlisting>  “storable-formats”         <link linkend="GdkContentFormats"><type>GdkContentFormats</type></link>&#160;*</programlisting>
<para>The subset of formats that clipboard managers should store this provider's data in.</para>
<para>Owner: GdkContentProvider</para>
<para>Flags: Read</para>
</refsect2>

</refsect1>
<refsect1 id="GdkContentProvider.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GdkContentProvider-content-changed" role="signal"><title>The <literal>“content-changed”</literal> signal</title>
<indexterm zone="GdkContentProvider-content-changed"><primary>GdkContentProvider::content-changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *gdkcontentprovider,
               <link linkend="gpointer"><type>gpointer</type></link>            user_data)</programlisting>
<para>Emitted whenever the content provided by this provider has changed.</para>
<refsect3 id="GdkContentProvider-content-changed.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>
<refsect1 id="GdkContentProvider.see-also">
<title>See Also</title>
<para><link linkend="GdkContentSerializer"><type>GdkContentSerializer</type></link>, <link linkend="GdkContentDeserializer"><type>GdkContentDeserializer</type></link></para>

</refsect1>

</refentry>
