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

<refnamediv>
<refname>CamelImapMessageCache</refname>
<refpurpose></refpurpose>
</refnamediv>

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

<synopsis>
struct              <link linkend="CamelImapMessageCache">CamelImapMessageCache</link>;
<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> * <link linkend="camel-imap-message-cache-new">camel_imap_message_cache_new</link>    (const <link linkend="char">char</link> *path,
                                                         <link linkend="CamelFolderSummary">CamelFolderSummary</link> *summary,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="void">void</link>                <link linkend="camel-imap-message-cache-set-path">camel_imap_message_cache_set_path</link>   (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *path);
<link linkend="guint32">guint32</link>             <link linkend="camel-imap-message-cache-max-uid">camel_imap_message_cache_max_uid</link>    (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache);
<link linkend="CamelStream">CamelStream</link> *       <link linkend="camel-imap-message-cache-insert">camel_imap_message_cache_insert</link>     (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *part_spec,
                                                         const <link linkend="char">char</link> *data,
                                                         <link linkend="int">int</link> len,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="void">void</link>                <link linkend="camel-imap-message-cache-insert-stream">camel_imap_message_cache_insert_stream</link>
                                                        (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *part_spec,
                                                         <link linkend="CamelStream">CamelStream</link> *data_stream,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="void">void</link>                <link linkend="camel-imap-message-cache-insert-wrapper">camel_imap_message_cache_insert_wrapper</link>
                                                        (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *part_spec,
                                                         <link linkend="CamelDataWrapper">CamelDataWrapper</link> *wrapper,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="CamelStream">CamelStream</link> *       <link linkend="camel-imap-message-cache-get">camel_imap_message_cache_get</link>        (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *part_spec,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="void">void</link>                <link linkend="camel-imap-message-cache-remove">camel_imap_message_cache_remove</link>     (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);
<link linkend="void">void</link>                <link linkend="camel-imap-message-cache-clear">camel_imap_message_cache_clear</link>      (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache);
<link linkend="void">void</link>                <link linkend="camel-imap-message-cache-copy">camel_imap_message_cache_copy</link>       (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *source,
                                                         const <link linkend="char">char</link> *source_uid,
                                                         <link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *dest,
                                                         const <link linkend="char">char</link> *dest_uid,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-imap-message-cache-delete">camel_imap_message_cache_delete</link>     (const <link linkend="char">char</link> *path,
                                                         <link linkend="CamelException">CamelException</link> *ex);
</synopsis>
</refsynopsisdiv>









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

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

	char *path;
	GHashTable *parts, *cached;
	guint32 max_uid;
};
</programlisting>
<para>
</para></refsect2>
<refsect2 id="camel-imap-message-cache-new" role="function">
<title>camel_imap_message_cache_new ()</title>
<indexterm zone="camel-imap-message-cache-new"><primary sortas="camel_imap_message_cache_new">camel_imap_message_cache_new</primary></indexterm><programlisting><link linkend="CamelImapMessageCache">CamelImapMessageCache</link> * camel_imap_message_cache_new    (const <link linkend="char">char</link> *path,
                                                         <link linkend="CamelFolderSummary">CamelFolderSummary</link> *summary,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&#160;:</term>
<listitem><simpara> directory to use for storage
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>summary</parameter>&#160;:</term>
<listitem><simpara> CamelFolderSummary for the folder we are caching
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara> a CamelException
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new CamelImapMessageCache object using <parameter>path</parameter> for
storage. If cache files already exist in <parameter>path</parameter>, then any that do not
correspond to messages in <parameter>summary</parameter> will be deleted.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-set-path" role="function">
<title>camel_imap_message_cache_set_path ()</title>
<indexterm zone="camel-imap-message-cache-set-path"><primary sortas="camel_imap_message_cache_set_path">camel_imap_message_cache_set_path</primary></indexterm><programlisting><link linkend="void">void</link>                camel_imap_message_cache_set_path   (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *path);</programlisting>
<para>
Set the path used for the message cache.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>path</parameter>&#160;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-max-uid" role="function">
<title>camel_imap_message_cache_max_uid ()</title>
<indexterm zone="camel-imap-message-cache-max-uid"><primary sortas="camel_imap_message_cache_max_uid">camel_imap_message_cache_max_uid</primary></indexterm><programlisting><link linkend="guint32">guint32</link>             camel_imap_message_cache_max_uid    (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> the cache
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the largest (real) UID in the cache.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-insert" role="function">
<title>camel_imap_message_cache_insert ()</title>
<indexterm zone="camel-imap-message-cache-insert"><primary sortas="camel_imap_message_cache_insert">camel_imap_message_cache_insert</primary></indexterm><programlisting><link linkend="CamelStream">CamelStream</link> *       camel_imap_message_cache_insert     (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *part_spec,
                                                         const <link linkend="char">char</link> *data,
                                                         <link linkend="int">int</link> len,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
Caches the provided data into <parameter>cache</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> the cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&#160;:</term>
<listitem><simpara> UID of the message data to cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>part_spec</parameter>&#160;:</term>
<listitem><simpara> the IMAP part_spec of the data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> the data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>data</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a CamelStream containing the cached data, which the
caller must unref.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-insert-stream" role="function">
<title>camel_imap_message_cache_insert_stream ()</title>
<indexterm zone="camel-imap-message-cache-insert-stream"><primary sortas="camel_imap_message_cache_insert_stream">camel_imap_message_cache_insert_stream</primary></indexterm><programlisting><link linkend="void">void</link>                camel_imap_message_cache_insert_stream
                                                        (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *part_spec,
                                                         <link linkend="CamelStream">CamelStream</link> *data_stream,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
Caches the provided data into <parameter>cache</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> the cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&#160;:</term>
<listitem><simpara> UID of the message data to cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>part_spec</parameter>&#160;:</term>
<listitem><simpara> the IMAP part_spec of the data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data_stream</parameter>&#160;:</term>
<listitem><simpara> the stream to cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-insert-wrapper" role="function">
<title>camel_imap_message_cache_insert_wrapper ()</title>
<indexterm zone="camel-imap-message-cache-insert-wrapper"><primary sortas="camel_imap_message_cache_insert_wrapper">camel_imap_message_cache_insert_wrapper</primary></indexterm><programlisting><link linkend="void">void</link>                camel_imap_message_cache_insert_wrapper
                                                        (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *part_spec,
                                                         <link linkend="CamelDataWrapper">CamelDataWrapper</link> *wrapper,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
Caches the provided data into <parameter>cache</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> the cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&#160;:</term>
<listitem><simpara> UID of the message data to cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>part_spec</parameter>&#160;:</term>
<listitem><simpara> the IMAP part_spec of the data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>wrapper</parameter>&#160;:</term>
<listitem><simpara> the wrapper to cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-get" role="function">
<title>camel_imap_message_cache_get ()</title>
<indexterm zone="camel-imap-message-cache-get"><primary sortas="camel_imap_message_cache_get">camel_imap_message_cache_get</primary></indexterm><programlisting><link linkend="CamelStream">CamelStream</link> *       camel_imap_message_cache_get        (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *part_spec,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> the cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&#160;:</term>
<listitem><simpara> the UID of the data to get
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>part_spec</parameter>&#160;:</term>
<listitem><simpara> the part_spec of the data to get
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara> exception
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a CamelStream containing the cached data (which the
caller must unref), or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if that data is not cached.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-remove" role="function">
<title>camel_imap_message_cache_remove ()</title>
<indexterm zone="camel-imap-message-cache-remove"><primary sortas="camel_imap_message_cache_remove">camel_imap_message_cache_remove</primary></indexterm><programlisting><link linkend="void">void</link>                camel_imap_message_cache_remove     (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);</programlisting>
<para>
Removes all data associated with <parameter>uid</parameter> from <parameter>cache</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> the cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&#160;:</term>
<listitem><simpara> UID of the data to remove
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-clear" role="function">
<title>camel_imap_message_cache_clear ()</title>
<indexterm zone="camel-imap-message-cache-clear"><primary sortas="camel_imap_message_cache_clear">camel_imap_message_cache_clear</primary></indexterm><programlisting><link linkend="void">void</link>                camel_imap_message_cache_clear      (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *cache);</programlisting>
<para>
Removes all cached data from <parameter>cache</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> the cache
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-copy" role="function">
<title>camel_imap_message_cache_copy ()</title>
<indexterm zone="camel-imap-message-cache-copy"><primary sortas="camel_imap_message_cache_copy">camel_imap_message_cache_copy</primary></indexterm><programlisting><link linkend="void">void</link>                camel_imap_message_cache_copy       (<link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *source,
                                                         const <link linkend="char">char</link> *source_uid,
                                                         <link linkend="CamelImapMessageCache">CamelImapMessageCache</link> *dest,
                                                         const <link linkend="char">char</link> *dest_uid,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
Copies all cached parts from <parameter>source_uid</parameter> in <parameter>source</parameter> to <parameter>dest_uid</parameter> in
<parameter>destination</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>source</parameter>&#160;:</term>
<listitem><simpara> the source message cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>source_uid</parameter>&#160;:</term>
<listitem><simpara> UID of a message in <parameter>source</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dest</parameter>&#160;:</term>
<listitem><simpara> the destination message cache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dest_uid</parameter>&#160;:</term>
<listitem><simpara> UID of the message in <parameter>dest</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-imap-message-cache-delete" role="function">
<title>camel_imap_message_cache_delete ()</title>
<indexterm zone="camel-imap-message-cache-delete"><primary sortas="camel_imap_message_cache_delete">camel_imap_message_cache_delete</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_imap_message_cache_delete     (const <link linkend="char">char</link> *path,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
All the files under this directory would be deleted</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&#160;:</term>
<listitem><simpara> directory to use for storage
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara> a CamelException
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
