GDataContactsContact

GDataContactsContact — GData Contacts contact object

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <gdata/services/contacts/gdata-contacts-contact.h>

                    GDataContactsContact;
                    GDataContactsContactClass;
GDataContactsContact * gdata_contacts_contact_new       (const gchar *id);
GDataContactsContact * gdata_contacts_contact_new_from_xml
                                                        (const gchar *xml,
                                                         gint length,
                                                         GError **error);
GList *             gdata_contacts_contact_get_email_addresses
                                                        (GDataContactsContact *self);
GDataGDEmailAddress * gdata_contacts_contact_get_primary_email_address
                                                        (GDataContactsContact *self);
void                gdata_contacts_contact_add_email_address
                                                        (GDataContactsContact *self,
                                                         GDataGDEmailAddress *email_address);
GList *             gdata_contacts_contact_get_im_addresses
                                                        (GDataContactsContact *self);
GDataGDIMAddress *  gdata_contacts_contact_get_primary_im_address
                                                        (GDataContactsContact *self);
void                gdata_contacts_contact_add_im_address
                                                        (GDataContactsContact *self,
                                                         GDataGDIMAddress *im_address);
GList *             gdata_contacts_contact_get_postal_addresses
                                                        (GDataContactsContact *self);
GDataGDPostalAddress * gdata_contacts_contact_get_primary_postal_address
                                                        (GDataContactsContact *self);
void                gdata_contacts_contact_add_postal_address
                                                        (GDataContactsContact *self,
                                                         GDataGDPostalAddress *postal_address);
GList *             gdata_contacts_contact_get_phone_numbers
                                                        (GDataContactsContact *self);
GDataGDPhoneNumber * gdata_contacts_contact_get_primary_phone_number
                                                        (GDataContactsContact *self);
void                gdata_contacts_contact_add_phone_number
                                                        (GDataContactsContact *self,
                                                         GDataGDPhoneNumber *phone_number);
GList *             gdata_contacts_contact_get_organizations
                                                        (GDataContactsContact *self);
GDataGDOrganization * gdata_contacts_contact_get_primary_organization
                                                        (GDataContactsContact *self);
void                gdata_contacts_contact_add_organization
                                                        (GDataContactsContact *self,
                                                         GDataGDOrganization *organization);
GList *             gdata_contacts_contact_get_groups   (GDataContactsContact *self);
void                gdata_contacts_contact_add_group    (GDataContactsContact *self,
                                                         const gchar *href);
void                gdata_contacts_contact_remove_group (GDataContactsContact *self,
                                                         const gchar *href);
gboolean            gdata_contacts_contact_is_group_deleted
                                                        (GDataContactsContact *self,
                                                         const gchar *href);
const gchar *       gdata_contacts_contact_get_extended_property
                                                        (GDataContactsContact *self,
                                                         const gchar *name);
gboolean            gdata_contacts_contact_set_extended_property
                                                        (GDataContactsContact *self,
                                                         const gchar *name,
                                                         const gchar *value);
void                gdata_contacts_contact_get_edited   (GDataContactsContact *self,
                                                         GTimeVal *edited);
gboolean            gdata_contacts_contact_is_deleted   (GDataContactsContact *self);

Object Hierarchy

  GObject
   +----GDataParsable
         +----GDataEntry
               +----GDataContactsContact

Properties

  "deleted"                  gboolean              : Read
  "edited"                   GTimeVal*             : Read

Description

GDataContactsContact is a subclass of GDataEntry to represent a contact from a Google address book.

For more details of Google Contacts' GData API, see the online documentation.

Details

GDataContactsContact

typedef struct _GDataContactsContact GDataContactsContact;

All the fields in the GDataContactsContact structure are private and should never be accessed directly.


GDataContactsContactClass

typedef struct {
} GDataContactsContactClass;

All the fields in the GDataContactsContactClass structure are private and should never be accessed directly.


gdata_contacts_contact_new ()

GDataContactsContact * gdata_contacts_contact_new       (const gchar *id);

Creates a new GDataContactsContact with the given ID and default properties.

id :

the contact's ID, or NULL

Returns :

a new GDataContactsContact; unref with g_object_unref()

Since 0.2.0


gdata_contacts_contact_new_from_xml ()

GDataContactsContact * gdata_contacts_contact_new_from_xml
                                                        (const gchar *xml,
                                                         gint length,
                                                         GError **error);

Creates a new GDataContactsContact from an XML string. If length is -1, the length of the string will be calculated.

Errors from GDataParserError can be returned if problems are found in the XML.

xml :

an XML string

length :

the length in characters of xml, or -1

error :

a GError, or NULL

Returns :

a new GDataContactsContact, or NULL; unref with g_object_unref()

Since 0.2.0


gdata_contacts_contact_get_email_addresses ()

GList *             gdata_contacts_contact_get_email_addresses
                                                        (GDataContactsContact *self);

Gets a list of the e-mail addresses owned by the contact.

self :

a GDataContactsContact

Returns :

a GList of GDataGDEmailAddresses, or NULL

Since 0.2.0


gdata_contacts_contact_get_primary_email_address ()

GDataGDEmailAddress * gdata_contacts_contact_get_primary_email_address
                                                        (GDataContactsContact *self);

Gets the contact's primary e-mail address, if one exists.

self :

a GDataContactsContact

Returns :

a GDataGDEmailAddress, or NULL

Since 0.2.0


gdata_contacts_contact_add_email_address ()

void                gdata_contacts_contact_add_email_address
                                                        (GDataContactsContact *self,
                                                         GDataGDEmailAddress *email_address);

Adds an e-mail address to the contact's list of e-mail addresses. The GDataContactsContact takes ownership of email_address, so it must not be freed after being added.

Note that only one e-mail address per contact may be marked as "primary". Insertion and update operations (with gdata_contacts_service_insert_contact()) will return an error if more than one e-mail address is marked as primary.

self :

a GDataContactsContact

email_address :

a GDataGDEmailAddress to add

Since 0.2.0


gdata_contacts_contact_get_im_addresses ()

GList *             gdata_contacts_contact_get_im_addresses
                                                        (GDataContactsContact *self);

Gets a list of the IM addresses owned by the contact.

self :

a GDataContactsContact

Returns :

a GList of GDataGDIMAddresses, or NULL

Since 0.2.0


gdata_contacts_contact_get_primary_im_address ()

GDataGDIMAddress *  gdata_contacts_contact_get_primary_im_address
                                                        (GDataContactsContact *self);

Gets the contact's primary IM address, if one exists.

self :

a GDataContactsContact

Returns :

a GDataGDIMAddress, or NULL

Since 0.2.0


gdata_contacts_contact_add_im_address ()

void                gdata_contacts_contact_add_im_address
                                                        (GDataContactsContact *self,
                                                         GDataGDIMAddress *im_address);

Adds an IM (instant messaging) address to the contact's list of IM addresses. The GDataContactsContact takes ownership of im_address, so it must not be freed after being added.

Note that only one IM address per contact may be marked as "primary". Insertion and update operations (with gdata_contacts_service_insert_contact()) will return an error if more than one IM address is marked as primary.

self :

a GDataContactsContact

im_address :

a GDataGDIMAddress to add

Since 0.2.0


gdata_contacts_contact_get_postal_addresses ()

GList *             gdata_contacts_contact_get_postal_addresses
                                                        (GDataContactsContact *self);

Gets a list of the postal addresses owned by the contact.

self :

a GDataContactsContact

Returns :

a GList of GDataGDPostalAddresses, or NULL

Since 0.2.0


gdata_contacts_contact_get_primary_postal_address ()

GDataGDPostalAddress * gdata_contacts_contact_get_primary_postal_address
                                                        (GDataContactsContact *self);

Gets the contact's primary postal address, if one exists.

self :

a GDataContactsContact

Returns :

a GDataGDPostalAddress, or NULL

Since 0.2.0


gdata_contacts_contact_add_postal_address ()

void                gdata_contacts_contact_add_postal_address
                                                        (GDataContactsContact *self,
                                                         GDataGDPostalAddress *postal_address);

Adds a postal address to the contact's list of postal addresses. The GDataContactsContact takes ownership of postal_address, so it must not be freed after being added.

Note that only one postal address per contact may be marked as "primary". Insertion and update operations (with gdata_contacts_service_insert_contact()) will return an error if more than one postal address is marked as primary.

self :

a GDataContactsContact

postal_address :

a GDataGDPostalAddress to add

Since 0.2.0


gdata_contacts_contact_get_phone_numbers ()

GList *             gdata_contacts_contact_get_phone_numbers
                                                        (GDataContactsContact *self);

Gets a list of the phone numbers owned by the contact.

self :

a GDataContactsContact

Returns :

a GList of GDataGDPhoneNumbers, or NULL

Since 0.2.0


gdata_contacts_contact_get_primary_phone_number ()

GDataGDPhoneNumber * gdata_contacts_contact_get_primary_phone_number
                                                        (GDataContactsContact *self);

Gets the contact's primary phone number, if one exists.

self :

a GDataContactsContact

Returns :

a GDataGDPhoneNumber, or NULL

Since 0.2.0


gdata_contacts_contact_add_phone_number ()

void                gdata_contacts_contact_add_phone_number
                                                        (GDataContactsContact *self,
                                                         GDataGDPhoneNumber *phone_number);

Adds a phone number to the contact's list of phone numbers. The GDataContactsContact takes ownership of phone_number, so it must not be freed after being added.

Note that only one phone number per contact may be marked as "primary". Insertion and update operations (with gdata_contacts_service_insert_contact()) will return an error if more than one phone number is marked as primary.

self :

a GDataContactsContact

phone_number :

a GDataGDPhoneNumber to add

Since 0.2.0


gdata_contacts_contact_get_organizations ()

GList *             gdata_contacts_contact_get_organizations
                                                        (GDataContactsContact *self);

Gets a list of the organizations to which the contact belongs.

self :

a GDataContactsContact

Returns :

a GList of GDataGDOrganizations, or NULL

Since 0.2.0


gdata_contacts_contact_get_primary_organization ()

GDataGDOrganization * gdata_contacts_contact_get_primary_organization
                                                        (GDataContactsContact *self);

Gets the contact's primary organization, if one exists.

self :

a GDataContactsContact

Returns :

a GDataGDOrganization, or NULL

Since 0.2.0


gdata_contacts_contact_add_organization ()

void                gdata_contacts_contact_add_organization
                                                        (GDataContactsContact *self,
                                                         GDataGDOrganization *organization);

Adds an organization to the contact's list of organizations (e.g. employers). The GDataContactsContact takes ownership of organization, so it must not be freed after being added.

Note that only one organization per contact may be marked as "primary". Insertion and update operations (with gdata_contacts_service_insert_contact()) will return an error if more than one organization is marked as primary.

self :

a GDataContactsContact

organization :

a GDataGDOrganization to add

Since 0.2.0


gdata_contacts_contact_get_groups ()

GList *             gdata_contacts_contact_get_groups   (GDataContactsContact *self);

Gets a list of the groups to which the contact belongs.

self :

a GDataContactsContact

Returns :

a GList of constant group ID URIs, or NULL; free with g_list_free()

Since 0.2.0


gdata_contacts_contact_add_group ()

void                gdata_contacts_contact_add_group    (GDataContactsContact *self,
                                                         const gchar *href);

Adds the contact to the given group. href should be a URI.

self :

a GDataContactsContact

href :

the group's ID URI

Since 0.2.0


gdata_contacts_contact_remove_group ()

void                gdata_contacts_contact_remove_group (GDataContactsContact *self,
                                                         const gchar *href);

Removes the contact from the given group. href should be a URI.

self :

a GDataContactsContact

href :

the group's ID URI

Since 0.2.0


gdata_contacts_contact_is_group_deleted ()

gboolean            gdata_contacts_contact_is_group_deleted
                                                        (GDataContactsContact *self,
                                                         const gchar *href);

Returns whether the contact has recently been removed from the given group. This will always return FALSE unless "show-deleted" has been set to TRUE for the query which returned the contact.

self :

a GDataContactsContact

href :

the group's ID URI

Returns :

TRUE if the contact has recently been removed from the group, FALSE otherwise

Since 0.2.0


gdata_contacts_contact_get_extended_property ()

const gchar *       gdata_contacts_contact_get_extended_property
                                                        (GDataContactsContact *self,
                                                         const gchar *name);

Gets the value of an extended property of the contact. Each contact can have up to 10 client-set extended properties to store data of the client's choosing.

self :

a GDataContactsContact

name :

the property name; an arbitrary, unique string

Returns :

the property's value, or NULL

Since 0.2.0


gdata_contacts_contact_set_extended_property ()

gboolean            gdata_contacts_contact_set_extended_property
                                                        (GDataContactsContact *self,
                                                         const gchar *name,
                                                         const gchar *value);

Sets the value of a contact's extended property. Extended property names are unique (but of the client's choosing), and reusing the same property name will result in the old value of that property being overwritten.

To unset a property, set value to NULL.

A contact may have up to 10 extended properties, and each should be reasonably small (i.e. not a photo or ringtone). For more information, see the online documentation. FALSE will be returned if you attempt to add more than 10 extended properties.

self :

a GDataContactsContact

name :

the property name; an arbitrary, unique string

value :

the property value, or NULL

Returns :

TRUE if the property was updated or deleted successfully, FALSE otherwise

Since 0.2.0


gdata_contacts_contact_get_edited ()

void                gdata_contacts_contact_get_edited   (GDataContactsContact *self,
                                                         GTimeVal *edited);

Gets the "edited" property and puts it in edited. If the property is unset, both fields in the GTimeVal will be set to 0.

self :

a GDataContactsContact

edited :

a GTimeVal

Since 0.2.0


gdata_contacts_contact_is_deleted ()

gboolean            gdata_contacts_contact_is_deleted   (GDataContactsContact *self);

Returns whether the contact has recently been deleted. This will always return FALSE unless "show-deleted" has been set to TRUE for the query which returned the contact; then this function will return TRUE only if the contact has been deleted.

If a contact has been deleted, no other information is available about it. This is designed to allow contacts to be deleted from local address books using incremental updates from the server (e.g. with "updated-min" and "show-deleted").

self :

a GDataContactsContact

Returns :

TRUE if the contact has been deleted, FALSE otherwise

Since 0.2.0

Property Details

The "deleted" property

  "deleted"                  gboolean              : Read

Whether the entry has been deleted.

Default value: FALSE

Since 0.2.0


The "edited" property

  "edited"                   GTimeVal*             : Read

The last time the contact was edited. If the contact has not been edited yet, the content indicates the time it was created.

For more information, see the Atom Publishing Protocol specification.

Since 0.2.0