EDataBook.BookCache
Description: Reference for EDataBook.BookCache

### Class

# EDataBookBookCache

since: 3.26

#### Description

    class EDataBook.BookCache : EBackend.Cache
      implements EDataServer.Extensible {
      /* No available fields */
    }

No description available.

Available since: 3.26

#### Hierarchy

#### Ancestors

- ECache
- GObject

#### Implements

- EExtensible

#### Constructors

###### e_book_cache_new

Creates a new `EBookCache` with the default summary configuration.

since: 3.26

###### e_book_cache_new_full

Creates a new `EBookCache` with the given or the default summary configuration.

since: 3.26

#### Instance methods

###### e_book_cache_contains_email

Checks whether contains an `email_address`. When the `email_address` contains multiple addresses, then returns `TRUE` when at least one address exists in the cache.

since: 3.44

###### e_book_cache_count_query

Counts how many contacts satisfy the `sexp`.

since: 3.50

###### e_book_cache_cursor_calculate

Calculates the `out_total` amount of results for the `cursor`‘s query expression, as well as the current `out_position` of `cursor` in the results. The `out_position` is represented as the amount of results which lead up to the current value of `cursor`, if `cursor` currently points to an exact contact, the position also includes the cursor contact.

since: 3.26

###### e_book_cache_cursor_compare_contact

Compares `contact` with `cursor` and returns whether `contact` is less than, equal to, or greater than `cursor`.

since: 3.26

###### e_book_cache_cursor_free

Frees the `cursor`, previously allocated with e_book_cache_cursor_new().

since: 3.26

###### e_book_cache_cursor_set_sexp

Modifies the current query expression for `cursor`. This will not modify `cursor`‘s state, but will change the outcome of any further calls to `e_book_cache_cursor_step()` or e_book_cache_cursor_calculate().

since: 3.26

###### e_book_cache_cursor_set_target_alphabetic_index

Sets the `cursor` position to an Alphabetic Index into the alphabet active in `book_cache`‘s locale.

since: 3.26

###### e_book_cache_cursor_step

Steps `cursor` through its sorted query by a maximum of `count` contacts starting from `origin`.

since: 3.26

###### e_book_cache_dup_categories

Returns a comma-separated list of categories used by the contacts stored in the `book_cache`. Free the returned string with g_free(), when no longer needed.

since: 3.48

###### e_book_cache_dup_contact_revision

Returns the `contact` revision, used to detect changes. The returned string should be freed with g_free(), when no longer needed.

since: 3.26

###### e_book_cache_dup_locale

No description available.

since: 3.26

###### e_book_cache_dup_query_contacts

Queries the `book_cache` for the contacts in the given range and order. The `sort_field` should be in the summary, otherwise an error is returned.

since: 3.50

###### e_book_cache_dup_query_field

Queries the `book_cache` for a `summary_field` value for contacts in the given range and order. To get complete contacts use e_book_cache_dup_query_contacts(). Note the field value may not correspond precisely to the value stored in the vCard (it can be in lower case).

since: 3.50

###### e_book_cache_dup_summary_field

Queries the `book_cache` for a `summary_field` value for contact with UID `uid`. Note the field value may not correspond precisely to the value stored in the vCard (it can be in lower case).

since: 3.50

###### e_book_cache_get_contact

Fetch the `EContact` specified by `uid` in `book_cache`.

since: 3.26

###### e_book_cache_get_contact_custom_flags

Gets the custom flags previously set for the `uid`, either with e_book_cache_set_contact_custom_flags(), when adding contacts or when removing contacts in offline.

since: 3.34

###### e_book_cache_get_contact_extra

Fetches the extra data previously set for `uid`, either with `e_book_cache_set_contact_extra()` or when adding contacts.

since: 3.26

###### e_book_cache_get_uids_with_extra

Gets all the UID-s the `extra` data is set for.

since: 3.26

###### e_book_cache_get_vcard

Fetch a vCard string for `uid` in `book_cache`.

since: 3.26

###### e_book_cache_put_contact

This is a convenience wrapper for e_book_cache_put_contacts(), which is the preferred way to add or modify multiple contacts when possible.

since: 3.26

###### e_book_cache_put_contacts

Adds or replaces contacts in `book_cache`.

since: 3.26

###### e_book_cache_ref_collator

References the currently active `ECollator` for `book_cache`, use `e_collator_unref()` when finished using the returned collator.

since: 3.26

###### e_book_cache_ref_source

References the `ESource` to which `book_cache` is paired, use `g_object_unref()` when no longer needed. It can be `NULL` in some cases, like when running tests.

since: 3.26

###### e_book_cache_remove_contact

Removes the contact identified by `uid` from `book_cache`.

since: 3.26

###### e_book_cache_remove_contacts

Removes the contacts indicated by `uids` from `book_cache`. The `custom_flags` is used, if not `NULL`, only if the `offline_flag` is `E_CACHE_IS_OFFLINE`. Otherwise it’s ignored. The length of the `custom_flags` should match the length of `uids`, when not `NULL`.

since: 3.26

###### e_book_cache_search

Searches `book_cache` for contacts matching the search expression `sexp`.

since: 3.26

###### e_book_cache_search_uids

Similar to e_book_cache_search(), but fetches only a list of contact UIDs.

since: 3.26

###### e_book_cache_search_with_callback

Similar to e_book_cache_search(), but calls the `func` for each found contact.

since: 3.26

###### e_book_cache_set_contact_custom_flags

Sets or replaces the custom flags associated with a contact identified by the `uid`.

since: 3.34

###### e_book_cache_set_contact_extra

Sets or replaces the extra data associated with `uid`.

since: 3.26

###### e_book_cache_set_locale

Relocalizes any locale specific data in the specified new `lc_collate` locale.

since: 3.26

##### Methods inherited from ECache (37)

Please see ECache for a full list of methods.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from EExtensible (3)

###### e_extensible_list_extensions

Returns a list of `EExtension` objects bound to `extensible` whose types are ancestors of `extension_type`. For a complete list of extension objects bound to `extensible`, pass `E_TYPE_EXTENSION`.

###### e_extensible_load_extensions

Creates an instance of all instantiable subtypes of `EExtension` which target the class of `extensible`. The lifetimes of these newly created `EExtension` objects are bound to `extensible` such that they are finalized when `extensible` is finalized.

###### e_extensible_reload_extensions

Similar to e_extensible_load_extensions(), only loads newly discovered extensions again. This can help in case a new module had been loaded to the process, which provides the extensions for the `extensible`.

#### Properties

###### EDataBook.BookCache:locale

The locale currently being used.

#### Signals

###### EDataBook.BookCache::categories-changed

No description available.

###### EDataBook.BookCache::dup-contact-revision

No description available.

###### EDataBook.BookCache::e164-changed

No description available.

##### Signals inherited from ECache (3)

###### ECache::before-put

No description available.

###### ECache::before-remove

No description available.

###### ECache::revision-changed

No description available.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct EDataBookBookCacheClass {
      void (* e164_changed) (
        EBookCache* book_cache,
        EContact* contact,
        gboolean is_replace
      );
      gchar* (* dup_contact_revision) (
        EBookCache* book_cache,
        EContact* contact
      );
      void (* categories_changed) (
        EBookCache* book_cache,
        const gchar* categories
      );

    }

Class structure for the `EBookCache` class.

###### Class members

`e164_changed: void (* e164_changed) ( EBookCache* book_cache, EContact* contact, gboolean is_replace )`

  No description available.

`dup_contact_revision: gchar* (* dup_contact_revision) ( EBookCache* book_cache, EContact* contact )`

  No description available.

`categories_changed: void (* categories_changed) ( EBookCache* book_cache, const gchar* categories )`

  No description available.

#### Virtual methods

###### EDataBook.BookCacheClass.categories_changed

No description available.

###### EDataBook.BookCacheClass.dup_contact_revision

Returns the `contact` revision, used to detect changes. The returned string should be freed with g_free(), when no longer needed.

since: 3.26

###### EDataBook.BookCacheClass.e164_changed

No description available.