folks Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
FolksAbstractFieldDetailsFolksAbstractFieldDetails — Object representing any type of value that can have some vCard-like parameters associated with it. |
#define FOLKS_TYPE_ABSTRACT_FIELD_DETAILS GeeCollection * folks_abstract_field_details_get_parameter_values (FolksAbstractFieldDetails *self
,const gchar *parameter_name
); void folks_abstract_field_details_add_parameter (FolksAbstractFieldDetails *self
,const gchar *parameter_name
,const gchar *parameter_value
); void folks_abstract_field_details_set_parameter (FolksAbstractFieldDetails *self
,const gchar *parameter_name
,const gchar *parameter_value
); void folks_abstract_field_details_extend_parameters (FolksAbstractFieldDetails *self
,GeeMultiMap *additional
); void folks_abstract_field_details_remove_parameter_all (FolksAbstractFieldDetails *self
,const gchar *parameter_name
); gboolean folks_abstract_field_details_equal (FolksAbstractFieldDetails *self
,FolksAbstractFieldDetails *that
); gboolean folks_abstract_field_details_parameters_equal (FolksAbstractFieldDetails *self
,FolksAbstractFieldDetails *that
); gboolean folks_abstract_field_details_values_equal (FolksAbstractFieldDetails *self
,FolksAbstractFieldDetails *that
); guint folks_abstract_field_details_hash (FolksAbstractFieldDetails *self
); #define FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE #define FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_HOME #define FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_WORK #define FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_OTHER gconstpointer folks_abstract_field_details_get_value (FolksAbstractFieldDetails *self
); void folks_abstract_field_details_set_value (FolksAbstractFieldDetails *self
,gconstpointer value
); GType folks_abstract_field_details_get_value_type (FolksAbstractFieldDetails *self
); const gchar * folks_abstract_field_details_get_id (FolksAbstractFieldDetails *self
); void folks_abstract_field_details_set_id (FolksAbstractFieldDetails *self
,const gchar *value
); GeeMultiMap * folks_abstract_field_details_get_parameters (FolksAbstractFieldDetails *self
); void folks_abstract_field_details_set_parameters (FolksAbstractFieldDetails *self
,GeeMultiMap *value
); struct FolksAbstractFieldDetails;
GObject +----FolksAbstractFieldDetails +----FolksEmailFieldDetails +----FolksImFieldDetails +----FolksNoteFieldDetails +----FolksPhoneFieldDetails +----FolksPostalAddressFieldDetails +----FolksRoleFieldDetails +----FolksUrlFieldDetails +----FolksWebServiceFieldDetails
"id" gchar* : Read / Write "parameters" GeeMultiMap* : Read / Write / Construct "t-destroy-func" gpointer : Write / Construct Only "t-dup-func" gpointer : Write / Construct Only "t-type" GType* : Write / Construct Only "value" gpointer : Read / Write / Construct "value-type" GType* : Read
Some contact details, like phone numbers or URLs, can have some extra details associated with them. For instance, a phone number expressed in vcard notation as `tel;type=work,voice:(111) 555-1234` would be represented as a AbstractFieldDetails with value "(111) 555-1234" and with parameters `['type': ('work', 'voice')]`.
The parameter name "type" with values "work", "home", or "other" are common amongst most vCard attributes (and thus most AbstractFieldDetails-derived classes). A "type" of "pref" may be used to indicate a preferred "value" amongst many. See specific classes for information on additional parameters and values specific to that class.
See RFC2426 for more details on pre-defined parameter names and values.
#define FOLKS_TYPE_ABSTRACT_FIELD_DETAILS (folks_abstract_field_details_get_type ())
The type for FolksAbstractFieldDetails.
GeeCollection * folks_abstract_field_details_get_parameter_values (FolksAbstractFieldDetails *self
,const gchar *parameter_name
);
Get the values for a parameter
|
the FolksAbstractFieldDetails instance |
|
the parameter name. [in] |
Returns : |
a collection of values for `parameter_name` or `null` (i.e. no collection) if there are no such parameters. |
Since 0.6.0
void folks_abstract_field_details_add_parameter (FolksAbstractFieldDetails *self
,const gchar *parameter_name
,const gchar *parameter_value
);
Add a new value for a parameter.
If there is already a parameter called `parameter_name` then `parameter_value` is added to the existing ones.
|
the FolksAbstractFieldDetails instance |
|
the name of the parameter. [in] |
|
the value to add. [in] |
Since 0.6.0
void folks_abstract_field_details_set_parameter (FolksAbstractFieldDetails *self
,const gchar *parameter_name
,const gchar *parameter_value
);
Set the value of a parameter.
Sets the parameter called `parameter_name` to be `parameter_value`. If there were already parameters with the same name they are replaced.
|
the FolksAbstractFieldDetails instance |
|
the name of the parameter. [in] |
|
the value to add. [in] |
Since 0.6.0
void folks_abstract_field_details_extend_parameters (FolksAbstractFieldDetails *self
,GeeMultiMap *additional
);
Extend the existing parameters.
Merge the parameters from `additional` into the existing ones.
|
the FolksAbstractFieldDetails instance |
|
the parameters to add. [in] |
Since 0.6.0
void folks_abstract_field_details_remove_parameter_all (FolksAbstractFieldDetails *self
,const gchar *parameter_name
);
Remove all instances of a parameter.
|
the FolksAbstractFieldDetails instance |
|
the name of the parameter. [in] |
Since 0.6.0
gboolean folks_abstract_field_details_equal (FolksAbstractFieldDetails *self
,FolksAbstractFieldDetails *that
);
A fairly-strict equality function for
.
folks_abstract_field_details_new()
This function compares:
And does not compare:
"id"s
See the description of
for details on the value comparison.folks_abstract_field_details_values_equal()
To check equality not including the parameters, see
.folks_abstract_field_details_values_equal()
See also:
, folks_abstract_field_details_parameters_equal()
folks_abstract_field_details_values_equal()
|
the FolksAbstractFieldDetails instance |
|
another . [in]
|
Returns : |
whether the elements are equal |
Since 0.6.0
gboolean folks_abstract_field_details_parameters_equal (FolksAbstractFieldDetails *self
,FolksAbstractFieldDetails *that
);
An equality function which only considers parameters.
This function compares:
And does not compare:
See also:
, folks_abstract_field_details_equal()
folks_abstract_field_details_values_equal()
|
the FolksAbstractFieldDetails instance |
|
another . [in]
|
Returns : |
whether the elements' "value"s are equal. |
Since 0.6.5
gboolean folks_abstract_field_details_values_equal (FolksAbstractFieldDetails *self
,FolksAbstractFieldDetails *that
);
An equality function which does not consider parameters.
Specific classes may override this function to provide "smart" value comparisons (eg, considering the phone number values "+1 555 123 4567" and "123-4567" equal). If you wish to do strict comparisons, simply compare the "value"s directly.
This function compares:
And does not compare:
This defaults to string comparison of the "value"s if the generic type is string; otherwise, direct pointer comparison of the "value"s.
See also:
, folks_abstract_field_details_equal()
folks_abstract_field_details_parameters_equal()
|
the FolksAbstractFieldDetails instance |
|
another . [in]
|
Returns : |
whether the elements' "value"s are equal. |
Since 0.6.5
guint folks_abstract_field_details_hash (FolksAbstractFieldDetails *self
);
A hash function for the
.
folks_abstract_field_details_new()
This defaults to a string hash of the "value" if the generic type is string; otherwise, direct hash of the "value".
|
the FolksAbstractFieldDetails instance |
Returns : |
the hash value |
Since 0.6.0
#define FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE "type"
Parameter name for classifying the type of value this field contains.
For example, the value could be relevant to the contact's home life, or to their work life; values of FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_HOME
and FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_WORK
would be used for the FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE
parameter, respectively, in those cases.
Since 0.6.3
#define FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_HOME "home"
Parameter value for home-related field values.
Value for a parameter with name FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE
.
Since 0.6.3
#define FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_WORK "work"
Parameter value for work-related field values.
Value for a parameter with name FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE
.
Since 0.6.3
#define FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_OTHER "other"
Parameter value for miscellaneous field values.
Value for a parameter with name FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE
.
Since 0.6.3
gconstpointer folks_abstract_field_details_get_value
(FolksAbstractFieldDetails *self
);
|
the FolksAbstractFieldDetails instance to query |
Returns : |
the value of the "value" property |
void folks_abstract_field_details_set_value (FolksAbstractFieldDetails *self
,gconstpointer value
);
|
the FolksAbstractFieldDetails instance to modify |
|
the new value of the "value" property |
GType folks_abstract_field_details_get_value_type
(FolksAbstractFieldDetails *self
);
|
the FolksAbstractFieldDetails instance to query |
Returns : |
the value of the "value-type" property |
const gchar * folks_abstract_field_details_get_id (FolksAbstractFieldDetails *self
);
|
the FolksAbstractFieldDetails instance to query |
Returns : |
the value of the "id" property |
void folks_abstract_field_details_set_id (FolksAbstractFieldDetails *self
,const gchar *value
);
|
the FolksAbstractFieldDetails instance to modify |
|
the new value of the "id" property |
GeeMultiMap * folks_abstract_field_details_get_parameters
(FolksAbstractFieldDetails *self
);
|
the FolksAbstractFieldDetails instance to query |
Returns : |
the value of the "parameters" property |
void folks_abstract_field_details_set_parameters (FolksAbstractFieldDetails *self
,GeeMultiMap *value
);
|
the FolksAbstractFieldDetails instance to modify |
|
the new value of the "parameters" property |
struct FolksAbstractFieldDetails;
Object representing any type of value that can have some vCard-like parameters associated with it.
Some contact details, like phone numbers or URLs, can have some extra details associated with them. For instance, a phone number expressed in vcard notation as `tel;type=work,voice:(111) 555-1234` would be represented as a AbstractFieldDetails with value "(111) 555-1234" and with parameters `['type': ('work', 'voice')]`.
The parameter name "type" with values "work", "home", or "other" are common amongst most vCard attributes (and thus most AbstractFieldDetails-derived classes). A "type" of "pref" may be used to indicate a preferred "value" amongst many. See specific classes for information on additional parameters and values specific to that class.
See RFC2426 for more details on pre-defined parameter names and values.
Since 0.6.0
"id"
property "id" gchar* : Read / Write
A unique ID (if any) for this specific detail.
This is primarily intended for FolksPersonaStores which need to track specific instances of details (because their backing store is wacky).
In most cases, this will be an empty string.
The content of this is opaque to all but the package which set it.
Default value: NULL
Since 0.6.5
"parameters"
property "parameters" GeeMultiMap* : Read / Write / Construct
The parameters associated with the value.
A multi-map of the parameters associated with "value". The keys are the names of the parameters, while the values are a list of strings.
Since 0.6.0
"value"
property "value" gpointer : Read / Write / Construct
The value of the field.
The value of the field, the exact type and content of which depends on what the structure is used for.
Since 0.6.0
"value-type"
property "value-type" GType* : Read
The GType of the "value".
This is particularly useful for treating collections of different types of
in a uniform way without needing to name them explicitly.folks_abstract_field_details_new()
Allowed values: void
Since 0.6.5