Re: [Evolution-hackers] E-VCard API

The way I described doing it (the code you're using below) will give you
a vcard that has the following attribute in it:


so basically you do your loops to find the TYPE attribute param with
X-GNOME-MEETING-SPEEDDIAL for the value, and then you can call
e_vcard_attribute_get_value (since you know it's single valued - or
rather, since you only care about the first value.)

What Rodney was suggesting is something like this:


This might be how you want things tied together, I don't really know...
For this, you just loop over the EVCardAttributeParam's until you find
one named X-GNOME-MEETING-SPEEDDIAL, then the value of that parameter
(from e_vcard_attribute_param_get_values) is 55.


On Thu, 2004-04-29 at 11:20 +0200, 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?
> 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
> 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),
> Thanks,
> -- 
> Damien Sandras <dsandras seconix com>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]