Merging Contacts

Merging Contacts — Functionality for merging contacts.

Synopsis

void                (*OssoABookMergeWithCb)             (const char *uid,
                                                         gpointer user_data);
OssoABookContact*   osso_abook_merge_contacts           (GList *contacts,
                                                         GtkWindow *parent);
void                osso_abook_merge_contacts_and_save  (GList *contacts,
                                                         GtkWindow *parent,
                                                         OssoABookMergeWithCb cb,
                                                         gpointer user_data);
void                osso_abook_merge_with_dialog        (OssoABookContact *contact,
                                                         OssoABookContactModel *model,
                                                         GtkWindow *parent,
                                                         OssoABookMergeWithCb cb,
                                                         gpointer user_data);
void                osso_abook_merge_with_many_dialog   (OssoABookContact *contact,
                                                         OssoABookContactModel *model,
                                                         GtkWindow *parent,
                                                         OssoABookMergeWithCb cb,
                                                         gpointer user_data);

Description

Functions that merge contacts together and deal with conflict resolution by presenting the user a dialog.

Details

OssoABookMergeWithCb ()

void                (*OssoABookMergeWithCb)             (const char *uid,
                                                         gpointer user_data);

The type of callback used with osso_abook_merge_with_dialog()

uid : the uid of the newly-merged contact
user_data : the data registered with osso_abook_merge_with_dialog()

osso_abook_merge_contacts ()

OssoABookContact*   osso_abook_merge_contacts           (GList *contacts,
                                                         GtkWindow *parent);

Merge all of the contacts provided into a single contact. If there are any conflicts in the name, then a dialog is shown so that the user can set the final name.

Note that the returned OssoABookContact is not committed to the address book and the previous contacts are not removed from it. If you want a function that takes case of this too see osso_abook_merge_contacts_and_save().

contacts : a GList of OssoABookContact objects
parent : an optional parent GtkWindow
Returns : a new OssoABookContact.

osso_abook_merge_contacts_and_save ()

void                osso_abook_merge_contacts_and_save  (GList *contacts,
                                                         GtkWindow *parent,
                                                         OssoABookMergeWithCb cb,
                                                         gpointer user_data);

Merge all of the contacts provided into a single contact and commit the result, removing the old contacts from the address book. If there are any conflicts in the name, then a dialog is shown so that the user can set the final name.

When the merge is complete, cb will be called with the new uid for the merged contact. If the merge fail or is cancelled the UID will be set to NULL.

contacts : a GList of OssoABookContact objects
parent : an optional parent GtkWindow
cb : A function to be called when the merge is complete
user_data : data to be passed to cb

osso_abook_merge_with_dialog ()

void                osso_abook_merge_with_dialog        (OssoABookContact *contact,
                                                         OssoABookContactModel *model,
                                                         GtkWindow *parent,
                                                         OssoABookMergeWithCb cb,
                                                         gpointer user_data);

This function presents a contact chooser to the user from which they can select another contact to merge with contact. If there are conflicts, a dialog will be shown so the user can resolve them.

When the merge is complete, cb will be called with the new uid for the merged contact.

contact : the contact to be merged
contact_model : an optional OssoABookContactModel from which to present a list of potential contacts to merge with
parent : an optional parent GtkWindow
cb : A function to be called when the merge is complete
user_data : data to be passed to cb

osso_abook_merge_with_many_dialog ()

void                osso_abook_merge_with_many_dialog   (OssoABookContact *contact,
                                                         OssoABookContactModel *model,
                                                         GtkWindow *parent,
                                                         OssoABookMergeWithCb cb,
                                                         gpointer user_data);

This function presents a contact chooser to the user from which they can select other contacts to merge with contact. If there are conflicts, a dialog will be shown so the user can resolve them.

When the merge is complete, cb will be called with the new uid for the merged contact.

When starting a merge operation from an OssoABookTouchContactStarter use osso_abook_touch_contact_starter_start_merge() instead.

contact : the contact to be merged
contact_model : an optional OssoABookContactModel from which to present a list of potential contacts to merge with
parent : an optional parent GtkWindow
cb : A function to be called when the merge is complete
user_data : data to be passed to cb