EBookContacts.VCardAttribute¶
Fields¶
None
Methods¶
| class | new(attr_group, attr_name) | 
| add_param(param) | |
| add_param_with_value(param, value) | |
| add_value(value) | |
| add_value_decoded(value, len) | |
| copy() | |
| free() | |
| get_group() | |
| get_name() | |
| get_param(name) | |
| get_params() | |
| get_value() | |
| get_value_decoded() | |
| get_values() | |
| get_values_decoded() | |
| has_type(typestr) | |
| is_single_valued() | |
| remove_param(param_name) | |
| remove_param_value(param_name, s) | |
| remove_params() | |
| remove_value(s) | |
| remove_values() | 
Details¶
- 
class EBookContacts.VCardAttribute¶
- 
classmethod new(attr_group, attr_name)¶
- Parameters: - Returns: - A new - EBookContacts.VCardAttribute.- Return type: - Creates a new - EBookContacts.VCardAttributewith the specified group and attribute names. The attr_group may be- Noneor the empty string if no group is needed.
 - 
add_param(param)¶
- Parameters: - param ( - EBookContacts.VCardAttributeParam) – an- EBookContacts.VCardAttributeParamto add- Prepends param to self’s list of parameters. This takes ownership of param (and all its values). - Duplicate parameters have their values merged, so that all parameter names in self are unique. Values are also merged so that uniqueness is preserved. 
 - 
add_param_with_value(param, value)¶
- Parameters: - param (EBookContacts.VCardAttributeParam) – anEBookContacts.VCardAttributeParam
- value (str) – a string value
 - Appends value to param, then prepends param to self. This takes ownership of param, but not of value. - This is a convenience method for - EBookContacts.VCardAttributeParam.add_value() and- EBookContacts.VCardAttribute.add_param().
- param (
 - 
add_value_decoded(value, len)¶
- Parameters: - Encodes value according to the encoding used for self, and appends it to self’s list of values. - This should only be used if the - EBookContacts.VCardAttributehas a non-raw encoding (i.e. if it’s encoded in base-64 or quoted-printable encoding).
 - 
copy()¶
- Returns: - A new - EBookContacts.VCardAttributeidentical to self.- Return type: - EBookContacts.VCardAttribute- Makes a copy of self. 
 - 
free()¶
- Frees an attribute, its values and its parameters. 
 - 
get_group()¶
- Returns: - The attribute’s group name, or - None.- Return type: - stror- None- Gets the group name of self. 
 - 
get_param(name)¶
- Parameters: - name ( - str) – a parameter name- Returns: - A list of string elements representing the parameter’s values, or - None.- Return type: - [ - str] or- None- Gets the list of values for the paramater name from self. The list and its contents are owned by self, and must not be freed. If no parameter with the given name exists, - Noneis returned.
 - 
get_params()¶
- Returns: - A list of elements of type - EBookContacts.VCardAttributeParam.- Return type: - [ - EBookContacts.VCardAttributeParam]- Gets the list of parameters (of type - EBookContacts.VCardAttributeParam) from self. The list and its contents are owned by self, and must not be freed.
 - 
get_value()¶
- Returns: - A newly allocated string representing the value, or - Noneif the attribute has no value.- Return type: - stror- None- Gets the value of a single-valued - EBookContacts.VCardAttribute, self.- For example, for a FN (full name) attribute, this will return the contact’s full name as a single string. - This will print a warning if called on an - EBookContacts.VCardAttributewhich is not single-valued (i.e. for which- EBookContacts.VCardAttribute.is_single_valued() returns- False). Use- EBookContacts.VCardAttribute.get_values() in such cases instead.
 - 
get_value_decoded()¶
- Returns: - A newly allocated - GLib.Stringrepresenting the value, or- Noneif the attribute has no value.- Return type: - GLib.Stringor- None- Gets the value of a single-valued - EBookContacts.VCardAttribute, self, decoding it if necessary according to the encoding given in the vCard’s- ENCODING attribute. This will print a warning if called on an - EBookContacts.VCardAttributewhich is not single-valued (i.e. for which- EBookContacts.VCardAttribute.is_single_valued() returns- False). Use- EBookContacts.VCardAttribute.get_values_decoded() in such cases instead.
 - 
get_values()¶
- Returns: - A list of string values. They will all be non- - None, but may be empty strings. The list itself may be empty.- Return type: - [ - str]- Gets the ordered list of values from self. The list and its contents are owned by self, and must not be freed. - For example, for an ADR (postal address) attribute, this will return the components of the postal address. - This may be called on a single-valued attribute (i.e. one for which - EBookContacts.VCardAttribute.is_single_valued() returns- True) and will return a one-element list in that case. Alternatively, use- EBookContacts.VCardAttribute.get_value() in such cases.
 - 
get_values_decoded()¶
- Returns: - A list of values of type - GLib.String.- Return type: - [ - GLib.String]- Gets the ordered list of values from self, decoding them if necessary according to the encoding given in the vCard’s - ENCODING attribute. The list and its contents are owned by self, and must not be freed. - This may be called on a single-valued attribute (i.e. one for which - EBookContacts.VCardAttribute.is_single_valued() returns- True) and will return a one-element list in that case. Alternatively, use- EBookContacts.VCardAttribute.get_value_decoded() in such cases.
 - 
has_type(typestr)¶
- Parameters: - typestr ( - str) – a string representing the type- Returns: - Trueif such a parameter exists,- Falseotherwise.- Return type: - bool- Checks if self has an - EBookContacts.VCardAttributeParamwith name- EBookContacts.EVC_TYPEand typestr as one of its values.- For example, for the vCard attribute: - TEL;TYPE=WORK,VOICE:(111) 555-1212- the following holds true: - g_assert (e_vcard_attribute_has_type (attr, "WORK") == TRUE); g_assert (e_vcard_attribute_has_type (attr, "voice") == TRUE); g_assert (e_vcard_attribute_has_type (attr, "HOME") == FALSE); - Comparisons against typestr are case-insensitive. 
 - 
is_single_valued()¶
- Returns: - Trueif the attribute has exactly one value,- Falseotherwise.- Return type: - bool- Checks if self has a single value. 
 - 
remove_param(param_name)¶
- Parameters: - param_name ( - str) – a parameter name- Removes and frees parameter param_name from the attribute self. Parameter names are guaranteed to be unique, so self is guaranteed to have no parameters named param_name after this function returns. - New in version 1.12. 
 - 
remove_param_value(param_name, s)¶
- Parameters: - Removes the value s from the parameter param_name on the attribute self. If s was the only value for parameter param_name, that parameter is removed entirely from self and freed. 
 - 
remove_params()¶
- Removes and frees all parameters from self. - This also resets the - EBookContacts.VCardAttribute’s encoding back to raw.
 - 
remove_value(s)¶
- Parameters: - s ( - str) – a value to remove- Removes value s from the value list in self. The value s is not freed. 
 - 
remove_values()¶
- Removes and frees all values from self. 
 
- 
classmethod