EContact utilities

EContact utilities — A Contact representation

Synopsis




GdkPixbuf*  osso_abook_contact_get_photo    (EContact *contact);
void        osso_abook_contact_set_photo    (EContact *contact,
                                             const char *filename,
                                             EBook *book);
GList*      osso_abook_contact_get_accounts (EContact *contact,
                                             OssoABookAccountTypeFlags flags);
GList*      osso_abook_contact_get_groups   (EContact *contact);
void        osso_abook_contact_add_group    (EContact *contact,
                                             OssoABookManualGroup *group,
                                             EBook *book);
void        osso_abook_contact_remove_group (EContact *contact,
                                             OssoABookManualGroup *group,
                                             EBook *book);
void        osso_abook_contact_replace_group
                                            (EContact *contact,
                                             OssoABookManualGroup *old_group,
                                             OssoABookManualGroup *new_group,
                                             EBook *book);
time_t      osso_abook_contact_get_last_used
                                            (EContact *contact);
void        osso_abook_contact_commit       (EContact *contact,
                                             gboolean new,
                                             EBook *book);
void        osso_abook_contact_set_blocked  (EContact *contact,
                                             gboolean blocked,
                                             EBook *book);
gboolean    osso_abook_contact_get_blocked  (EContact *contact);
void        osso_abook_contact_delete       (EContact *contact,
                                             EBook *book);
gboolean    osso_abook_contact_get_deleted  (EContact *contact);
const char* osso_abook_contact_get_name     (EContact *contact);
const char* osso_abook_contact_get_display_name
                                            (EContact *contact);
gboolean    osso_abook_contact_can_block    (EContact *contact,
                                             const char **infoprint);
gboolean    osso_abook_contact_can_request_auth
                                            (EContact *contact,
                                             const char **infoprint);
void        osso_abook_contact_initiate_chat
                                            (EContact *contact,
                                             EBook *book);
void        osso_abook_contact_initiate_call
                                            (EContact *contact,
                                             EBook *book);
gboolean    osso_abook_contact_send_email   (EContact *contact,
                                             EBook *book,
                                             GtkWindow *window);
void        osso_abook_contact_clean        (EContact *contact);
void        osso_abook_contact_get_accounts_async
                                            (EContact *contact,
                                             OssoABookAccountTypeFlags flags,
                                             OssoABookAccountAvailableCb cb,
                                             gpointer user_data);

Description

OssoABookContact is an object that represents a person in the osso-abook application

Details

osso_abook_contact_get_photo ()

GdkPixbuf*  osso_abook_contact_get_photo    (EContact *contact);

Fetches and returns the photo for a contact (as set in the PHOTO field). It also scales the photo to 64x90 pixels.

contact : An EContact
Returns : A newly allocated GdkPixbuf of the photo, or NULL.

osso_abook_contact_set_photo ()

void        osso_abook_contact_set_photo    (EContact *contact,
                                             const char *filename,
                                             EBook *book);

Stores the image pointed to by filename into the photo cache as a 64x90 JPEG file, and points the photo field of contact to it.

contact : An EContact
filename : A path to an image file
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.

osso_abook_contact_get_accounts ()

GList*      osso_abook_contact_get_accounts (EContact *contact,
                                             OssoABookAccountTypeFlags flags);

Retreives the list of OssoABookAccount objects contact refers to.

contact : An Econtact
flags : An OssoABookAccountTypeFlags bitmask specifying the types o accounts to be retrieved.
Returns : A newly allocated GList of OssoABookAccount objects. The returned GList should be freed manually, and the elements should be g_object_unref()'ed.

osso_abook_contact_get_groups ()

GList*      osso_abook_contact_get_groups   (EContact *contact);

Retreives the list of groups contact belongs to.

contact : An EContact
Returns : A newly allocated GList of OssoABookManualGroup objects. The returned GList should be freed manually, but do not g_object_unref() the elements.

osso_abook_contact_add_group ()

void        osso_abook_contact_add_group    (EContact *contact,
                                             OssoABookManualGroup *group,
                                             EBook *book);

Adds contact to group.

contact : An EContact
group : An OssoABookManualGroup
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.

osso_abook_contact_remove_group ()

void        osso_abook_contact_remove_group (EContact *contact,
                                             OssoABookManualGroup *group,
                                             EBook *book);

Removes contact from group.

contact : An EContact
group : An OssoABookManualGroup
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.

osso_abook_contact_replace_group ()

void        osso_abook_contact_replace_group
                                            (EContact *contact,
                                             OssoABookManualGroup *old_group,
                                             OssoABookManualGroup *new_group,
                                             EBook *book);

Removes contact from old_group and places them in new_group, in a single operation.

contact : An EContact
old_group : An OssoABookManualGroup
new_group : An OssoABookManualGroup
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.

osso_abook_contact_get_last_used ()

time_t      osso_abook_contact_get_last_used
                                            (EContact *contact);

Returns the time contact was last used.

contact : An EContact
Returns : A time_t indicating when contact was last used

osso_abook_contact_commit ()

void        osso_abook_contact_commit       (EContact *contact,
                                             gboolean new,
                                             EBook *book);

Commits contact to book asynchronously.

contact : An EContact
new : TRUE if this is a new EContact
book : The EBook contact originates from

osso_abook_contact_set_blocked ()

void        osso_abook_contact_set_blocked  (EContact *contact,
                                             gboolean blocked,
                                             EBook *book);

Marks or unmarks contact as blocked.

contact : An EContact
blocked : TRUE if contact is to be blocked, FALSE otherwise
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.

osso_abook_contact_get_blocked ()

gboolean    osso_abook_contact_get_blocked  (EContact *contact);

Returns a boolean indicating whether contact is blocked or not.

contact : An EContact
Returns : TRUE if contact is blocked, FALSE otherwise.

osso_abook_contact_delete ()

void        osso_abook_contact_delete       (EContact *contact,
                                             EBook *book);

Deletes contact.

contact : An EContact
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.

osso_abook_contact_get_deleted ()

gboolean    osso_abook_contact_get_deleted  (EContact *contact);

Returns a boolean indicating whether contact is deleted or not.

contact : An EContact
Returns : TRUE if contact is deleted, FALSE otherwise.

osso_abook_contact_get_name ()

const char* osso_abook_contact_get_name     (EContact *contact);

Retreives the text used to represent the name of contact internally. This string is formed according to the "/apps/osso-addressbook/display_method" preference. To keep it up to date, call this function again when the preference changes.

To display the name of a contact use osso_abook_contact_get_display_name().

contact : An EContact
Returns : The name of contact. This string is owned by libosso-abook and should not be freed.

osso_abook_contact_get_display_name ()

const char* osso_abook_contact_get_display_name
                                            (EContact *contact);

Retreives the text used to display the name of contact. This string is formed according to the "/apps/osso-addressbook/display_method" preference. To keep the display up to date, call this function again when the preference changes.

contact : An EContact
Returns : The display name of contact. This string is owned by libosso-abook and should not be freed.

osso_abook_contact_can_block ()

gboolean    osso_abook_contact_can_block    (EContact *contact,
                                             const char **infoprint);

Checks if it is possible to block contact, and if not possible sets infoprint to point to a string explaining why not.

contact : An EContact
infoprint : Location to store the explanation string, or NULL
Returns : TRUE if contact can be blocked

osso_abook_contact_can_request_auth ()

gboolean    osso_abook_contact_can_request_auth
                                            (EContact *contact,
                                             const char **infoprint);

Checks if it is possible to request authorization for contact, and if not possible sets infoprint to point to a string explaining why not.

contact : An EContact
infoprint : Location to store the explanation string, or NULL
Returns : TRUE if authorization can be requested for contact

osso_abook_contact_initiate_chat ()

void        osso_abook_contact_initiate_chat
                                            (EContact *contact,
                                             EBook *book);

Initiates a chat session with contact.

contact : An EContact
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.

osso_abook_contact_initiate_call ()

void        osso_abook_contact_initiate_call
                                            (EContact *contact,
                                             EBook *book);

Initiates a VoIP call with contact.

contact : An EContact
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.

osso_abook_contact_send_email ()

gboolean    osso_abook_contact_send_email   (EContact *contact,
                                             EBook *book,
                                             GtkWindow *window);

Starts the email composer with contact as receipient.

contact : An EContact
book : The EBook contact originates from, or NULL to purely modify contact without commiting the change.
window : Parent GtkWindow
Returns : TRUE if email app was launched, FALSE otherwise.

osso_abook_contact_clean ()

void        osso_abook_contact_clean        (EContact *contact);

Clean a contact, by removing all empty fields.

contact : An EContact

osso_abook_contact_get_accounts_async ()

void        osso_abook_contact_get_accounts_async
                                            (EContact *contact,
                                             OssoABookAccountTypeFlags flags,
                                             OssoABookAccountAvailableCb cb,
                                             gpointer user_data);

Retreives asynchronously the list of OssoABookAccount objects contact refers to. Each OssoABookAccount should be g_object_unref()'ed.

contact : An Econtact
flags : An OssoABookAccountTypeFlags bitmask specifying the types of accounts to be retrieved.
cb : The callback that will receive each OssoABookAccount
user_data : User data to pass to the callback