EBookBackendSync
3
LIBEDATA-BOOK Library

# EBookBackendSync

## Synopsis

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

## Object Hierarchy

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

## Description

## Details

### EBookBackendSyncStatus

    typedef GNOME_Evolution_Addressbook_CallStatus EBookBackendSyncStatus;

### 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 ()

    EBookBackendSyncStatus e_book_backend_sync_remove       (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_create_contact ()

    EBookBackendSyncStatus e_book_backend_sync_create_contact
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const char *vcard,
                                                             EContact **contact);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_remove_contacts ()

    EBookBackendSyncStatus e_book_backend_sync_remove_contacts
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList *id_list,
                                                             GList **removed_ids);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_modify_contact ()

    EBookBackendSyncStatus e_book_backend_sync_modify_contact
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const char *vcard,
                                                             EContact **contact);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_get_contact ()

    EBookBackendSyncStatus e_book_backend_sync_get_contact  (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const char *id,
                                                             char **vcard);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_get_contact_list ()

    EBookBackendSyncStatus e_book_backend_sync_get_contact_list
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const char *query,
                                                             GList **contacts);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_get_changes ()

    EBookBackendSyncStatus e_book_backend_sync_get_changes  (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const char *change_id,
                                                             GList **changes);

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

`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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_authenticate_user ()

    EBookBackendSyncStatus e_book_backend_sync_authenticate_user
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             const char *user,
                                                             const char *passwd,
                                                             const char *auth_method);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_get_required_fields ()

    EBookBackendSyncStatus e_book_backend_sync_get_required_fields
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **fields);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_get_supported_fields ()

    EBookBackendSyncStatus e_book_backend_sync_get_supported_fields
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **fields);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.

### e_book_backend_sync_get_supported_auth_methods ()

    EBookBackendSyncStatus e_book_backend_sync_get_supported_auth_methods
                                                            (EBookBackendSync *backend,
                                                             EDataBook *book,
                                                             guint32 opid,
                                                             GList **methods);

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

Returns :

  An EBookBackendSyncStatus indicating the outcome of the operation.