EBookBackendCache

EBookBackendCache — A utility for storing contact data and searching for contacts

Synopsis

#include <libedata-book/libedata-book.h>

struct              EBookBackendCache;
struct              EBookBackendCacheClass;
EBookBackendCache * e_book_backend_cache_new            (const gchar *filename);
EContact *          e_book_backend_cache_get_contact    (EBookBackendCache *cache,
                                                         const gchar *uid);
gboolean            e_book_backend_cache_add_contact    (EBookBackendCache *cache,
                                                         EContact *contact);
gboolean            e_book_backend_cache_remove_contact (EBookBackendCache *cache,
                                                         const gchar *uid);
gboolean            e_book_backend_cache_check_contact  (EBookBackendCache *cache,
                                                         const gchar *uid);
GList *             e_book_backend_cache_get_contacts   (EBookBackendCache *cache,
                                                         const gchar *query);
void                e_book_backend_cache_set_populated  (EBookBackendCache *cache);
gboolean            e_book_backend_cache_is_populated   (EBookBackendCache *cache);
void                e_book_backend_cache_set_time       (EBookBackendCache *cache,
                                                         const gchar *t);
gchar *             e_book_backend_cache_get_time       (EBookBackendCache *cache);
GPtrArray *         e_book_backend_cache_search         (EBookBackendCache *cache,
                                                         const gchar *query);

Description

The EBookBackendCache is deprecated, use EBookSqlite instead.

Details

struct EBookBackendCache

struct EBookBackendCache {
};

Warning

EBookBackendCache has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Contains only private data that should be read and manipulated using the functions below.


struct EBookBackendCacheClass

struct EBookBackendCacheClass {
};

Warning

EBookBackendCacheClass has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Class structure for the EBookBackendCache class.


e_book_backend_cache_new ()

EBookBackendCache * e_book_backend_cache_new            (const gchar *filename);

Warning

e_book_backend_cache_new has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Creates a new EBookBackendCache, which implements a local cache of EContact objects, useful for remote backends.

filename :

file to write cached data

Returns :

a new EBookBackendCache

e_book_backend_cache_get_contact ()

EContact *          e_book_backend_cache_get_contact    (EBookBackendCache *cache,
                                                         const gchar *uid);

Warning

e_book_backend_cache_get_contact has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Get a cached contact. Note that the returned EContact will be newly created, and must be unreffed by the caller when no longer needed.

cache :

an EBookBackendCache

uid :

a unique contact ID

Returns :

A cached EContact, or NULL if uid is not cached.

e_book_backend_cache_add_contact ()

gboolean            e_book_backend_cache_add_contact    (EBookBackendCache *cache,
                                                         EContact *contact);

Warning

e_book_backend_cache_add_contact has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Adds contact to cache.

cache :

an EBookBackendCache

contact :

an EContact

Returns :

TRUE if the contact was cached successfully, FALSE otherwise.

e_book_backend_cache_remove_contact ()

gboolean            e_book_backend_cache_remove_contact (EBookBackendCache *cache,
                                                         const gchar *uid);

Warning

e_book_backend_cache_remove_contact has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Removes the contact identified by uid from cache.

cache :

an EBookBackendCache

uid :

a unique contact ID

Returns :

TRUE if the contact was found and removed, FALSE otherwise.

e_book_backend_cache_check_contact ()

gboolean            e_book_backend_cache_check_contact  (EBookBackendCache *cache,
                                                         const gchar *uid);

Warning

e_book_backend_cache_check_contact has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Checks if the contact identified by uid exists in cache.

cache :

an EBookBackendCache

uid :

a unique contact ID

Returns :

TRUE if the cache contains the contact, FALSE otherwise.

e_book_backend_cache_get_contacts ()

GList *             e_book_backend_cache_get_contacts   (EBookBackendCache *cache,
                                                         const gchar *query);

Warning

e_book_backend_cache_get_contacts has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Returns a list of EContact elements from cache matching query. When done with the list, the caller must unref the contacts and free the list.

cache :

an EBookBackendCache

query :

an s-expression

Returns :

A GList of pointers to EContact.

e_book_backend_cache_set_populated ()

void                e_book_backend_cache_set_populated  (EBookBackendCache *cache);

Warning

e_book_backend_cache_set_populated has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Flags cache as being populated - that is, it is up-to-date on the contents of the book it's caching.

cache :

an EBookBackendCache

e_book_backend_cache_is_populated ()

gboolean            e_book_backend_cache_is_populated   (EBookBackendCache *cache);

Warning

e_book_backend_cache_is_populated has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Checks if cache is populated.

cache :

an EBookBackendCache

Returns :

TRUE if cache is populated, FALSE otherwise.

e_book_backend_cache_set_time ()

void                e_book_backend_cache_set_time       (EBookBackendCache *cache,
                                                         const gchar *t);

Warning

e_book_backend_cache_set_time is deprecated and should not be used in newly-written code.


e_book_backend_cache_get_time ()

gchar *             e_book_backend_cache_get_time       (EBookBackendCache *cache);

Warning

e_book_backend_cache_get_time is deprecated and should not be used in newly-written code.


e_book_backend_cache_search ()

GPtrArray *         e_book_backend_cache_search         (EBookBackendCache *cache,
                                                         const gchar *query);

Warning

e_book_backend_cache_search has been deprecated since version 3.12 and should not be used in newly-written code. Use EBookSqlite instead

Returns an array of pointers to unique contact ID strings for contacts in cache matching query. When done with the array, the caller must free the ID strings and the array.

cache :

an EBookBackendCache

query :

an s-expression

Returns :

A GPtrArray of pointers to contact ID strings.