Top | ![]() |
![]() |
![]() |
![]() |
GBoxed ├── EContactAddress ├── EContactCert ├── EContactDate ├── EContactGeo ├── EContactName ╰── EContactPhoto GObject ╰── EVCard ╰── EContact
This subclass of EVCard is a convenient interface for interacting with vCards. The EBookClient, EBookClientView and EBookClientCursor return vCards in the form of an EContact for your convenience.
EContact *
e_contact_new_from_vcard (const gchar *vcard
);
Creates a new EContact based on a vcard.
EContact * e_contact_new_from_vcard_with_uid (const gchar *vcard
,const gchar *uid
);
Creates a new EContact based on a vcard and a predefined UID.
Since: 3.4
EContact *
e_contact_duplicate (EContact *contact
);
Creates a copy of contact
.
gpointer e_contact_get (EContact *contact
,EContactField field_id
);
Gets the value of contact
's field specified by field_id
.
gconstpointer e_contact_get_const (EContact *contact
,EContactField field_id
);
Gets the value of contact
's field specified by field_id
, caching
the result so it can be freed later. Use e_contact_field_is_string()
to check whether the field can be used here.
void e_contact_set (EContact *contact
,EContactField field_id
,gconstpointer value
);
Sets the value of contact
's field specified by field_id
to value
.
GList * e_contact_get_attributes (EContact *contact
,EContactField field_id
);
Gets a list of the vcard attributes for contact
's field_id
.
A GList of pointers to EVCardAttribute, owned by the caller.
[transfer full][element-type EVCardAttribute]
GList * e_contact_get_attributes_set (EContact *contact
,const EContactField field_ids[]
,gint size
);
Gets a list of the vcard attributes for contact
's field_ids
.
contact |
an EContact |
|
field_ids |
an array of EContactField |
|
size |
number of elements in field_ids |
A GList of pointers to EVCardAttribute, owned by the caller.
[transfer full][element-type EVCardAttribute]
Since: 3.16
void e_contact_set_attributes (EContact *contact
,EContactField field_id
,GList *attributes
);
Sets the vcard attributes for contact
's field_id
.
Attributes are added to the contact in the same order as they are in attributes
.
contact |
an EContact |
|
field_id |
||
attributes |
a GList of pointers to EVCardAttribute. |
[element-type EVCardAttribute] |
EContactDate *
e_contact_date_from_string (const gchar *str
);
Creates a new EContactDate based on str
.
gchar *
e_contact_date_to_string (EContactDate *dt
);
Generates a date string in the format YYYY-MM-DD based
on the values of dt
.
gboolean e_contact_date_equal (EContactDate *dt1
,EContactDate *dt2
);
Checks if dt1
and dt2
are the same date.
void
e_contact_date_free (EContactDate *date
);
Frees the date
struct and its contents.
gchar *
e_contact_name_to_string (const EContactName *name
);
Generates a string representation of name
.
EContactName *
e_contact_name_from_string (const gchar *name_str
);
Creates a new EContactName based on the parsed name_str
.
EContactPhoto *
e_contact_photo_new (void
);
Creates a new EContactPhoto struct.
Since: 3.2
void
e_contact_photo_free (EContactPhoto *photo
);
Frees the photo
struct and its contents.
EContactPhoto *
e_contact_photo_copy (EContactPhoto *photo
);
Creates a copy of photo
.
Since: 3.8
const guchar * e_contact_photo_get_inlined (EContactPhoto *photo
,gsize *len
);
Gets the photo
's data.
the inlined image in the
EContactPhoto, or NULL
if it has not been set.
[transfer none][array length=len][allow-none]
Since: 3.2
void e_contact_photo_set_inlined (EContactPhoto *photo
,const guchar *data
,gsize len
);
Sets the photo
's inlined data.
photo |
||
data |
the inlined image data. |
[transfer none][array length=len] |
len |
the length of |
Since: 3.2
const gchar *
e_contact_photo_get_mime_type (EContactPhoto *photo
);
Gets the photo
's mime type.
Since: 3.2
void e_contact_photo_set_mime_type (EContactPhoto *photo
,const gchar *mime_type
);
Sets the photo
's mime type.
Since: 3.2
const gchar *
e_contact_photo_get_uri (EContactPhoto *photo
);
Gets the photo
's URI.
Since: 3.2
void e_contact_photo_set_uri (EContactPhoto *photo
,const gchar *uri
);
Sets the photo
's URI.
Since: 3.2
gboolean e_contact_inline_local_photos (EContact *contact
,GError **error
);
Tries to modify any EContactPhoto fields which are
stored on the local file system as type E_CONTACT_PHOTO_TYPE_URI
to be inlined and stored as E_CONTACT_PHOTO_TYPE_INLINED
instead.
Since: 3.4
EContactGeo *
e_contact_geo_new (void
);
Creates an EContactGeo struct with all coordinates set to 0.
Since: 3.8
void
e_contact_geo_free (EContactGeo *geo
);
Frees the geo
struct and its contents.
Since: 1.12
EContactCert *
e_contact_cert_new (void
);
Creates an EContactCert struct with all values set to 0.
Since: 3.8
void
e_contact_cert_free (EContactCert *cert
);
Frees the cert
struct and its contents.
EContactAddress *
e_contact_address_new (void
);
Creates a new EContactAddress struct.
Since: 3.2
void
e_contact_address_free (EContactAddress *address
);
Frees the address
struct and its contents.
GList *
e_contact_attr_list_copy (GList *list
);
Copies a list of allocated strings, specifically for the EContactAttrList boxed type used for multi valued contact fields.
Since: 3.8
void
e_contact_attr_list_free (GList *list
);
Frees a list of allocated strings, specifically for the EContactAttrList boxed type used for multi valued contact fields.
Since: 3.8
GType
e_contact_field_type (EContactField field_id
);
Gets the GType used for this contact field, this indicates
what kind of value can be passed to e_contact_set()
.
Since: 3.8
const gchar *
e_contact_field_name (EContactField field_id
);
Gets the string representation of field_id
.
const gchar *
e_contact_pretty_name (EContactField field_id
);
Gets a human-readable, translated string representation
of field_id
.
const gchar *
e_contact_vcard_attribute (EContactField field_id
);
Gets the vcard attribute corresponding to field_id
, as a string.
gboolean
e_contact_field_is_string (EContactField field_id
);
Returns whether the field_id
is of a string type,
thus it can be used with e_contact_get_const()
.
Since: 3.16
EContactField
e_contact_field_id (const gchar *field_name
);
Gets the EContactField corresponding to the field_name
.
EContactField
e_contact_field_id_from_vcard (const gchar *vcard_field
);
Gets the EContactField corresponding to the vcard_field
.
Since: 2.26