<refentry id="GMimeObject">
<refmeta>
<refentrytitle role="top_of_page" id="GMimeObject.top_of_page">GMimeObject</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GMimeObject</refname>
<refpurpose>Abstract MIME objects</refpurpose>
</refnamediv>

<refsynopsisdiv id="GMimeObject.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>                    <link linkend="GMimeObject-struct">GMimeObject</link>;
<link linkend="void"><returnvalue>void</returnvalue></link>                (<link linkend="GMimeObjectForeachFunc">*GMimeObjectForeachFunc</link>)           (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *parent</parameter>,
                                                         <parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *part</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-register-type">g_mime_object_register_type</link>         (<parameter>const <link linkend="char"><type>char</type></link> *type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>,
                                                         <parameter><link linkend="GType"><type>GType</type></link> object_type</parameter>);
<link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       <link linkend="g-mime-object-new">g_mime_object_new</link>                   (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *content_type</parameter>);
<link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       <link linkend="g-mime-object-new-type">g_mime_object_new_type</link>              (<parameter>const <link linkend="char"><type>char</type></link> *type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-set-content-type">g_mime_object_set_content_type</link>      (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *content_type</parameter>);
<link linkend="GMimeContentType"><returnvalue>GMimeContentType</returnvalue></link> *  <link linkend="g-mime-object-get-content-type">g_mime_object_get_content_type</link>      (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-set-content-type-parameter">g_mime_object_set_content_type_parameter</link>
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-object-get-content-type-parameter">g_mime_object_get_content_type_parameter</link>
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *name</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-set-disposition">g_mime_object_set_disposition</link>       (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *disposition</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-object-get-disposition">g_mime_object_get_disposition</link>       (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-set-content-disposition">g_mime_object_set_content_disposition</link>
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GMimeContentDisposition"><type>GMimeContentDisposition</type></link> *disposition</parameter>);
<link linkend="GMimeContentDisposition"><returnvalue>GMimeContentDisposition</returnvalue></link> * <link linkend="g-mime-object-get-content-disposition">g_mime_object_get_content_disposition</link>
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-set-content-disposition-parameter">g_mime_object_set_content_disposition_parameter</link>
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *attribute</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-object-get-content-disposition-parameter">g_mime_object_get_content_disposition_parameter</link>
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *attribute</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-set-content-id">g_mime_object_set_content_id</link>        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *content_id</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-object-get-content-id">g_mime_object_get_content_id</link>        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-prepend-header">g_mime_object_prepend_header</link>        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-append-header">g_mime_object_append_header</link>         (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="g-mime-object-remove-header">g_mime_object_remove_header</link>         (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-set-header">g_mime_object_set_header</link>            (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-object-get-header">g_mime_object_get_header</link>            (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-object-get-headers">g_mime_object_get_headers</link>           (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);
<link linkend="GMimeHeaderList"><returnvalue>GMimeHeaderList</returnvalue></link> *   <link linkend="g-mime-object-get-header-list">g_mime_object_get_header_list</link>       (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);
<link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             <link linkend="g-mime-object-write-to-stream">g_mime_object_write_to_stream</link>       (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-object-to-string">g_mime_object_to_string</link>             (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-object-encode">g_mime_object_encode</link>                (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GMimeEncodingConstraint"><type>GMimeEncodingConstraint</type></link> constraint</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GMimeObject.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GMimeObject
         +----<link linkend="GMimeMessage">GMimeMessage</link>
         +----<link linkend="GMimePart">GMimePart</link>
         +----<link linkend="GMimeMultipart">GMimeMultipart</link>
         +----<link linkend="GMimeMessagePart">GMimeMessagePart</link>
</synopsis>
</refsect1>

<refsect1 id="GMimeObject.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GMimeObject"><type>GMimeObject</type></link> is an abstract class from which all Message and Mime
parts are derived.
</para>
</refsect1>
<refsect1 id="GMimeObject.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMimeObject-struct" role="struct">
<title>GMimeObject</title>
<indexterm zone="GMimeObject-struct"><primary>GMimeObject</primary></indexterm>
<programlisting>typedef struct _GMimeObject GMimeObject;</programlisting>
<para>
Base class for all MIME parts.
</para><variablelist role="struct">
</variablelist></refsect2>
<refsect2 id="GMimeObjectForeachFunc" role="function">
<title>GMimeObjectForeachFunc ()</title>
<indexterm zone="GMimeObjectForeachFunc"><primary>GMimeObjectForeachFunc</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                (*GMimeObjectForeachFunc)           (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *parent</parameter>,
                                                         <parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *part</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>
The function signature for a callback to <link linkend="g-mime-message-foreach"><function>g_mime_message_foreach()</function></link>
and <link linkend="g-mime-multipart-foreach"><function>g_mime_multipart_foreach()</function></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>parent</parameter>&#160;:</term>
<listitem><simpara>parent <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>part</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>User-supplied callback data.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-register-type" role="function">
<title>g_mime_object_register_type ()</title>
<indexterm zone="g-mime-object-register-type"><primary>g_mime_object_register_type</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_register_type         (<parameter>const <link linkend="char"><type>char</type></link> *type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>,
                                                         <parameter><link linkend="GType"><type>GType</type></link> object_type</parameter>);</programlisting>
<para>
Registers the object type <parameter>object_type</parameter> for use with the
<link linkend="g-mime-object-new-type"><function>g_mime_object_new_type()</function></link> convenience function.
</para>
<para>
Note: You may use the wildcard "*" to match any type and/or
subtype.
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>mime type
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>subtype</parameter>&#160;:</term>
<listitem><simpara>mime subtype
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>object_type</parameter>&#160;:</term>
<listitem><simpara>object type
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-new" role="function">
<title>g_mime_object_new ()</title>
<indexterm zone="g-mime-object-new"><primary>g_mime_object_new</primary></indexterm>
<programlisting><link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       g_mime_object_new                   (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *content_type</parameter>);</programlisting>
<para>
Performs a lookup of registered <link linkend="GMimeObject"><type>GMimeObject</type></link> subclasses, registered
using <link linkend="g-mime-object-register-type"><function>g_mime_object_register_type()</function></link>, to find an appropriate class
capable of handling MIME parts of the specified Content-Type. If no
class has been registered to handle that type, it looks for a
registered class that can handle <parameter>content_type</parameter>'s media type. If
that also fails, then it will use the generic part class,
<link linkend="GMimePart"><type>GMimePart</type></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>content_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an appropriate <link linkend="GMimeObject"><type>GMimeObject</type></link> registered to handle MIME
parts appropriate for <parameter>content_type</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-new-type" role="function">
<title>g_mime_object_new_type ()</title>
<indexterm zone="g-mime-object-new-type"><primary>g_mime_object_new_type</primary></indexterm>
<programlisting><link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       g_mime_object_new_type              (<parameter>const <link linkend="char"><type>char</type></link> *type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>);</programlisting>
<para>
Performs a lookup of registered <link linkend="GMimeObject"><type>GMimeObject</type></link> subclasses, registered
using <link linkend="g-mime-object-register-type"><function>g_mime_object_register_type()</function></link>, to find an appropriate class
capable of handling MIME parts of type <parameter>type</parameter>/<parameter>subtype</parameter>. If no class
has been registered to handle that type, it looks for a registered
class that can handle <parameter>type</parameter>. If that also fails, then it will use
the generic part class, <link linkend="GMimePart"><type>GMimePart</type></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>mime type
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>subtype</parameter>&#160;:</term>
<listitem><simpara>mime subtype
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an appropriate <link linkend="GMimeObject"><type>GMimeObject</type></link> registered to handle mime-types
of <parameter>type</parameter>/<parameter>subtype</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-set-content-type" role="function">
<title>g_mime_object_set_content_type ()</title>
<indexterm zone="g-mime-object-set-content-type"><primary>g_mime_object_set_content_type</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_set_content_type      (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *content_type</parameter>);</programlisting>
<para>
Sets the content-type for the specified MIME object and then
serializes it to the Content-Type header field.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-content-type" role="function">
<title>g_mime_object_get_content_type ()</title>
<indexterm zone="g-mime-object-get-content-type"><primary>g_mime_object_get_content_type</primary></indexterm>
<programlisting><link linkend="GMimeContentType"><returnvalue>GMimeContentType</returnvalue></link> *  g_mime_object_get_content_type      (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);</programlisting>
<para>
Gets the <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object for the given MIME object or
<link linkend="NULL:CAPS"><literal>NULL</literal></link> on fail.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the content-type object for the specified MIME object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-set-content-type-parameter" role="function">
<title>g_mime_object_set_content_type_parameter ()</title>
<indexterm zone="g-mime-object-set-content-type-parameter"><primary>g_mime_object_set_content_type_parameter</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_set_content_type_parameter
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);</programlisting>
<para>
Sets the content-type param <parameter>name</parameter> to the value <parameter>value</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara>param name
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara>param value
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-content-type-parameter" role="function">
<title>g_mime_object_get_content_type_parameter ()</title>
<indexterm zone="g-mime-object-get-content-type-parameter"><primary>g_mime_object_get_content_type_parameter</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_object_get_content_type_parameter
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *name</parameter>);</programlisting>
<para>
Gets the value of the content-type param <parameter>name</parameter> set on the MIME part
<parameter>object</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara>param name
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the value of the requested content-type param or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on
if the param doesn't exist.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-set-disposition" role="function">
<title>g_mime_object_set_disposition ()</title>
<indexterm zone="g-mime-object-set-disposition"><primary>g_mime_object_set_disposition</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_set_disposition       (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *disposition</parameter>);</programlisting>
<para>
Sets the disposition to <parameter>disposition</parameter> which may be one of
<link linkend="GMIME-DISPOSITION-ATTACHMENT:CAPS"><type>GMIME_DISPOSITION_ATTACHMENT</type></link> or <link linkend="GMIME-DISPOSITION-INLINE:CAPS"><type>GMIME_DISPOSITION_INLINE</type></link> or, by
your choice, any other string which would indicate how the MIME
part should be displayed by the MUA.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>disposition</parameter>&#160;:</term>
<listitem><simpara>disposition ("attachment" or "inline")
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-disposition" role="function">
<title>g_mime_object_get_disposition ()</title>
<indexterm zone="g-mime-object-get-disposition"><primary>g_mime_object_get_disposition</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_object_get_disposition       (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);</programlisting>
<para>
Gets the MIME object's disposition if set or <link linkend="NULL:CAPS"><literal>NULL</literal></link> otherwise.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the disposition string which is probably one of
<link linkend="GMIME-DISPOSITION-ATTACHMENT:CAPS"><type>GMIME_DISPOSITION_ATTACHMENT</type></link> or <link linkend="GMIME-DISPOSITION-INLINE:CAPS"><type>GMIME_DISPOSITION_INLINE</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-set-content-disposition" role="function">
<title>g_mime_object_set_content_disposition ()</title>
<indexterm zone="g-mime-object-set-content-disposition"><primary>g_mime_object_set_content_disposition</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_set_content_disposition
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GMimeContentDisposition"><type>GMimeContentDisposition</type></link> *disposition</parameter>);</programlisting>
<para>
Set the content disposition for the specified mime part and then
serializes it to the Content-Disposition header field.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>disposition</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentDisposition"><type>GMimeContentDisposition</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-content-disposition" role="function">
<title>g_mime_object_get_content_disposition ()</title>
<indexterm zone="g-mime-object-get-content-disposition"><primary>g_mime_object_get_content_disposition</primary></indexterm>
<programlisting><link linkend="GMimeContentDisposition"><returnvalue>GMimeContentDisposition</returnvalue></link> * g_mime_object_get_content_disposition
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);</programlisting>
<para>
Gets the <link linkend="GMimeContentDisposition"><type>GMimeContentDisposition</type></link> for the specified MIME object.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GMimeContentDisposition"><type>GMimeContentDisposition</type></link> set on the MIME object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-set-content-disposition-parameter" role="function">
<title>g_mime_object_set_content_disposition_parameter ()</title>
<indexterm zone="g-mime-object-set-content-disposition-parameter"><primary>g_mime_object_set_content_disposition_parameter</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_set_content_disposition_parameter
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *attribute</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);</programlisting>
<para>
Add a content-disposition parameter to the specified mime part.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attribute</parameter>&#160;:</term>
<listitem><simpara>parameter name
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara>parameter value
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-content-disposition-parameter" role="function">
<title>g_mime_object_get_content_disposition_parameter ()</title>
<indexterm zone="g-mime-object-get-content-disposition-parameter"><primary>g_mime_object_get_content_disposition_parameter</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_object_get_content_disposition_parameter
                                                        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *attribute</parameter>);</programlisting>
<para>
Gets the value of the Content-Disposition parameter specified by
<parameter>attribute</parameter>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the parameter does not exist.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attribute</parameter>&#160;:</term>
<listitem><simpara>parameter name
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the value of a previously defined content-disposition
parameter specified by <parameter>attribute</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-set-content-id" role="function">
<title>g_mime_object_set_content_id ()</title>
<indexterm zone="g-mime-object-set-content-id"><primary>g_mime_object_set_content_id</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_set_content_id        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *content_id</parameter>);</programlisting>
<para>
Sets the Content-Id of the MIME object.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_id</parameter>&#160;:</term>
<listitem><simpara>content-id (addr-spec portion)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-content-id" role="function">
<title>g_mime_object_get_content_id ()</title>
<indexterm zone="g-mime-object-get-content-id"><primary>g_mime_object_get_content_id</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_object_get_content_id        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);</programlisting>
<para>
Gets the Content-Id of the MIME object or NULL if one is not set.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a const pointer to the Content-Id header.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-prepend-header" role="function">
<title>g_mime_object_prepend_header ()</title>
<indexterm zone="g-mime-object-prepend-header"><primary>g_mime_object_prepend_header</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_prepend_header        (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);</programlisting>
<para>
Prepends a header to the MIME object.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>header</parameter>&#160;:</term>
<listitem><simpara>header name
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara>header value
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-append-header" role="function">
<title>g_mime_object_append_header ()</title>
<indexterm zone="g-mime-object-append-header"><primary>g_mime_object_append_header</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_append_header         (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);</programlisting>
<para>
Appends a header to the MIME object.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>header</parameter>&#160;:</term>
<listitem><simpara>header name
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara>header value
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-remove-header" role="function">
<title>g_mime_object_remove_header ()</title>
<indexterm zone="g-mime-object-remove-header"><primary>g_mime_object_remove_header</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            g_mime_object_remove_header         (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>);</programlisting>
<para>
Removed the specified header if it exists.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>header</parameter>&#160;:</term>
<listitem><simpara>header name
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the header was removed or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if it could not
be found.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-set-header" role="function">
<title>g_mime_object_set_header ()</title>
<indexterm zone="g-mime-object-set-header"><primary>g_mime_object_set_header</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_set_header            (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);</programlisting>
<para>
Sets an arbitrary header on the MIME object.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>header</parameter>&#160;:</term>
<listitem><simpara>header name
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara>header value
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-header" role="function">
<title>g_mime_object_get_header ()</title>
<indexterm zone="g-mime-object-get-header"><primary>g_mime_object_get_header</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_object_get_header            (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>);</programlisting>
<para>
Gets the value of the requested header if it exists or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
otherwise.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>header</parameter>&#160;:</term>
<listitem><simpara>header name
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the value of the header <parameter>header</parameter> if it exists or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-headers" role="function">
<title>g_mime_object_get_headers ()</title>
<indexterm zone="g-mime-object-get-headers"><primary>g_mime_object_get_headers</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_object_get_headers           (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);</programlisting>
<para>
Allocates a string buffer containing all of the MIME object's raw
headers.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an allocated string containing all of the raw MIME headers.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-get-header-list" role="function">
<title>g_mime_object_get_header_list ()</title>
<indexterm zone="g-mime-object-get-header-list"><primary>g_mime_object_get_header_list</primary></indexterm>
<programlisting><link linkend="GMimeHeaderList"><returnvalue>GMimeHeaderList</returnvalue></link> *   g_mime_object_get_header_list       (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);</programlisting>
<para>
Get the header list for <parameter>object</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GMimeHeaderList"><type>GMimeHeaderList</type></link> for <parameter>object</parameter>. Do not free this pointer
when you are done with it.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-write-to-stream" role="function">
<title>g_mime_object_write_to_stream ()</title>
<indexterm zone="g-mime-object-write-to-stream"><primary>g_mime_object_write_to_stream</primary></indexterm>
<programlisting><link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             g_mime_object_write_to_stream       (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Write the contents of the MIME object to <parameter>stream</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>stream
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of bytes written or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-to-string" role="function">
<title>g_mime_object_to_string ()</title>
<indexterm zone="g-mime-object-to-string"><primary>g_mime_object_to_string</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_object_to_string             (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>);</programlisting>
<para>
Allocates a string buffer containing the contents of <parameter>object</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an allocated string containing the contents of the mime
object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-object-encode" role="function">
<title>g_mime_object_encode ()</title>
<indexterm zone="g-mime-object-encode"><primary>g_mime_object_encode</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_object_encode                (<parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GMimeEncodingConstraint"><type>GMimeEncodingConstraint</type></link> constraint</parameter>);</programlisting>
<para>
Calculates and sets the most efficient Content-Transfer-Encoding
for this <link linkend="GMimeObject"><type>GMimeObject</type></link> and all child parts based on the <parameter>constraint</parameter>
provided.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeObject"><type>GMimeObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>constraint</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeEncodingConstraint"><type>GMimeEncodingConstraint</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

</refentry>
