[evolution-mapi] Adapt to EBookBackend API changes



commit c4ed1281a2bfe62f5ac4ca186da80dea0a1e742b
Author: Milan Crha <mcrha redhat com>
Date:   Mon Oct 10 13:41:46 2011 +0200

    Adapt to EBookBackend API changes

 src/addressbook/e-book-backend-mapi-contacts.c |   56 ++++++---
 src/addressbook/e-book-backend-mapi-gal.c      |    8 +-
 src/addressbook/e-book-backend-mapi.c          |  156 +++++++++++++-----------
 src/addressbook/e-book-backend-mapi.h          |    4 +-
 4 files changed, 126 insertions(+), 98 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-mapi-contacts.c b/src/addressbook/e-book-backend-mapi-contacts.c
index 753da97..c928939 100644
--- a/src/addressbook/e-book-backend-mapi-contacts.c
+++ b/src/addressbook/e-book-backend-mapi-contacts.c
@@ -720,7 +720,7 @@ ebbm_contacts_remove (EBookBackendMAPI *ebma, GCancellable *cancellable, GError
 }
 
 static void
-ebbm_contacts_create_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *vcard, EContact **contact, GError **error)
+ebbm_contacts_create_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *vcards, GSList **added_contacts, GError **error)
 {
 	EBookBackendMAPIContacts *ebmac;
 	EBookBackendMAPIContactsPrivate *priv;
@@ -729,11 +729,12 @@ ebbm_contacts_create_contact (EBookBackendMAPI *ebma, GCancellable *cancellable,
 	GError *mapi_error = NULL;
 	mapi_id_t mid;
 	gchar *id;
+	EContact *contact;
 
 	e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 	e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), E_DATA_BOOK_STATUS_INVALID_ARG);
-	e_return_data_book_error_if_fail (vcard != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
-	e_return_data_book_error_if_fail (contact != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+	e_return_data_book_error_if_fail (vcards != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+	e_return_data_book_error_if_fail (added_contacts != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
 	ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
 	e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
@@ -741,6 +742,11 @@ ebbm_contacts_create_contact (EBookBackendMAPI *ebma, GCancellable *cancellable,
 	priv = ebmac->priv;
 	e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
+	if (vcards->next) {
+		g_propagate_error (error, EDB_ERROR_EX (NOT_SUPPORTED, _("The backend does not support bulk additions")));
+		return;
+	}
+
 	e_book_backend_mapi_lock_connection (ebma);
 
 	conn = e_book_backend_mapi_get_connection (ebma);
@@ -750,15 +756,15 @@ ebbm_contacts_create_contact (EBookBackendMAPI *ebma, GCancellable *cancellable,
 		return;
 	}
 
-	*contact = e_contact_new_from_vcard (vcard);
-	if (!*contact) {
+	contact = e_contact_new_from_vcard (vcards->data);
+	if (!contact) {
 		g_propagate_error (error, EDB_ERROR (REPOSITORY_OFFLINE));
 		e_book_backend_mapi_unlock_connection (ebma);
 		return;
 	}
 
 	e_book_backend_mapi_get_db (ebma, &mcd.db);
-	mcd.contact = *contact;
+	mcd.contact = contact;
 
 	mid = exchange_mapi_connection_create_item (conn, olFolderContacts, priv->fid,
 		mapi_book_write_props, &mcd,
@@ -772,18 +778,19 @@ ebbm_contacts_create_contact (EBookBackendMAPI *ebma, GCancellable *cancellable,
 		if (mapi_error)
 			g_error_free (mapi_error);
 
-		g_object_unref (*contact);
-		*contact = NULL;
+		g_object_unref (contact);
 		return;
 	}
 
 	id = exchange_mapi_util_mapi_ids_to_uid (priv->fid, mid);
 
 	/* UID of the contact is nothing but the concatenated string of hex id of folder and the message.*/
-	e_contact_set (*contact, E_CONTACT_UID, id);
-	e_contact_set (*contact, E_CONTACT_BOOK_URI, e_book_backend_mapi_get_book_uri (ebma));
+	e_contact_set (contact, E_CONTACT_UID, id);
+	e_contact_set (contact, E_CONTACT_BOOK_URI, e_book_backend_mapi_get_book_uri (ebma));
 
 	g_free (id);
+
+	*added_contacts = g_slist_append (NULL, contact);
 }
 
 static void
@@ -849,19 +856,20 @@ ebbm_contacts_remove_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
 }
 
 static void
-ebbm_contacts_modify_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *vcard, EContact **contact, GError **error)
+ebbm_contacts_modify_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *vcards, GSList **modified_contacts, GError **error)
 {
 	EBookBackendMAPIContacts *ebmac;
 	EBookBackendMAPIContactsPrivate *priv;
 	ExchangeMapiConnection *conn;
 	MapiCreateitemData mcd;
+	EContact *contact;
 	GError *mapi_error = NULL;
 	mapi_id_t fid, mid;
 
 	e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 	e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), E_DATA_BOOK_STATUS_INVALID_ARG);
-	e_return_data_book_error_if_fail (vcard != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
-	e_return_data_book_error_if_fail (contact != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+	e_return_data_book_error_if_fail (vcards != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+	e_return_data_book_error_if_fail (modified_contacts != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
 	ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
 	e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
@@ -869,6 +877,11 @@ ebbm_contacts_modify_contact (EBookBackendMAPI *ebma, GCancellable *cancellable,
 	priv = ebmac->priv;
 	e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
+	if (vcards->next != NULL) {
+		g_propagate_error (error, EDB_ERROR_EX (NOT_SUPPORTED, _("The backend does not support bulk modifications")));
+		return;
+	}
+
 	e_book_backend_mapi_lock_connection (ebma);
 
 	conn = e_book_backend_mapi_get_connection (ebma);
@@ -878,17 +891,17 @@ ebbm_contacts_modify_contact (EBookBackendMAPI *ebma, GCancellable *cancellable,
 		return;
 	}
 
-	*contact = e_contact_new_from_vcard (vcard);
-	if (!*contact) {
+	contact = e_contact_new_from_vcard (vcards->data);
+	if (!contact) {
 		g_propagate_error (error, EDB_ERROR (REPOSITORY_OFFLINE));
 		e_book_backend_mapi_unlock_connection (ebma);
 		return;
 	}
 
 	e_book_backend_mapi_get_db (ebma, &mcd.db);
-	mcd.contact = *contact;
+	mcd.contact = contact;
 
-	exchange_mapi_util_mapi_ids_from_uid (e_contact_get_const (*contact, E_CONTACT_UID), &fid, &mid);
+	exchange_mapi_util_mapi_ids_from_uid (e_contact_get_const (contact, E_CONTACT_UID), &fid, &mid);
 
 	if (!exchange_mapi_connection_modify_item (conn, olFolderContacts, priv->fid, mid,
 		mapi_book_write_props, &mcd, NULL, NULL, NULL, priv->is_public_folder ? MAPI_OPTIONS_USE_PFSTORE : 0, &mapi_error)) {
@@ -897,8 +910,9 @@ ebbm_contacts_modify_contact (EBookBackendMAPI *ebma, GCancellable *cancellable,
 		if (mapi_error)
 			g_error_free (mapi_error);
 
-		g_object_unref (*contact);
-		*contact = NULL;
+		g_object_unref (contact);
+	} else {
+		*modified_contacts = g_slist_append (NULL, contact);
 	}
 
 	e_book_backend_mapi_unlock_connection (ebma);
@@ -1182,9 +1196,9 @@ e_book_backend_mapi_contacts_class_init (EBookBackendMAPIContactsClass *klass)
 	/* Set the virtual methods. */
 	parent_class->op_open				= ebbm_contacts_open;
 	parent_class->op_remove				= ebbm_contacts_remove;
-	parent_class->op_create_contact			= ebbm_contacts_create_contact;
+	parent_class->op_create_contacts		= ebbm_contacts_create_contacts;
 	parent_class->op_remove_contacts		= ebbm_contacts_remove_contacts;
-	parent_class->op_modify_contact			= ebbm_contacts_modify_contact;
+	parent_class->op_modify_contacts		= ebbm_contacts_modify_contacts;
 	parent_class->op_get_contact			= ebbm_contacts_get_contact;
 	parent_class->op_get_contact_list		= ebbm_contacts_get_contact_list;
 
diff --git a/src/addressbook/e-book-backend-mapi-gal.c b/src/addressbook/e-book-backend-mapi-gal.c
index 2c290e3..990e6e0 100644
--- a/src/addressbook/e-book-backend-mapi-gal.c
+++ b/src/addressbook/e-book-backend-mapi-gal.c
@@ -127,7 +127,7 @@ fetch_gal_uids_cb (ExchangeMapiConnection *conn, uint32_t row_index, uint32_t n_
 }
 
 static void
-ebbm_gal_create_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *vcard, EContact **contact, GError **error)
+ebbm_gal_create_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *vcards, GSList **added_contacts, GError **error)
 {
 	g_propagate_error (error, EDB_ERROR (PERMISSION_DENIED));
 }
@@ -139,7 +139,7 @@ ebbm_gal_remove_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable, con
 }
 
 static void
-ebbm_gal_modify_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *vcard, EContact **contact, GError **error)
+ebbm_gal_modify_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *vcards, GSList **modified_contacts, GError **error)
 {
 	g_propagate_error (error, EDB_ERROR (PERMISSION_DENIED));
 }
@@ -279,9 +279,9 @@ e_book_backend_mapi_gal_class_init (EBookBackendMAPIGALClass *klass)
 	parent_class = E_BOOK_BACKEND_MAPI_CLASS (klass);
 
 	/* Set the virtual methods. */
-	parent_class->op_create_contact		= ebbm_gal_create_contact;
+	parent_class->op_create_contacts	= ebbm_gal_create_contacts;
 	parent_class->op_remove_contacts	= ebbm_gal_remove_contacts;
-	parent_class->op_modify_contact		= ebbm_gal_modify_contact;
+	parent_class->op_modify_contacts	= ebbm_gal_modify_contacts;
 
 	parent_class->op_get_status_message	= ebbm_gal_get_status_message;
 	parent_class->op_fetch_contacts		= ebbm_gal_fetch_contacts;
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index abc27f3..563fefc 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -33,6 +33,7 @@
 #include <glib/gi18n-lib.h>
 
 #include <libebook/e-contact.h>
+#include <libedataserver/e-data-server-util.h>
 #include <camel/camel.h>
 
 #include <em-operation-queue.h>
@@ -783,9 +784,9 @@ typedef enum {
 	OP_OPEN,
 	OP_REMOVE,
 
-	OP_CREATE_CONTACT,
+	OP_CREATE_CONTACTS,
 	OP_REMOVE_CONTACTS,
-	OP_MODIFY_CONTACT,
+	OP_MODIFY_CONTACTS,
 	OP_GET_CONTACT,
 	OP_GET_CONTACT_LIST,
 	OP_START_BOOK_VIEW,
@@ -823,8 +824,8 @@ typedef struct {
 typedef struct {
 	OperationBase base;
 
-	GSList *id_list;
-} OperationIDList;
+	GSList *str_slist;
+} OperationStrSlist;
 
 typedef struct {
 	OperationBase base;
@@ -874,37 +875,40 @@ ebbm_operation_cb (OperationBase *op, gboolean cancelled, EBookBackend *backend)
 			e_data_book_respond_remove (op->book, op->opid, error);
 		}
 	} break;
-	case OP_CREATE_CONTACT: {
-		OperationStr *ops = (OperationStr *) op;
-		const gchar *vcard = ops->str;
+	case OP_CREATE_CONTACTS: {
+		OperationStrSlist *ops = (OperationStrSlist *) op;
 
 		if (!cancelled) {
-			EContact *contact = NULL;
+			GSList *added_contacts = NULL;
 
-			if (ebmac->op_create_contact)
-				ebmac->op_create_contact (ebma, op->cancellable, vcard, &contact, &error);
+			if (ebmac->op_create_contacts)
+				ebmac->op_create_contacts (ebma, op->cancellable, ops->str_slist, &added_contacts, &error);
 			else
 				error = EDB_ERROR (NOT_SUPPORTED);
 
-			if (contact && !error)
-				e_book_backend_mapi_notify_contact_update (ebma, NULL, contact, NULL, -1, -1, NULL);
+			if (added_contacts && !error) {
+				const GSList *l;
 
-			e_data_book_respond_create (op->book, op->opid, error, contact);
+				for (l = added_contacts; l; l = l->next) {
+					e_book_backend_mapi_notify_contact_update (ebma, NULL, E_CONTACT (l->data), NULL, -1, -1, NULL);
+				}
+			}
 
-			if (contact)
-				g_object_unref (contact);
+			e_data_book_respond_create_contacts (op->book, op->opid, error, added_contacts);
+
+			e_util_free_object_slist (added_contacts);
 		}
 
-		g_free (ops->str);
+		e_util_free_string_slist (ops->str_slist);
 	} break;
 	case OP_REMOVE_CONTACTS: {
-		OperationIDList *opil = (OperationIDList *) op;
+		OperationStrSlist *ops = (OperationStrSlist *) op;
 
 		if (!cancelled) {
 			GSList *removed_ids = NULL;
 
 			if (ebmac->op_remove_contacts)
-				ebmac->op_remove_contacts (ebma, op->cancellable, opil->id_list, &removed_ids, &error);
+				ebmac->op_remove_contacts (ebma, op->cancellable, ops->str_slist, &removed_ids, &error);
 			else
 				error = EDB_ERROR (NOT_SUPPORTED);
 
@@ -925,31 +929,33 @@ ebbm_operation_cb (OperationBase *op, gboolean cancelled, EBookBackend *backend)
 			g_slist_free (removed_ids);
 		}
 
-		g_slist_foreach (opil->id_list, (GFunc) g_free, NULL);
-		g_slist_free (opil->id_list);
+		e_util_free_string_slist (ops->str_slist);
 	} break;
-	case OP_MODIFY_CONTACT: {
-		OperationStr *ops = (OperationStr *) op;
-		const gchar *vcard = ops->str;
+	case OP_MODIFY_CONTACTS: {
+		OperationStrSlist *ops = (OperationStrSlist *) op;
 
 		if (!cancelled) {
-			EContact *contact = NULL;
+			GSList *modified_contacts = NULL;
 
-			if (ebmac->op_modify_contact)
-				ebmac->op_modify_contact (ebma, op->cancellable, vcard, &contact, &error);
+			if (ebmac->op_modify_contacts)
+				ebmac->op_modify_contacts (ebma, op->cancellable, ops->str_slist, &modified_contacts, &error);
 			else
 				error = EDB_ERROR (NOT_SUPPORTED);
 
-			if (contact && !error)
-				e_book_backend_mapi_notify_contact_update (ebma, NULL, contact, NULL, -1, -1, NULL);
+			if (modified_contacts && !error) {
+				const GSList *l;
+
+				for (l = modified_contacts; l; l = l->next) {
+					e_book_backend_mapi_notify_contact_update (ebma, NULL, E_CONTACT (l->data), NULL, -1, -1, NULL);
+				}
+			}
 
-			e_data_book_respond_modify (op->book, op->opid, error, contact);
+			e_data_book_respond_modify_contacts (op->book, op->opid, error, modified_contacts);
 
-			if (contact)
-				g_object_unref (contact);
+			e_util_free_object_slist (modified_contacts);
 		}
 
-		g_free (ops->str);
+		e_util_free_string_slist (ops->str_slist);
 	} break;
 	case OP_GET_CONTACT: {
 		OperationStr *ops = (OperationStr *) op;
@@ -1119,36 +1125,17 @@ str_op_abstract (EBookBackend *backend, EDataBook *book, guint32 opid, GCancella
 	em_operation_queue_push (priv->op_queue, op);
 }
 
-#define BASE_OP_DEF(_func, _ot)								\
-static void										\
-_func (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable)	\
-{											\
-	base_op_abstract (backend, book, opid, cancellable, _ot);			\
-}
-
-#define STR_OP_DEF(_func, _ot)							\
-static void									\
-_func (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *str)	\
-{										\
-	str_op_abstract (backend, book, opid, cancellable, str, _ot);		\
-}
-
-BASE_OP_DEF (ebbm_op_remove, OP_REMOVE)
-STR_OP_DEF  (ebbm_op_create_contact, OP_CREATE_CONTACT)
-STR_OP_DEF  (ebbm_op_modify_contact, OP_MODIFY_CONTACT)
-STR_OP_DEF  (ebbm_op_get_contact, OP_GET_CONTACT)
-STR_OP_DEF  (ebbm_op_get_contact_list, OP_GET_CONTACT_LIST)
-STR_OP_DEF  (ebbm_op_get_backend_property, OP_GET_BACKEND_PROPERTY)
-
 static void
-ebbm_op_open (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, gboolean only_if_exists)
+str_slist_op_abstract (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const GSList *str_slist, OperationType ot)
 {
-	OperationOpen *op;
+	OperationStrSlist *op;
 	EBookBackendMAPI *ebbm;
 	EBookBackendMAPIPrivate *priv;
+	GSList *l;
 
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_BOOK_BACKEND_MAPI (backend));
+	g_return_if_fail (str_slist != NULL);
 
 	ebbm = E_BOOK_BACKEND_MAPI (backend);
 	priv = ebbm->priv;
@@ -1160,27 +1147,58 @@ ebbm_op_open (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable
 	if (cancellable)
 		g_object_ref (cancellable);
 
-	op = g_new0 (OperationOpen, 1);
-	op->base.ot = OP_OPEN;
+	op = g_new0 (OperationStrSlist, 1);
+	op->base.ot = ot;
 	op->base.book = book;
 	op->base.opid = opid;
 	op->base.cancellable = cancellable;
-	op->only_if_exists = only_if_exists;
+	op->str_slist = g_slist_copy ((GSList *) str_slist);
+
+	for (l = op->str_slist; l; l = l->next) {
+		l->data = g_strdup (l->data);
+	}
 
 	em_operation_queue_push (priv->op_queue, op);
 }
 
+#define BASE_OP_DEF(_func, _ot)								\
+static void										\
+_func (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable)	\
+{											\
+	base_op_abstract (backend, book, opid, cancellable, _ot);			\
+}
+
+#define STR_OP_DEF(_func, _ot)							\
+static void									\
+_func (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *str)	\
+{										\
+	str_op_abstract (backend, book, opid, cancellable, str, _ot);		\
+}
+
+#define STR_SLIST_OP_DEF(_func, _ot)							\
+static void										\
+_func (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const GSList *str_slist)	\
+{											\
+	str_slist_op_abstract (backend, book, opid, cancellable, str_slist, _ot);	\
+}
+
+BASE_OP_DEF (ebbm_op_remove, OP_REMOVE)
+STR_SLIST_OP_DEF (ebbm_op_create_contacts, OP_CREATE_CONTACTS)
+STR_SLIST_OP_DEF (ebbm_op_modify_contacts, OP_MODIFY_CONTACTS)
+STR_SLIST_OP_DEF (ebbm_op_remove_contacts, OP_REMOVE_CONTACTS)
+STR_OP_DEF  (ebbm_op_get_contact, OP_GET_CONTACT)
+STR_OP_DEF  (ebbm_op_get_contact_list, OP_GET_CONTACT_LIST)
+STR_OP_DEF  (ebbm_op_get_backend_property, OP_GET_BACKEND_PROPERTY)
+
 static void
-ebbm_op_remove_contacts (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const GSList *id_list)
+ebbm_op_open (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, gboolean only_if_exists)
 {
-	OperationIDList *op;
+	OperationOpen *op;
 	EBookBackendMAPI *ebbm;
 	EBookBackendMAPIPrivate *priv;
-	GSList *l;
 
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_BOOK_BACKEND_MAPI (backend));
-	g_return_if_fail (id_list != NULL);
 
 	ebbm = E_BOOK_BACKEND_MAPI (backend);
 	priv = ebbm->priv;
@@ -1192,16 +1210,12 @@ ebbm_op_remove_contacts (EBookBackend *backend, EDataBook *book, guint32 opid, G
 	if (cancellable)
 		g_object_ref (cancellable);
 
-	op = g_new0 (OperationIDList, 1);
-	op->base.ot = OP_REMOVE_CONTACTS;
+	op = g_new0 (OperationOpen, 1);
+	op->base.ot = OP_OPEN;
 	op->base.book = book;
 	op->base.opid = opid;
 	op->base.cancellable = cancellable;
-	op->id_list = g_slist_copy ((GSList *) id_list);
-
-	for (l = op->id_list; l; l = l->next) {
-		l->data = g_strdup (l->data);
-	}
+	op->only_if_exists = only_if_exists;
 
 	em_operation_queue_push (priv->op_queue, op);
 }
@@ -1360,9 +1374,9 @@ e_book_backend_mapi_class_init (EBookBackendMAPIClass *klass)
 
 	backend_class->open			  = ebbm_op_open;
 	backend_class->remove			  = ebbm_op_remove;
-	backend_class->create_contact		  = ebbm_op_create_contact;
+	backend_class->create_contacts		  = ebbm_op_create_contacts;
 	backend_class->remove_contacts		  = ebbm_op_remove_contacts;
-	backend_class->modify_contact		  = ebbm_op_modify_contact;
+	backend_class->modify_contacts		  = ebbm_op_modify_contacts;
 	backend_class->get_contact                = ebbm_op_get_contact;
 	backend_class->get_contact_list           = ebbm_op_get_contact_list;
 	backend_class->start_book_view            = ebbm_op_start_book_view;
diff --git a/src/addressbook/e-book-backend-mapi.h b/src/addressbook/e-book-backend-mapi.h
index 3b33a1b..3ecb34d 100644
--- a/src/addressbook/e-book-backend-mapi.h
+++ b/src/addressbook/e-book-backend-mapi.h
@@ -57,9 +57,9 @@ typedef struct
 	void (*op_open) (EBookBackendMAPI *ebma, GCancellable *cancellable, gboolean only_if_exists, GError **error);
 	void (*op_remove) (EBookBackendMAPI *ebma, GCancellable *cancellable, GError **error);
 
-	void (*op_create_contact)  (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *vcard, EContact **contact, GError **error);
+	void (*op_create_contacts) (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *vcards, GSList **added_contacts, GError **error);
 	void (*op_remove_contacts) (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *id_list, GSList **removed_ids, GError **error);
-	void (*op_modify_contact)  (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *vcard, EContact **contact, GError **error);
+	void (*op_modify_contacts) (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *vcards, GSList **modified_contacts, GError **error);
 	void (*op_get_contact) (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *id, gchar **vcard, GError **error);
 	void (*op_get_contact_list) (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *query, GSList **vCards, GError **error);
 	void (*op_authenticate_user) (EBookBackendMAPI *ebma, GCancellable *cancellable, ECredentials *credentials, GError **error);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]