|  |  |  | Evolution API Reference: libedata-book, the Addressbook backend library |  | 
|---|---|---|---|---|
struct EBookBackend; gboolean e_book_backend_construct (EBookBackend *backend); GNOME_Evolution_Addressbook_CallStatus e_book_backend_load_source (EBookBackend *backend, ESource *source, gboolean only_if_exists); ESource* e_book_backend_get_source (EBookBackend *backend); gboolean e_book_backend_add_client (EBookBackend *backend, EDataBook *book); void e_book_backend_remove_client (EBookBackend *backend, EDataBook *book); gboolean e_book_backend_has_out_of_proc_clients (EBookBackend *backend); char* e_book_backend_get_static_capabilities (EBookBackend *backend); gboolean e_book_backend_is_loaded (EBookBackend *backend); gboolean e_book_backend_is_writable (EBookBackend *backend); gboolean e_book_backend_is_removed (EBookBackend *backend); void e_book_backend_open (EBookBackend *backend, EDataBook *book, guint32 opid, gboolean only_if_exists); void e_book_backend_remove (EBookBackend *backend, EDataBook *book, guint32 opid); void e_book_backend_create_contact (EBookBackend *backend, EDataBook *book, guint32 opid, const char *vcard); void e_book_backend_remove_contacts (EBookBackend *backend, EDataBook *book, guint32 opid, GList *id_list); void e_book_backend_modify_contact (EBookBackend *backend, EDataBook *book, guint32 opid, const char *vcard); void e_book_backend_get_contact (EBookBackend *backend, EDataBook *book, guint32 opid, const char *id); void e_book_backend_get_contact_list (EBookBackend *backend, EDataBook *book, guint32 opid, const char *query); void e_book_backend_get_changes (EBookBackend *backend, EDataBook *book, guint32 opid, const char *change_id); void e_book_backend_authenticate_user (EBookBackend *backend, EDataBook *book, guint32 opid, const char *user, const char *passwd, const char *auth_method); void e_book_backend_get_supported_fields (EBookBackend *backend, EDataBook *book, guint32 opid); void e_book_backend_get_required_fields (EBookBackend *backend, EDataBook *book, guint32 opid); void e_book_backend_get_supported_auth_methods (EBookBackend *backend, EDataBook *book, guint32 opid); GNOME_Evolution_Addressbook_CallStatus e_book_backend_cancel_operation (EBookBackend *backend, EDataBook *book); void e_book_backend_set_mode (EBookBackend *backend, GNOME_Evolution_Addressbook_BookMode mode); void e_book_backend_start_book_view (EBookBackend *backend, EDataBookView *view); void e_book_backend_stop_book_view (EBookBackend *backend, EDataBookView *view); void e_book_backend_add_book_view (EBookBackend *backend, EDataBookView *view); void e_book_backend_remove_book_view (EBookBackend *backend, EDataBookView *view); EList* e_book_backend_get_book_views (EBookBackend *backend); void e_book_backend_notify_update (EBookBackend *backend, EContact *contact); void e_book_backend_notify_remove (EBookBackend *backend, const char *id); void e_book_backend_notify_complete (EBookBackend *backend); void e_book_backend_notify_writable (EBookBackend *backend, gboolean is_writable); void e_book_backend_notify_connection_status (EBookBackend *backend, gboolean is_online); void e_book_backend_notify_auth_required (EBookBackend *backend); void e_book_backend_sync (EBookBackend *backend); void e_book_backend_set_is_loaded (EBookBackend *backend, gboolean is_loaded); void e_book_backend_set_is_writable (EBookBackend *backend, gboolean is_writable); void e_book_backend_set_is_removed (EBookBackend *backend, gboolean is_removed); GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_add_new (const char *vcard); GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_modify_new (const char *vcard); GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_delete_new (const char *id); struct EBookBackendClass;
gboolean e_book_backend_construct (EBookBackend *backend);
Does nothing.
| backend: | an EBookBackend | 
| Returns : | TRUE. | 
GNOME_Evolution_Addressbook_CallStatus e_book_backend_load_source
                                                        (EBookBackend *backend,
                                                         ESource *source,
                                                         gboolean only_if_exists);
Loads source into backend.
| backend: | an EBookBackend | 
| source: | an ESource to load | 
| only_if_exists: | TRUEto prevent the creation of a new book | 
| Returns : | A GNOME_Evolution_Addressbook_CallStatus indicating the outcome. | 
ESource* e_book_backend_get_source (EBookBackend *backend);
Queries the source that an addressbook backend is serving.
| backend: | An addressbook backend. | 
| Returns : | ESource for the backend. | 
gboolean e_book_backend_add_client (EBookBackend *backend, EDataBook *book);
Adds a client to an addressbook backend.
| backend: | An addressbook backend. | 
| book: | the corba object representing the client connection. | 
| Returns : | TRUE on success, FALSE on failure to add the client. | 
void e_book_backend_remove_client (EBookBackend *backend, EDataBook *book);
Removes book from the list of backend's clients.
| backend: | an EBookBackend | 
| book: | an EDataBook to remove | 
gboolean e_book_backend_has_out_of_proc_clients (EBookBackend *backend);
Checks if backend has clients running in other system processes.
| backend: | an EBookBackend | 
| Returns : | TRUEif there are clients in other processes,FALSEotherwise. | 
char*               e_book_backend_get_static_capabilities
                                                        (EBookBackend *backend);
Gets the capabilities offered by this backend.
| backend: | an EBookBackend | 
| Returns : | A string listing the capabilities. | 
gboolean e_book_backend_is_loaded (EBookBackend *backend);
Checks if backend's storage has been opened and the backend
itself is ready for accessing.
| backend: | an EBookBackend | 
| Returns : | TRUEif loaded,FALSEotherwise. | 
gboolean e_book_backend_is_writable (EBookBackend *backend);
Checks if we can write to backend.
| backend: | an EBookBackend | 
| Returns : | TRUEif writeable,FALSEif not. | 
gboolean e_book_backend_is_removed (EBookBackend *backend);
Checks if backend has been removed from its physical storage.
| backend: | an EBookBackend | 
| Returns : | TRUEifbackendhas been removed,FALSEotherwise. | 
void e_book_backend_open (EBookBackend *backend, EDataBook *book, guint32 opid, gboolean only_if_exists);
Executes an 'open' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
| only_if_exists: | TRUEto prevent the creation of a new book | 
void e_book_backend_remove (EBookBackend *backend, EDataBook *book, guint32 opid);
Executes a 'remove' request to remove all of backend's data,
specified by opid on book.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
void e_book_backend_create_contact (EBookBackend *backend, EDataBook *book, guint32 opid, const char *vcard);
Executes a 'create contact' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
| vcard: | the VCard to add | 
void e_book_backend_remove_contacts (EBookBackend *backend, EDataBook *book, guint32 opid, GList *id_list);
Executes a 'remove contacts' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
| id_list: | list of string IDs to remove | 
void e_book_backend_modify_contact (EBookBackend *backend, EDataBook *book, guint32 opid, const char *vcard);
Executes a 'modify contact' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
| vcard: | the VCard to update | 
void e_book_backend_get_contact (EBookBackend *backend, EDataBook *book, guint32 opid, const char *id);
Executes a 'get contact' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
| id: | the ID of the contact to get | 
void e_book_backend_get_contact_list (EBookBackend *backend, EDataBook *book, guint32 opid, const char *query);
Executes a 'get contact list' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
| query: | the s-expression to match | 
void e_book_backend_get_changes (EBookBackend *backend, EDataBook *book, guint32 opid, const char *change_id);
Executes a 'get changes' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
| change_id: | the ID of the changeset | 
void e_book_backend_authenticate_user (EBookBackend *backend, EDataBook *book, guint32 opid, const char *user, const char *passwd, const char *auth_method);
Executes an 'authenticate' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
| user: | the name of the user account | 
| passwd: | the user's password | 
| auth_method: | the authentication method to use | 
void e_book_backend_get_supported_fields (EBookBackend *backend, EDataBook *book, guint32 opid);
Executes a 'get supported fields' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
void e_book_backend_get_required_fields (EBookBackend *backend, EDataBook *book, guint32 opid);
Executes a 'get required fields' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
void                e_book_backend_get_supported_auth_methods
                                                        (EBookBackend *backend,
                                                         EDataBook *book,
                                                         guint32 opid);
Executes a 'get supported auth methods' request specified by opid on book
using backend.
| backend: | an EBookBackend | 
| book: | an EDataBook | 
| opid: | the ID to use for this operation | 
GNOME_Evolution_Addressbook_CallStatus e_book_backend_cancel_operation
                                                        (EBookBackend *backend,
                                                         EDataBook *book);
Cancel book's running operation on backend.
| backend: | an EBookBackend | 
| book: | an EDataBook whose operation should be cancelled | 
| Returns : | A GNOME_Evolution_Addressbook_CallStatus indicating the outcome. | 
void e_book_backend_set_mode (EBookBackend *backend, GNOME_Evolution_Addressbook_BookMode mode);
Sets backend's online/offline mode to mode. Mode can be 1 for offline
or 2 indicating that it is connected and online.
| backend: | an EBookbackend | 
| mode: | a mode indicating the online/offline status of the backend | 
void e_book_backend_start_book_view (EBookBackend *backend, EDataBookView *view);
Starts running the query specified by book_view, emitting
signals for matching contacts.
| backend: | an EBookBackend | 
| view: | 
void e_book_backend_stop_book_view (EBookBackend *backend, EDataBookView *view);
Stops running the query specified by book_view, emitting
no more signals.
| backend: | an EBookBackend | 
| view: | 
void e_book_backend_add_book_view (EBookBackend *backend, EDataBookView *view);
Adds view to backend for querying.
| backend: | an EBookBackend | 
| view: | an EDataBookView | 
void e_book_backend_remove_book_view (EBookBackend *backend, EDataBookView *view);
Removes view from backend.
| backend: | an EBookBackend | 
| view: | an EDataBookView | 
EList* e_book_backend_get_book_views (EBookBackend *backend);
Gets the list of EDataBookView views running on this backend.
| backend: | an EBookBackend | 
| Returns : | An EList of EDataBookView objects. | 
void e_book_backend_notify_update (EBookBackend *backend, EContact *contact);
Notifies all of backend's book views about the new or modified
contacts contact.
e_data_book_respond_create() and e_data_book_respond_modify() call this
function for you. You only need to call this from your backend if
contacts are created or modified by another (non-PAS-using) client.
| backend: | an EBookBackend | 
| contact: | a new or modified contact | 
void e_book_backend_notify_remove (EBookBackend *backend, const char *id);
Notifies all of backend's book views that the contact with UID
id has been removed.
e_data_book_respond_remove_contacts() calls this function for you. You
only need to call this from your backend if contacts are removed by
another (non-PAS-using) client.
| backend: | an EBookBackend | 
| id: | a contact id | 
void e_book_backend_notify_complete (EBookBackend *backend);
Notifies all of backend's book views that the current set of
notifications is complete; use this after a series of
e_book_backend_notify_update() and e_book_backend_notify_remove() calls.
| backend: | an EBookbackend | 
void e_book_backend_notify_writable (EBookBackend *backend, gboolean is_writable);
Notifies all backends clients about the current writable state.
| backend: | an EBookBackend | 
| is_writable: | flag indicating writable status | 
void                e_book_backend_notify_connection_status
                                                        (EBookBackend *backend,
                                                         gboolean is_online);
Notifies clients of backend's connection status indicated by is_online.
Meant to be used by backend implementations.
| backend: | an EBookBackend | 
| is_online: | flag indicating whether backendis connected and online | 
void e_book_backend_notify_auth_required (EBookBackend *backend);
Notifies clients that backend requires authentication in order to
connect. Means to be used by backend implementations.
| backend: | an EBookBackend | 
void e_book_backend_sync (EBookBackend *backend);
Write all pending data to disk. This is only required under special circumstances (for example before a live backup) and should not be used in normal use.
| backend: | an EBookbackend | 
void e_book_backend_set_is_loaded (EBookBackend *backend, gboolean is_loaded);
Sets the flag indicating whether backend is loaded to is_loaded.
Meant to be used by backend implementations.
| backend: | an EBookBackend | 
| is_loaded: | A flag indicating whether the backend is loaded | 
void e_book_backend_set_is_writable (EBookBackend *backend, gboolean is_writable);
Sets the flag indicating whether backend is writeable to is_writeable.
Meant to be used by backend implementations.
| backend: | an EBookBackend | 
| is_writable: | A flag indicating whether the backend is writeable | 
void e_book_backend_set_is_removed (EBookBackend *backend, gboolean is_removed);
Sets the flag indicating whether backend was removed to is_removed.
Meant to be used by backend implementations.
| backend: | an EBookBackend | 
| is_removed: | A flag indicating whether the backend's storage was removed | 
GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_add_new
                                                        (const char *vcard);
Creates a new change item indicating vcard was added.
Meant to be used by backend implementations.
| vcard: | a VCard string | 
| Returns : | A new GNOME_Evolution_Addressbook_BookChangeItem. | 
GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_modify_new
                                                        (const char *vcard);
Creates a new change item indicating vcard was modified.
Meant to be used by backend implementations.
| vcard: | a VCard string | 
| Returns : | A new GNOME_Evolution_Addressbook_BookChangeItem. | 
GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_delete_new
                                                        (const char *id);
Creates a new change item indicating vcard was deleted.
Meant to be used by backend implementations.
| id: | |
| Returns : | A new GNOME_Evolution_Addressbook_BookChangeItem. | 
struct EBookBackendClass {
	GObjectClass parent_class;
	/* Virtual methods */
	GNOME_Evolution_Addressbook_CallStatus (*load_source) (EBookBackend *backend, ESource *source, gboolean only_if_exists);
	void (*remove) (EBookBackend *backend, EDataBook *book, guint32 opid);
        char *(*get_static_capabilities) (EBookBackend *backend);
	void (*create_contact)  (EBookBackend *backend, EDataBook *book, guint32 opid, const char *vcard);
	void (*remove_contacts) (EBookBackend *backend, EDataBook *book, guint32 opid, GList *id_list);
	void (*modify_contact)  (EBookBackend *backend, EDataBook *book, guint32 opid, const char *vcard);
	void (*get_contact) (EBookBackend *backend, EDataBook *book, guint32 opid, const char *id);
	void (*get_contact_list) (EBookBackend *backend, EDataBook *book, guint32 opid, const char *query);
	void (*start_book_view) (EBookBackend *backend, EDataBookView *book_view);
	void (*stop_book_view) (EBookBackend *backend, EDataBookView *book_view);
	void (*get_changes) (EBookBackend *backend, EDataBook *book, guint32 opid, const char *change_id);
	void (*authenticate_user) (EBookBackend *backend, EDataBook *book, guint32 opid, const char *user, const char *passwd, const char *auth_method);
	void (*get_required_fields) (EBookBackend *backend, EDataBook *bokk, guint32 opid);
	void (*get_supported_fields) (EBookBackend *backend, EDataBook *book, guint32 opid);
	void (*get_supported_auth_methods) (EBookBackend *backend, EDataBook *book, guint32 opid);
	GNOME_Evolution_Addressbook_CallStatus (*cancel_operation) (EBookBackend *backend, EDataBook *book);
	void (*set_mode) (EBookBackend *backend, GNOME_Evolution_Addressbook_BookMode  mode);
	/* Notification signals */
	void (* last_client_gone) (EBookBackend *backend);
	void (*sync) (EBookBackend *backend);
	/* Padding for future expansion */
	void (*_pas_reserved1) (void);
	void (*_pas_reserved2) (void);
	void (*_pas_reserved3) (void);
	void (*_pas_reserved4) (void);
};
"last-client-gone" signalvoid user_function (EBookBackend *ebookbackend, gpointer user_data) : Run First
| ebookbackend: | the object which received the signal. | 
| user_data: | user data set when the signal handler was connected. |