FolksAbstractFieldDetails

FolksAbstractFieldDetails — Object representing any type of value that can have some vCard-like parameters associated with it.

Synopsis

#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;

Object Hierarchy

  GObject
   +----FolksAbstractFieldDetails
         +----FolksEmailFieldDetails
         +----FolksImFieldDetails
         +----FolksNoteFieldDetails
         +----FolksPhoneFieldDetails
         +----FolksPostalAddressFieldDetails
         +----FolksRoleFieldDetails
         +----FolksUrlFieldDetails
         +----FolksWebServiceFieldDetails

Properties

  "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

Description

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.

Details

FOLKS_TYPE_ABSTRACT_FIELD_DETAILS

#define FOLKS_TYPE_ABSTRACT_FIELD_DETAILS (folks_abstract_field_details_get_type ())

The type for FolksAbstractFieldDetails.


folks_abstract_field_details_get_parameter_values ()

GeeCollection *     folks_abstract_field_details_get_parameter_values
                                                        (FolksAbstractFieldDetails *self,
                                                         const gchar *parameter_name);

Get the values for a parameter

self :

the FolksAbstractFieldDetails instance

parameter_name :

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


folks_abstract_field_details_add_parameter ()

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.

self :

the FolksAbstractFieldDetails instance

parameter_name :

the name of the parameter. [in]

parameter_value :

the value to add. [in]

Since 0.6.0


folks_abstract_field_details_set_parameter ()

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.

self :

the FolksAbstractFieldDetails instance

parameter_name :

the name of the parameter. [in]

parameter_value :

the value to add. [in]

Since 0.6.0


folks_abstract_field_details_extend_parameters ()

void                folks_abstract_field_details_extend_parameters
                                                        (FolksAbstractFieldDetails *self,
                                                         GeeMultiMap *additional);

Extend the existing parameters.

Merge the parameters from `additional` into the existing ones.

self :

the FolksAbstractFieldDetails instance

additional :

the parameters to add. [in]

Since 0.6.0


folks_abstract_field_details_remove_parameter_all ()

void                folks_abstract_field_details_remove_parameter_all
                                                        (FolksAbstractFieldDetails *self,
                                                         const gchar *parameter_name);

Remove all instances of a parameter.

self :

the FolksAbstractFieldDetails instance

parameter_name :

the name of the parameter. [in]

Since 0.6.0


folks_abstract_field_details_equal ()

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:

See the description of folks_abstract_field_details_values_equal() for details on the value comparison.

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()

self :

the FolksAbstractFieldDetails instance

that :

another folks_abstract_field_details_new(). [in]

Returns :

whether the elements are equal

Since 0.6.0


folks_abstract_field_details_parameters_equal ()

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()

self :

the FolksAbstractFieldDetails instance

that :

another folks_abstract_field_details_new(). [in]

Returns :

whether the elements' "value"s are equal.

Since 0.6.5


folks_abstract_field_details_values_equal ()

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()

self :

the FolksAbstractFieldDetails instance

that :

another folks_abstract_field_details_new(). [in]

Returns :

whether the elements' "value"s are equal.

Since 0.6.5


folks_abstract_field_details_hash ()

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".

self :

the FolksAbstractFieldDetails instance

Returns :

the hash value

Since 0.6.0


FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE

#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


FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_HOME

#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


FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_WORK

#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


FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE_OTHER

#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


folks_abstract_field_details_get_value ()

gconstpointer       folks_abstract_field_details_get_value
                                                        (FolksAbstractFieldDetails *self);

self :

the FolksAbstractFieldDetails instance to query

Returns :

the value of the "value" property

folks_abstract_field_details_set_value ()

void                folks_abstract_field_details_set_value
                                                        (FolksAbstractFieldDetails *self,
                                                         gconstpointer value);

self :

the FolksAbstractFieldDetails instance to modify

value :

the new value of the "value" property

folks_abstract_field_details_get_value_type ()

GType               folks_abstract_field_details_get_value_type
                                                        (FolksAbstractFieldDetails *self);

self :

the FolksAbstractFieldDetails instance to query

Returns :

the value of the "value-type" property

folks_abstract_field_details_get_id ()

const gchar *       folks_abstract_field_details_get_id (FolksAbstractFieldDetails *self);

self :

the FolksAbstractFieldDetails instance to query

Returns :

the value of the "id" property

folks_abstract_field_details_set_id ()

void                folks_abstract_field_details_set_id (FolksAbstractFieldDetails *self,
                                                         const gchar *value);

self :

the FolksAbstractFieldDetails instance to modify

value :

the new value of the "id" property

folks_abstract_field_details_get_parameters ()

GeeMultiMap *       folks_abstract_field_details_get_parameters
                                                        (FolksAbstractFieldDetails *self);

self :

the FolksAbstractFieldDetails instance to query

Returns :

the value of the "parameters" property

folks_abstract_field_details_set_parameters ()

void                folks_abstract_field_details_set_parameters
                                                        (FolksAbstractFieldDetails *self,
                                                         GeeMultiMap *value);

self :

the FolksAbstractFieldDetails instance to modify

value :

the new value of the "parameters" property

struct FolksAbstractFieldDetails

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

Property Details

The "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


The "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


The "t-destroy-func" property

  "t-destroy-func"           gpointer              : Write / Construct Only

destroy func.


The "t-dup-func" property

  "t-dup-func"               gpointer              : Write / Construct Only

dup func.


The "t-type" property

  "t-type"                   GType*                : Write / Construct Only

type.

Allowed values: void


The "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


The "value-type" property

  "value-type"               GType*                : Read

The GType of the "value".

This is particularly useful for treating collections of different types of folks_abstract_field_details_new() in a uniform way without needing to name them explicitly.

Allowed values: void

Since 0.6.5