## EBookBackendSync

EBookBackendSync

## Synopsis

    struct              EBookBackendSync;
    gboolean            e_book_backend_sync_construct       (EBookBackendSync *backend);
    void                e_book_backend_sync_remove          (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GError **perror);
    void                e_book_backend_sync_create_contact  (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *vcard,
                                                             EContact **contact,
                                                             GError **perror);
    void                e_book_backend_sync_remove_contacts (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList *id_list,
                                                             GList **removed_ids,
                                                             GError **perror);
    void                e_book_backend_sync_modify_contact  (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *vcard,
                                                             EContact **contact,
                                                             GError **perror);
    void                e_book_backend_sync_get_contact     (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *id,
                                                             gchar **vcard,
                                                             GError **perror);
    void                e_book_backend_sync_get_contact_list
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *query,
                                                             GList **contacts,
                                                             GError **perror);
    void                e_book_backend_sync_get_changes     (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *change_id,
                                                             GList **changes,
                                                             GError **perror);
    void                e_book_backend_sync_authenticate_user
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *user,
                                                             const gchar *passwd,
                                                             const gchar *auth_method,
                                                             GError **perror);
    void                e_book_backend_sync_get_required_fields
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **fields,
                                                             GError **perror);
    void                e_book_backend_sync_get_supported_fields
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **fields,
                                                             GError **perror);
    void                e_book_backend_sync_get_supported_auth_methods
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **methods,
                                                             GError **perror);

## Object Hierarchy

      GObject
       +----EBookBackend
             +----EBookBackendSync

## Description

## Details

### struct EBookBackendSync

    struct EBookBackendSync;

### e_book_backend_sync_construct ()

    gboolean            e_book_backend_sync_construct       (EBookBackendSync *backend);

Does nothing.

`backend` : | an EBookBackendSync
Returns : | `TRUE`.

### e_book_backend_sync_remove ()

    void                e_book_backend_sync_remove          (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GError **perror);

Remove `book`'s database and storage overhead from the storage medium. This will delete all contacts in `book`.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`perror` : |

### e_book_backend_sync_create_contact ()

    void                e_book_backend_sync_create_contact  (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *vcard,
                                                             EContact **contact,
                                                             GError **perror);

Creates a new contact with the contents of `vcard` in `backend`.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`vcard` : | a VCard representation of a contact
`contact` : | a pointer to a location to store the resulting EContact
`perror` : |

### e_book_backend_sync_remove_contacts ()

    void                e_book_backend_sync_remove_contacts (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList *id_list,
                                                             GList **removed_ids,
                                                             GError **perror);

Removes the contacts specified by `id_list` from `backend`. The returned list of removed contacts is in the same format as the passed-in list, and must be freed by the caller.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`id_list` : | a GList of pointers to unique contact ID strings
`removed_ids` : | a pointer to a location to store a list of the contacts actually removed
`perror` : |

### e_book_backend_sync_modify_contact ()

    void                e_book_backend_sync_modify_contact  (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *vcard,
                                                             EContact **contact,
                                                             GError **perror);

Modifies the contact specified by the ID embedded in `vcard`, to reflect the full contents of `vcard`.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`vcard` : | the string representation of a contact
`contact` : | a pointer to a location to store the resulting EContact
`perror` : |

### e_book_backend_sync_get_contact ()

    void                e_book_backend_sync_get_contact     (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *id,
                                                             gchar **vcard,
                                                             GError **perror);

Gets a contact from `book`.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`id` : | a unique contact ID
`vcard` : | a pointer to a location to store the resulting VCard string
`perror` : |

### e_book_backend_sync_get_contact_list ()

    void                e_book_backend_sync_get_contact_list
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *query,
                                                             GList **contacts,
                                                             GError **perror);

Gets a list of contacts from `book`. The list and its elements must be freed by the caller.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`query` : | an s-expression of the query to perform
`contacts` : | a pointer to a location to store the resulting list of VCard strings
`perror` : |

### e_book_backend_sync_get_changes ()

    void                e_book_backend_sync_get_changes     (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *change_id,
                                                             GList **changes,
                                                             GError **perror);

Gets the changes made to `book` since the last call to this function. The returned list will contain items of CORBA type EDataBookChange.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`change_id` : | a unique changes ID
`changes` : | a pointer to a location to store the resulting list of changes
`perror` : |

### e_book_backend_sync_authenticate_user ()

    void                e_book_backend_sync_authenticate_user
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const gchar *user,
                                                             const gchar *passwd,
                                                             const gchar *auth_method,
                                                             GError **perror);

Authenticates `user` against `book`.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`user` : | the user's name
`passwd` : | the user's password
`auth_method` : | the authentication method desired
`perror` : |

### e_book_backend_sync_get_required_fields ()

    void                e_book_backend_sync_get_required_fields
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **fields,
                                                             GError **perror);

Gets a list of the fields required for all contacts in `book`. The fields are represented by strings from e_contact_field_name. The list and its contents must be freed by the caller.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`fields` : | a pointer to a location to store the fields
`perror` : |

### e_book_backend_sync_get_supported_fields ()

    void                e_book_backend_sync_get_supported_fields
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **fields,
                                                             GError **perror);

Gets a list of the fields supported for contacts in `book`. Other fields may not be stored. The fields are represented by strings from e_contact_field_name. The list and its contents must be freed by the caller.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`fields` : | a pointer to a location to store the fields
`perror` : |

### e_book_backend_sync_get_supported_auth_methods ()

    void                e_book_backend_sync_get_supported_auth_methods
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **methods,
                                                             GError **perror);

Gets a list of the authentication methods supported by `book`. The methods are represented by strings. The list and its contents must be freed by the caller.

`backend` : | an EBookBackendSync
`book` : | an EDataBook
`opid` : | the unique ID of the operation
`methods` : | a pointer to a location to store the methods
`perror` : |