<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="libedata-cal-ECalBackendCache">
<refmeta>
<refentrytitle role="top_of_page">ECalBackendCache</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBEDATA-CAL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>ECalBackendCache</refname>
<refpurpose>Cache for calendar backends.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

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

<synopsis>



                    <link linkend="ECalBackendCachePrivate">ECalBackendCachePrivate</link>;
<link linkend="ECalBackendCache">ECalBackendCache</link>*   <link linkend="e-cal-backend-cache-new">e_cal_backend_cache_new</link>             (const <link linkend="char">char</link> *uri,
                                                         <link linkend="ECalSourceType">ECalSourceType</link> source_type);
<link linkend="ECalComponent">ECalComponent</link>*      <link linkend="e-cal-backend-cache-get-component">e_cal_backend_cache_get_component</link>   (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *rid);
<link linkend="gboolean">gboolean</link>            <link linkend="e-cal-backend-cache-put-component">e_cal_backend_cache_put_component</link>   (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         <link linkend="ECalComponent">ECalComponent</link> *comp);
<link linkend="gboolean">gboolean</link>            <link linkend="e-cal-backend-cache-remove-component">e_cal_backend_cache_remove_component</link>
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *rid);
<link linkend="GList">GList</link>*              <link linkend="e-cal-backend-cache-get-components">e_cal_backend_cache_get_components</link>  (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);
const <link linkend="icaltimezone">icaltimezone</link>* <link linkend="e-cal-backend-cache-get-timezone">e_cal_backend_cache_get_timezone</link>    (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *tzid);
<link linkend="gboolean">gboolean</link>            <link linkend="e-cal-backend-cache-put-timezone">e_cal_backend_cache_put_timezone</link>    (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="icaltimezone">icaltimezone</link> *zone);
<link linkend="gboolean">gboolean</link>            <link linkend="e-cal-backend-cache-remove-timezone">e_cal_backend_cache_remove_timezone</link> (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *tzid);
<link linkend="gboolean">gboolean</link>            <link linkend="e-cal-backend-cache-put-default-timezone">e_cal_backend_cache_put_default_timezone</link>
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         <link linkend="icaltimezone">icaltimezone</link> *default_zone);
<link linkend="icaltimezone">icaltimezone</link>*       <link linkend="e-cal-backend-cache-get-default-timezone">e_cal_backend_cache_get_default_timezone</link>
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);
<link linkend="GSList">GSList</link>*             <link linkend="e-cal-backend-cache-get-keys">e_cal_backend_cache_get_keys</link>        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);
const <link linkend="char">char</link>*         <link linkend="e-cal-backend-cache-get-marker">e_cal_backend_cache_get_marker</link>      (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);
<link linkend="void">void</link>                <link linkend="e-cal-backend-cache-set-marker">e_cal_backend_cache_set_marker</link>      (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);
<link linkend="gboolean">gboolean</link>            <link linkend="e-cal-backend-cache-put-server-utc-time">e_cal_backend_cache_put_server_utc_time</link>
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *utc_str);
const <link linkend="char">char</link>*         <link linkend="e-cal-backend-cache-get-server-utc-time">e_cal_backend_cache_get_server_utc_time</link>
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);

</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>

</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="ECalBackendCachePrivate" role="struct"/>ECalBackendCachePrivate</title>
<indexterm><primary>ECalBackendCachePrivate</primary></indexterm><programlisting>typedef struct _ECalBackendCachePrivate ECalBackendCachePrivate;</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-new" role="function"/>e_cal_backend_cache_new ()</title>
<indexterm><primary>e_cal_backend_cache_new</primary></indexterm><programlisting><link linkend="ECalBackendCache">ECalBackendCache</link>*   e_cal_backend_cache_new             (const <link linkend="char">char</link> *uri,
                                                         <link linkend="ECalSourceType">ECalSourceType</link> source_type);</programlisting>
<para>
Creates a new <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object, which implements a cache of
calendar/tasks objects, very useful for remote backends.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> URI of the backend to be cached.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>source_type</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The newly created object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-get-component" role="function"/>e_cal_backend_cache_get_component ()</title>
<indexterm><primary>e_cal_backend_cache_get_component</primary></indexterm><programlisting><link linkend="ECalComponent">ECalComponent</link>*      e_cal_backend_cache_get_component   (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *rid);</programlisting>
<para>
Gets a component from the <link linkend="ECalBackendCache"><literal>ECalBackendCache</literal></link> object.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> A <link linkend="ECalBackendCache"><literal>ECalBackendCache</literal></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&nbsp;:</term>
<listitem><simpara> The UID of the component to retrieve.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rid</parameter>&nbsp;:</term>
<listitem><simpara> Recurrence ID of the specific detached recurrence to retrieve,
or NULL if the whole object is to be retrieved.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The <link linkend="ECalComponent"><literal>ECalComponent</literal></link> representing the component found,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if it was not found in the cache.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-put-component" role="function"/>e_cal_backend_cache_put_component ()</title>
<indexterm><primary>e_cal_backend_cache_put_component</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_cal_backend_cache_put_component   (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         <link linkend="ECalComponent">ECalComponent</link> *comp);</programlisting>
<para>
Puts the given calendar component in the given cache. This will add
the component if it does not exist or replace it if there was a
previous version of it.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>comp</parameter>&nbsp;:</term>
<listitem><simpara> Component to put on the cache.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if the operation was successful, FALSE otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-remove-component" role="function"/>e_cal_backend_cache_remove_component ()</title>
<indexterm><primary>e_cal_backend_cache_remove_component</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_cal_backend_cache_remove_component
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid,
                                                         const <link linkend="char">char</link> *rid);</programlisting>
<para>
Removes a component from the cache.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&nbsp;:</term>
<listitem><simpara> UID of the component to remove.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rid</parameter>&nbsp;:</term>
<listitem><simpara> Recurrence-ID of the component to remove. This is used when removing
detached instances of a recurring appointment.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if the component was removed, FALSE otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-get-components" role="function"/>e_cal_backend_cache_get_components ()</title>
<indexterm><primary>e_cal_backend_cache_get_components</primary></indexterm><programlisting><link linkend="GList">GList</link>*              e_cal_backend_cache_get_components  (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);</programlisting>
<para>
Retrieves a list of all the components stored in the cache.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A list of all the components. Each item in the list is
an <link linkend="ECalComponent"><type>ECalComponent</type></link>, which should be freed when no longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-get-timezone" role="function"/>e_cal_backend_cache_get_timezone ()</title>
<indexterm><primary>e_cal_backend_cache_get_timezone</primary></indexterm><programlisting>const <link linkend="icaltimezone">icaltimezone</link>* e_cal_backend_cache_get_timezone    (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *tzid);</programlisting>
<para>
Retrieves a timezone component from the cache.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tzid</parameter>&nbsp;:</term>
<listitem><simpara> ID of the timezone to retrieve.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The timezone if found, or NULL otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-put-timezone" role="function"/>e_cal_backend_cache_put_timezone ()</title>
<indexterm><primary>e_cal_backend_cache_put_timezone</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_cal_backend_cache_put_timezone    (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="icaltimezone">icaltimezone</link> *zone);</programlisting>
<para>
Puts the given timezone in the cache, adding it, if it did not exist, or
replacing it, if there was an older version.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>zone</parameter>&nbsp;:</term>
<listitem><simpara> The timezone to put on the cache.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if the timezone was put on the cache, FALSE otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-remove-timezone" role="function"/>e_cal_backend_cache_remove_timezone ()</title>
<indexterm><primary>e_cal_backend_cache_remove_timezone</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_cal_backend_cache_remove_timezone (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *tzid);</programlisting>
<para>
Removes a timezone component from the cache.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tzid</parameter>&nbsp;:</term>
<listitem><simpara> ID of the timezone to remove.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if the timezone was removed, FALSE otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-put-default-timezone" role="function"/>e_cal_backend_cache_put_default_timezone ()</title>
<indexterm><primary>e_cal_backend_cache_put_default_timezone</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_cal_backend_cache_put_default_timezone
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         <link linkend="icaltimezone">icaltimezone</link> *default_zone);</programlisting>
<para>
Sets the default timezone on the cache.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_zone</parameter>&nbsp;:</term>
<listitem><simpara> The default timezone.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if the operation was successful, FALSE otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-get-default-timezone" role="function"/>e_cal_backend_cache_get_default_timezone ()</title>
<indexterm><primary>e_cal_backend_cache_get_default_timezone</primary></indexterm><programlisting><link linkend="icaltimezone">icaltimezone</link>*       e_cal_backend_cache_get_default_timezone
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);</programlisting>
<para>
Retrieves the default timezone from the cache.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The default timezone, or NULL if no default timezone
has been set on the cache.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-get-keys" role="function"/>e_cal_backend_cache_get_keys ()</title>
<indexterm><primary>e_cal_backend_cache_get_keys</primary></indexterm><programlisting><link linkend="GSList">GSList</link>*             e_cal_backend_cache_get_keys        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);</programlisting>
<para>
Gets the list of unique keys in the cache file.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A list of all the keys. The items in the list are pointers
to internal data, so should not be freed, only the list should.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-get-marker" role="function"/>e_cal_backend_cache_get_marker ()</title>
<indexterm><primary>e_cal_backend_cache_get_marker</primary></indexterm><programlisting>const <link linkend="char">char</link>*         e_cal_backend_cache_get_marker      (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);</programlisting>
<para>
Gets the marker of the cache. If this field is present, it means the
cache has been populated.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The value of the marker or NULL if the cache is still empty.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-set-marker" role="function"/>e_cal_backend_cache_set_marker ()</title>
<indexterm><primary>e_cal_backend_cache_set_marker</primary></indexterm><programlisting><link linkend="void">void</link>                e_cal_backend_cache_set_marker      (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);</programlisting>
<para>
Marks the cache as populated, to discriminate between an empty calendar
and an unpopulated one.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-put-server-utc-time" role="function"/>e_cal_backend_cache_put_server_utc_time ()</title>
<indexterm><primary>e_cal_backend_cache_put_server_utc_time</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_cal_backend_cache_put_server_utc_time
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *utc_str);</programlisting>
<para>
</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>utc_str</parameter>&nbsp;:</term>
<listitem><simpara> UTC string.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if the operation was successful, FALSE otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="e-cal-backend-cache-get-server-utc-time" role="function"/>e_cal_backend_cache_get_server_utc_time ()</title>
<indexterm><primary>e_cal_backend_cache_get_server_utc_time</primary></indexterm><programlisting>const <link linkend="char">char</link>*         e_cal_backend_cache_get_server_utc_time
                                                        (<link linkend="ECalBackendCache">ECalBackendCache</link> *cache);</programlisting>
<para>
</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> An <link linkend="ECalBackendCache"><type>ECalBackendCache</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The server's UTC string.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
