<refentry id="camel-CamelMultipart">
<refmeta>
<refentrytitle role="top_of_page" id="camel-CamelMultipart.top_of_page">CamelMultipart</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAMEL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>CamelMultipart</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="camel-CamelMultipart.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
struct              <link linkend="CamelMultipart">CamelMultipart</link>;
<link linkend="CamelMultipart">CamelMultipart</link> *    <link linkend="camel-multipart-new">camel_multipart_new</link>                 (void);
<link linkend="void">void</link>                <link linkend="camel-multipart-add-part">camel_multipart_add_part</link>            (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="CamelMimePart">CamelMimePart</link> *part);
<link linkend="void">void</link>                <link linkend="camel-multipart-add-part-at">camel_multipart_add_part_at</link>         (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="CamelMimePart">CamelMimePart</link> *part,
                                                         <link linkend="guint">guint</link> index);
<link linkend="void">void</link>                <link linkend="camel-multipart-remove-part">camel_multipart_remove_part</link>         (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="CamelMimePart">CamelMimePart</link> *part);
<link linkend="CamelMimePart">CamelMimePart</link> *     <link linkend="camel-multipart-remove-part-at">camel_multipart_remove_part_at</link>      (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="guint">guint</link> index);
<link linkend="CamelMimePart">CamelMimePart</link> *     <link linkend="camel-multipart-get-part">camel_multipart_get_part</link>            (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="guint">guint</link> index);
<link linkend="guint">guint</link>               <link linkend="camel-multipart-get-number">camel_multipart_get_number</link>          (<link linkend="CamelMultipart">CamelMultipart</link> *multipart);
<link linkend="void">void</link>                <link linkend="camel-multipart-set-boundary">camel_multipart_set_boundary</link>        (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         const <link linkend="char">char</link> *boundary);
const <link linkend="char">char</link> *        <link linkend="camel-multipart-get-boundary">camel_multipart_get_boundary</link>        (<link linkend="CamelMultipart">CamelMultipart</link> *multipart);
<link linkend="void">void</link>                <link linkend="camel-multipart-set-preface">camel_multipart_set_preface</link>         (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         const <link linkend="char">char</link> *preface);
<link linkend="void">void</link>                <link linkend="camel-multipart-set-postface">camel_multipart_set_postface</link>        (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         const <link linkend="char">char</link> *postface);
<link linkend="int">int</link>                 <link linkend="camel-multipart-construct-from-parser">camel_multipart_construct_from_parser</link>
                                                        (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="struct--CamelMimeParser">struct _CamelMimeParser</link> *parser);
</synopsis>
</refsynopsisdiv>









<refsect1 id="camel-CamelMultipart.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>

<refsect1 id="camel-CamelMultipart.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelMultipart" role="struct">
<title>struct CamelMultipart</title>
<indexterm zone="CamelMultipart"><primary sortas="CamelMultipart">CamelMultipart</primary></indexterm><programlisting>struct CamelMultipart {
	CamelDataWrapper parent_object;

	GList *parts;
	gchar *preface;
	gchar *postface;
};
</programlisting>
<para>
</para></refsect2>
<refsect2 id="camel-multipart-new" role="function">
<title>camel_multipart_new ()</title>
<indexterm zone="camel-multipart-new"><primary sortas="camel_multipart_new">camel_multipart_new</primary></indexterm><programlisting><link linkend="CamelMultipart">CamelMultipart</link> *    camel_multipart_new                 (void);</programlisting>
<para>
Create a new <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-add-part" role="function">
<title>camel_multipart_add_part ()</title>
<indexterm zone="camel-multipart-add-part"><primary sortas="camel_multipart_add_part">camel_multipart_add_part</primary></indexterm><programlisting><link linkend="void">void</link>                camel_multipart_add_part            (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="CamelMimePart">CamelMimePart</link> *part);</programlisting>
<para>
Appends the part to the multipart object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>part</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMimePart"><type>CamelMimePart</type></link> to add
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-add-part-at" role="function">
<title>camel_multipart_add_part_at ()</title>
<indexterm zone="camel-multipart-add-part-at"><primary sortas="camel_multipart_add_part_at">camel_multipart_add_part_at</primary></indexterm><programlisting><link linkend="void">void</link>                camel_multipart_add_part_at         (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="CamelMimePart">CamelMimePart</link> *part,
                                                         <link linkend="guint">guint</link> index);</programlisting>
<para>
Adds the part to the multipart object after the <parameter>index</parameter>'th
element. If <parameter>index</parameter> is greater than the number of parts, it is
equivalent to <link linkend="camel-multipart-add-part"><type>camel_multipart_add_part</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>part</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMimePart"><type>CamelMimePart</type></link> to add
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index</parameter>&#160;:</term>
<listitem><simpara> index to add the multipart at
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-remove-part" role="function">
<title>camel_multipart_remove_part ()</title>
<indexterm zone="camel-multipart-remove-part"><primary sortas="camel_multipart_remove_part">camel_multipart_remove_part</primary></indexterm><programlisting><link linkend="void">void</link>                camel_multipart_remove_part         (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="CamelMimePart">CamelMimePart</link> *part);</programlisting>
<para>
Removes <parameter>part</parameter> from <parameter>multipart</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>part</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMimePart"><type>CamelMimePart</type></link> to remove
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-remove-part-at" role="function">
<title>camel_multipart_remove_part_at ()</title>
<indexterm zone="camel-multipart-remove-part-at"><primary sortas="camel_multipart_remove_part_at">camel_multipart_remove_part_at</primary></indexterm><programlisting><link linkend="CamelMimePart">CamelMimePart</link> *     camel_multipart_remove_part_at      (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="guint">guint</link> index);</programlisting>
<para>
Remove the indicated part from the multipart object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index</parameter>&#160;:</term>
<listitem><simpara> a zero-based index indicating the part to remove
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the removed part. Note that it is <link linkend="camel-object-unref"><type>camel_object_unref</type></link>'ed
before being returned, which may cause it to be destroyed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-get-part" role="function">
<title>camel_multipart_get_part ()</title>
<indexterm zone="camel-multipart-get-part"><primary sortas="camel_multipart_get_part">camel_multipart_get_part</primary></indexterm><programlisting><link linkend="CamelMimePart">CamelMimePart</link> *     camel_multipart_get_part            (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="guint">guint</link> index);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index</parameter>&#160;:</term>
<listitem><simpara> a zero-based index indicating the part to get
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the indicated subpart, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-get-number" role="function">
<title>camel_multipart_get_number ()</title>
<indexterm zone="camel-multipart-get-number"><primary sortas="camel_multipart_get_number">camel_multipart_get_number</primary></indexterm><programlisting><link linkend="guint">guint</link>               camel_multipart_get_number          (<link linkend="CamelMultipart">CamelMultipart</link> *multipart);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of subparts in <parameter>multipart</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-set-boundary" role="function">
<title>camel_multipart_set_boundary ()</title>
<indexterm zone="camel-multipart-set-boundary"><primary sortas="camel_multipart_set_boundary">camel_multipart_set_boundary</primary></indexterm><programlisting><link linkend="void">void</link>                camel_multipart_set_boundary        (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         const <link linkend="char">char</link> *boundary);</programlisting>
<para>
Sets the message boundary for <parameter>multipart</parameter> to <parameter>boundary</parameter>. This should
be a string which does not occur anywhere in any of <parameter>multipart</parameter>'s
subparts. If <parameter>boundary</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, a randomly-generated boundary will
be used.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>boundary</parameter>&#160;:</term>
<listitem><simpara> the message boundary, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-get-boundary" role="function">
<title>camel_multipart_get_boundary ()</title>
<indexterm zone="camel-multipart-get-boundary"><primary sortas="camel_multipart_get_boundary">camel_multipart_get_boundary</primary></indexterm><programlisting>const <link linkend="char">char</link> *        camel_multipart_get_boundary        (<link linkend="CamelMultipart">CamelMultipart</link> *multipart);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the boundary
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-set-preface" role="function">
<title>camel_multipart_set_preface ()</title>
<indexterm zone="camel-multipart-set-preface"><primary sortas="camel_multipart_set_preface">camel_multipart_set_preface</primary></indexterm><programlisting><link linkend="void">void</link>                camel_multipart_set_preface         (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         const <link linkend="char">char</link> *preface);</programlisting>
<para>
Set the preface text for this multipart.  Will be written out infront
of the multipart.  This text should only include US-ASCII strings, and
be relatively short, and will be ignored by any MIME mail client.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>preface</parameter>&#160;:</term>
<listitem><simpara> the multipart preface
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-set-postface" role="function">
<title>camel_multipart_set_postface ()</title>
<indexterm zone="camel-multipart-set-postface"><primary sortas="camel_multipart_set_postface">camel_multipart_set_postface</primary></indexterm><programlisting><link linkend="void">void</link>                camel_multipart_set_postface        (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         const <link linkend="char">char</link> *postface);</programlisting>
<para>
Set the postfix text for this multipart.  Will be written out after
the last boundary of the multipart, and ignored by any MIME mail
client.
</para>
<para>
Generally postface texts should not be sent with multipart messages.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>postface</parameter>&#160;:</term>
<listitem><simpara> multipat postface
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-construct-from-parser" role="function">
<title>camel_multipart_construct_from_parser ()</title>
<indexterm zone="camel-multipart-construct-from-parser"><primary sortas="camel_multipart_construct_from_parser">camel_multipart_construct_from_parser</primary></indexterm><programlisting><link linkend="int">int</link>                 camel_multipart_construct_from_parser
                                                        (<link linkend="CamelMultipart">CamelMultipart</link> *multipart,
                                                         <link linkend="struct--CamelMimeParser">struct _CamelMimeParser</link> *parser);</programlisting>
<para>
Construct a multipart from a parser.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>multipart</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMultipart"><type>CamelMultipart</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMimeParser"><type>CamelMimeParser</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="0--CAPS"><literal>0</literal></link> on success or <link linkend="1--CAPS"><literal>-1</literal></link> on fail
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
