Re: [Evolution-hackers] E-VCard API
- From: Sivaiah N <snallagatla novell com>
- To: Damien Sandras <dsandras seconix com>
- Cc: evolution-hackers lists ximian com, toshok ximian com
- Subject: Re: [Evolution-hackers] E-VCard API
- Date: 29 Apr 2004 17:33:53 +0530
On Thu, 2004-04-29 at 14:50, Damien Sandras wrote:
> Hello to all,
>
> I have made more progress, but I'm a bit confused by the API.
> I have added Speeddial support using Chris' trick :
>
> --------------------------------------------
> attr = e_vcard_attribute_new (NULL, "TEL");
> e_vcard_attribute_add_param_with_value (attr,
> e_vcard_attribute_param_new
> ("TYPE"),
> "X-GNOME-MEETING-SPEEDDIAL");
> e_vcard_attribute_add_value (attr, "55");
> e_vcard_add_attribute (E_VCARD (contact), attr);
> --------------------------------------------
>
> Now, from an EContact, I want to be able to read the speed dial value
> back. More or less easy with a succession of loops :
>
> 1) e_contact_get_attributes returns a GList of EVCardAttribute *
> 2) for each of the EVCardAttribute *, call e_vcard_attribute_get_params
> to get a GList of EVCardAttributeParam *
> 3) for each of the EVCardAttributeParam, call
> e_vcard_attribute_param_get_values to get a list of char * containing
> the param value name. One of them is of course
> "X-GNOMEMEETING-SPEEDDIAL", but how can I get the associate value back?
>
Once you find an attribute having a parameter with name as "TYPE" and
value as X-GNOME-MEETING_SPEEDDIAL , you can call
e_vcard_attribute_get_value or e_vcard_attribute_get_values on that
attribute. Not sure though :)
> I can use e_vcard_attribute_get_values, but it will give me a list of
> values for the EVCardAttribute found at step 1. How can I make sure I
> get the value for the correct EVCardAttributeParam with the right
> X-GNOMEMEETING-SPEEDDIAL value?
>
> Currently, it works because all lists are single-valued, but shouldn't
> there be a function in the API like :
> e_vcard_attribute_param_get_value (EVCardAttributeParam (found in 2),
> "X-GNOMEMEETING-SPEEDDIAL")?
>
> Thanks,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]