FolksExtendedFieldDetails

FolksExtendedFieldDetails — Object representing an arbitrary field that can have some parameters associated with it. This is intended to be as general-purpose as, for example, a vCard property. See the documentation for FolksExtendedInfo for information on when using this object is appropriate.

Functions

Types and Values

Description

See FolksAbstractFieldDetails for details on common parameter names and values.

Functions

folks_extended_field_details_new ()

FolksExtendedFieldDetails *
folks_extended_field_details_new (const gchar *value,
                                  GeeMultiMap *parameters);

Create a new ExtendedFieldDetails.

Parameters

value

 .

the value of the field, which may be the empty string

.

[in]

parameters

 .

initial parameters. See "parameters". A null value is equivalent to an empty map of parameters.

.

[in][allow-none]

Returns

a new ExtendedFieldDetails

Since: 0.11.0

folks_extended_info_get_extended_field ()

FolksExtendedFieldDetails *
folks_extended_info_get_extended_field
                               (FolksExtendedInfo *self,
                                const gchar *name);

Retrieve the value for an arbitrary field.

Parameters

self

the FolksExtendedInfo instance

 

name

 

 

Returns

The value of the extended field, which may be empty, or `null` if the field is not set

Since: 0.11.0

folks_extended_info_change_extended_field ()

void
folks_extended_info_change_extended_field
                               (FolksExtendedInfo *self,
                                const gchar *name,
                                FolksExtendedFieldDetails *value,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);

Change the value of an arbitrary field.

FolksPropertyError will be returned in error

if setting the value failed

See also: folks_extended_info_change_extended_field_finish()

Parameters

self

the FolksExtendedInfo instance

 

name

 .

name of the arbitrary field to change value

.

[in]

value

 .

new value for the arbitrary field

.

[in]

_callback_

callback to call when the request is satisfied.

[scope async]

_user_data_

the data to pass to _callback_ function.

[closure]

Since: 0.11.0

folks_extended_info_change_extended_field_finish ()

void
folks_extended_info_change_extended_field_finish
                               (FolksExtendedInfo *self,
                                GAsyncResult *_res_,
                                GError **error);

Change the value of an arbitrary field.

FolksPropertyError will be returned in error

if setting the value failed

See also: folks_extended_info_change_extended_field()

Parameters

self

the FolksExtendedInfo instance

 

_res_

a GAsyncResult

 

error

location to store the error occurring, or NULL to ignore.

[error-domains FolksPropertyError]

Since: 0.11.0

folks_extended_info_remove_extended_field ()

void
folks_extended_info_remove_extended_field
                               (FolksExtendedInfo *self,
                                const gchar *name,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);

Remove an arbitrary field.

FolksPropertyError will be returned in error

if removing the property failed

See also: folks_extended_info_remove_extended_field_finish()

Parameters

self

the FolksExtendedInfo instance

 

name

 .

name of the arbitrary field to remove

.

[in]

_callback_

callback to call when the request is satisfied.

[scope async]

_user_data_

the data to pass to _callback_ function.

[closure]

Since: 0.11.0

folks_extended_info_remove_extended_field_finish ()

void
folks_extended_info_remove_extended_field_finish
                               (FolksExtendedInfo *self,
                                GAsyncResult *_res_,
                                GError **error);

Remove an arbitrary field.

FolksPropertyError will be returned in error

if removing the property failed

See also: folks_extended_info_remove_extended_field()

Parameters

self

the FolksExtendedInfo instance

 

_res_

a GAsyncResult

 

error

location to store the error occurring, or NULL to ignore.

[error-domains FolksPropertyError]

Since: 0.11.0

Types and Values

FOLKS_TYPE_EXTENDED_FIELD_DETAILS

#define FOLKS_TYPE_EXTENDED_FIELD_DETAILS (folks_extended_field_details_get_type ())

The type for FolksExtendedFieldDetails.

struct FolksExtendedFieldDetails

struct FolksExtendedFieldDetails {
	FolksAbstractFieldDetails parent_instance;
	FolksExtendedFieldDetailsPrivate * priv;
};

Object representing an arbitrary field that can have some parameters associated with it. This is intended to be as general-purpose as, for example, a vCard property. See the documentation for FolksExtendedInfo for information on when using this object is appropriate.

See FolksAbstractFieldDetails for details on common parameter names and values.

Since: 0.11.0

struct FolksExtendedFieldDetailsClass

struct FolksExtendedFieldDetailsClass {
	FolksAbstractFieldDetailsClass parent_class;
};

The class structure for FOLKS_TYPE_EXTENDED_FIELD_DETAILS. All the fields in this structure are private and should never be accessed directly.

Members

FolksExtendedInfo

typedef struct _FolksExtendedInfo FolksExtendedInfo;

Arbitrary field interface.

This interface allows clients to store arbitrary fields for contacts in backends that support it.

This interface should be used for application-specific data, in which case the application should use the vCard approach to prefixing non-standard property names: `X-[APPLICATION NAME]-*’. Note that this is a global namespace, shared between all consumers of the backend’s data, so please namespace application-specific data with the application’s name.

This interface should not be used for more general-purpose data which could be better represented with a type-safe interface implemented in libfolks. It must not be used for data which is already represented with a type-safe interface in libfolks.

A good example of data which could be stored on this interface is an e-mail application’s setting of whether a content prefers to receive HTML or plaintext e-mail.

A good example of data which should not be stored on this interface is a contact’s anniversary. That should be added in a separate interface in libfolks.

Since: 0.11.0

struct FolksExtendedInfoIface

struct FolksExtendedInfoIface {
	GTypeInterface parent_iface;
	FolksExtendedFieldDetails* (*get_extended_field) (FolksExtendedInfo* self, const gchar* name);
	void (*change_extended_field) (FolksExtendedInfo* self, const gchar* name, FolksExtendedFieldDetails* value, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*change_extended_field_finish) (FolksExtendedInfo* self, GAsyncResult* _res_, GError** error);
	void (*remove_extended_field) (FolksExtendedInfo* self, const gchar* name, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*remove_extended_field_finish) (FolksExtendedInfo* self, GAsyncResult* _res_, GError** error);
};

Interface for creating FolksExtendedInfo implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

get_extended_field ()

virtual method called by folks_extended_info_get_extended_field()

 

change_extended_field ()

virtual method called by folks_extended_info_change_extended_field()

 

change_extended_field_finish ()

asynchronous finish function for change_extended_field, called by folks_extended_info_change_extended_field()

 

remove_extended_field ()

virtual method called by folks_extended_info_remove_extended_field()

 

remove_extended_field_finish ()

asynchronous finish function for remove_extended_field, called by folks_extended_info_remove_extended_field()