<?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="EBookBackendCache">
<refmeta>
<refentrytitle role="top_of_page" id="EBookBackendCache.top_of_page">EBookBackendCache</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBEDATA-BOOK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>EBookBackendCache</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

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

<synopsis>
                    <link linkend="EBookBackendCache-struct">EBookBackendCache</link>;
<link linkend="EBookBackendCache">EBookBackendCache</link>*  <link linkend="e-book-backend-cache-new">e_book_backend_cache_new</link>            (const <link linkend="char">char</link> *uri);
<link linkend="EContact">EContact</link>*           <link linkend="e-book-backend-cache-get-contact">e_book_backend_cache_get_contact</link>    (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);
<link linkend="gboolean">gboolean</link>            <link linkend="e-book-backend-cache-add-contact">e_book_backend_cache_add_contact</link>    (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         <link linkend="EContact">EContact</link> *contact);
<link linkend="gboolean">gboolean</link>            <link linkend="e-book-backend-cache-remove-contact">e_book_backend_cache_remove_contact</link> (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);
<link linkend="gboolean">gboolean</link>            <link linkend="e-book-backend-cache-check-contact">e_book_backend_cache_check_contact</link>  (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);
<link linkend="GList">GList</link>*              <link linkend="e-book-backend-cache-get-contacts">e_book_backend_cache_get_contacts</link>   (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *query);
<link linkend="gboolean">gboolean</link>            <link linkend="e-book-backend-cache-exists">e_book_backend_cache_exists</link>         (const <link linkend="char">char</link> *uri);
<link linkend="void">void</link>                <link linkend="e-book-backend-cache-set-populated">e_book_backend_cache_set_populated</link>  (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache);
<link linkend="gboolean">gboolean</link>            <link linkend="e-book-backend-cache-is-populated">e_book_backend_cache_is_populated</link>   (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache);
<link linkend="void">void</link>                <link linkend="e-book-backend-cache-set-time">e_book_backend_cache_set_time</link>       (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *t);
<link linkend="char">char</link>*               <link linkend="e-book-backend-cache-get-time">e_book_backend_cache_get_time</link>       (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache);
<link linkend="GPtrArray">GPtrArray</link>*          <link linkend="e-book-backend-cache-search">e_book_backend_cache_search</link>         (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *query);
</synopsis>
</refsynopsisdiv>

<refsect1 id="EBookBackendCache.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="EFileCache">EFileCache</link>
         +----EBookBackendCache
</synopsis>

</refsect1>





<refsect1 id="EBookBackendCache.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="EBookBackendCache--uri">uri</link>&quot;                      <link linkend="gchar">gchar</link>*                : Read / Write / Construct Only
</synopsis>
</refsect1>



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

</para>
</refsect1>

<refsect1 id="EBookBackendCache.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="EBookBackendCache-struct" role="struct">
<title>EBookBackendCache</title>
<indexterm zone="EBookBackendCache-struct"><primary>EBookBackendCache</primary></indexterm><programlisting>typedef struct _EBookBackendCache EBookBackendCache;</programlisting>
<para>

</para></refsect2>
<refsect2 id="e-book-backend-cache-new" role="function">
<title>e_book_backend_cache_new ()</title>
<indexterm zone="e-book-backend-cache-new"><primary>e_book_backend_cache_new</primary></indexterm><programlisting><link linkend="EBookBackendCache">EBookBackendCache</link>*  e_book_backend_cache_new            (const <link linkend="char">char</link> *uri);</programlisting>
<para>
Creates a new <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link> object, which implements a local
cache of <link linkend="EContact"><type>EContact</type></link> objects, 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><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A new <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-get-contact" role="function">
<title>e_book_backend_cache_get_contact ()</title>
<indexterm zone="e-book-backend-cache-get-contact"><primary>e_book_backend_cache_get_contact</primary></indexterm><programlisting><link linkend="EContact">EContact</link>*           e_book_backend_cache_get_contact    (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);</programlisting>
<para>
Get a cached contact. Note that the returned <link linkend="EContact"><type>EContact</type></link> will be
newly created, and must be unreffed by the caller when no longer
needed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&nbsp;:</term>
<listitem><simpara> a unique contact ID
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A cached <link linkend="EContact"><type>EContact</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if <parameter>uid</parameter> is not cached.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-add-contact" role="function">
<title>e_book_backend_cache_add_contact ()</title>
<indexterm zone="e-book-backend-cache-add-contact"><primary>e_book_backend_cache_add_contact</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_book_backend_cache_add_contact    (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         <link linkend="EContact">EContact</link> *contact);</programlisting>
<para>
Adds <parameter>contact</parameter> to <parameter>cache</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>contact</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EContact"><type>EContact</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the contact was cached successfully, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-remove-contact" role="function">
<title>e_book_backend_cache_remove_contact ()</title>
<indexterm zone="e-book-backend-cache-remove-contact"><primary>e_book_backend_cache_remove_contact</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_book_backend_cache_remove_contact (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);</programlisting>
<para>
Removes the contact identified by <parameter>uid</parameter> from <parameter>cache</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&nbsp;:</term>
<listitem><simpara> a unique contact ID
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the contact was found and removed, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-check-contact" role="function">
<title>e_book_backend_cache_check_contact ()</title>
<indexterm zone="e-book-backend-cache-check-contact"><primary>e_book_backend_cache_check_contact</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_book_backend_cache_check_contact  (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);</programlisting>
<para>
Checks if the contact identified by <parameter>uid</parameter> exists in <parameter>cache</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&nbsp;:</term>
<listitem><simpara> a unique contact ID
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the cache contains the contact, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-get-contacts" role="function">
<title>e_book_backend_cache_get_contacts ()</title>
<indexterm zone="e-book-backend-cache-get-contacts"><primary>e_book_backend_cache_get_contacts</primary></indexterm><programlisting><link linkend="GList">GList</link>*              e_book_backend_cache_get_contacts   (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *query);</programlisting>
<para>
Returns a list of <link linkend="EContact"><type>EContact</type></link> elements from <parameter>cache</parameter> matching <parameter>query</parameter>.
When done with the list, the caller must unref the contacts and
free the list.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>query</parameter>&nbsp;:</term>
<listitem><simpara> an s-expression
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A <link linkend="GList"><type>GList</type></link> of pointers to <link linkend="EContact"><type>EContact</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-exists" role="function">
<title>e_book_backend_cache_exists ()</title>
<indexterm zone="e-book-backend-cache-exists"><primary>e_book_backend_cache_exists</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_book_backend_cache_exists         (const <link linkend="char">char</link> *uri);</programlisting>
<para>
Checks if an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link> exists at <parameter>uri</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> URI for the cache
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if cache exists, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if not.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-set-populated" role="function">
<title>e_book_backend_cache_set_populated ()</title>
<indexterm zone="e-book-backend-cache-set-populated"><primary>e_book_backend_cache_set_populated</primary></indexterm><programlisting><link linkend="void">void</link>                e_book_backend_cache_set_populated  (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache);</programlisting>
<para>
Flags <parameter>cache</parameter> as being populated - that is, it is up-to-date on the
contents of the book it's caching.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-is-populated" role="function">
<title>e_book_backend_cache_is_populated ()</title>
<indexterm zone="e-book-backend-cache-is-populated"><primary>e_book_backend_cache_is_populated</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_book_backend_cache_is_populated   (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache);</programlisting>
<para>
Checks if <parameter>cache</parameter> is populated.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>cache</parameter> is populated, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-set-time" role="function">
<title>e_book_backend_cache_set_time ()</title>
<indexterm zone="e-book-backend-cache-set-time"><primary>e_book_backend_cache_set_time</primary></indexterm><programlisting><link linkend="void">void</link>                e_book_backend_cache_set_time       (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *t);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>t</parameter>&nbsp;:</term>
<listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-get-time" role="function">
<title>e_book_backend_cache_get_time ()</title>
<indexterm zone="e-book-backend-cache-get-time"><primary>e_book_backend_cache_get_time</primary></indexterm><programlisting><link linkend="char">char</link>*               e_book_backend_cache_get_time       (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-book-backend-cache-search" role="function">
<title>e_book_backend_cache_search ()</title>
<indexterm zone="e-book-backend-cache-search"><primary>e_book_backend_cache_search</primary></indexterm><programlisting><link linkend="GPtrArray">GPtrArray</link>*          e_book_backend_cache_search         (<link linkend="EBookBackendCache">EBookBackendCache</link> *cache,
                                                         const <link linkend="char">char</link> *query);</programlisting>
<para>
Returns an array of pointers to unique contact ID strings for contacts
in <parameter>cache</parameter> matching <parameter>query</parameter>. When done with the array, the caller must
free the ID strings and the array.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&nbsp;:</term>
<listitem><simpara> an <link linkend="EBookBackendCache"><type>EBookBackendCache</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>query</parameter>&nbsp;:</term>
<listitem><simpara> an s-expression
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A <link linkend="GPtrArray"><type>GPtrArray</type></link> of pointers to contact ID strings.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="EBookBackendCache.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="EBookBackendCache--uri"><title>The <literal>&quot;uri&quot;</literal> property</title>
<indexterm zone="EBookBackendCache--uri"><primary>EBookBackendCache:uri</primary></indexterm><programlisting>  &quot;uri&quot;                      <link linkend="gchar">gchar</link>*                : Read / Write / Construct Only</programlisting>
<para></para><para>Default value: ""</para>
</refsect2>

</refsect1>




</refentry>
