FolksAntiLinkable: Reference Manual

## FolksAntiLinkable FolksAntiLinkable — Interface for FolksPersona subclasses from backends which support storage of, anti-linking data. |

## Functions

void | folks_anti_linkable_change_anti_links ()
void | folks_anti_linkable_change_anti_links_finish ()
gboolean | folks_anti_linkable_has_anti_link_with_persona ()
void | folks_anti_linkable_add_anti_links ()
void | folks_anti_linkable_add_anti_links_finish ()
void | folks_anti_linkable_remove_anti_links ()
void | folks_anti_linkable_remove_anti_links_finish ()
void | folks_anti_linkable_add_global_anti_link ()
void | folks_anti_linkable_add_global_anti_link_finish ()
void | folks_anti_linkable_remove_global_anti_link ()
void | folks_anti_linkable_remove_global_anti_link_finish ()
gboolean | folks_anti_linkable_has_global_anti_link ()
GeeSet * | folks_anti_linkable_get_anti_links ()
void | folks_anti_linkable_set_anti_links ()

## Types and Values

| FolksAntiLinkable
struct | FolksAntiLinkableIface

## Description

Anti-links are stored as a set of "uid"s with each FolksPersona (A), specifying that A must not be linked into an FolksIndividual with any of the personas in its anti-links set.

## Functions

### folks_anti_linkable_change_anti_links ()

    void
    folks_anti_linkable_change_anti_links (FolksAntiLinkable *self,
                                           GeeSet *anti_links,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);

Change the FolksPersona's set of anti-links.

It's preferred to call this rather than setting "anti-links" directly, as this method gives error notification and will only return once the anti-links have been written to the relevant backing store (or the operation's failed).

It should be noted that `folks_individual_aggregator_link_personas()` and `folks_individual_aggregator_unlink_individual()` will modify the anti-links sets of the personas they touch, in order to remove and add anti-links, respectively. It is expected that these FolksIndividualAggregator methods will be used to modify anti-links indirectly, rather than calling `folks_anti_linkable_change_anti_links()` directly.

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_change_anti_links_finish()`

#### Parameters

self | the FolksAntiLinkable instance |
anti_links | . the new set of anti-links from this persona . | [in]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

Since: 0.7.3

### folks_anti_linkable_change_anti_links_finish ()

    void
    folks_anti_linkable_change_anti_links_finish
                                   (FolksAntiLinkable *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Change the FolksPersona's set of anti-links.

It's preferred to call this rather than setting "anti-links" directly, as this method gives error notification and will only return once the anti-links have been written to the relevant backing store (or the operation's failed).

It should be noted that `folks_individual_aggregator_link_personas()` and `folks_individual_aggregator_unlink_individual()` will modify the anti-links sets of the personas they touch, in order to remove and add anti-links, respectively. It is expected that these FolksIndividualAggregator methods will be used to modify anti-links indirectly, rather than calling `folks_anti_linkable_change_anti_links()` directly.

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_change_anti_links()`

#### Parameters

self | the FolksAntiLinkable instance |
_res_ | a GAsyncResult |
error | location to store the error occurring, or `NULL` to ignore. | [error-domains FolksPropertyError]

Since: 0.7.3

### folks_anti_linkable_has_anti_link_with_persona ()

    gboolean
    folks_anti_linkable_has_anti_link_with_persona
                                   (FolksAntiLinkable *self,
                                    FolksPersona *other_persona);

Check for an anti-link with another persona.

This will return `true` if `other_persona`'s UID is listed in this persona's anti-links set. Note that this check is not symmetric.

#### Parameters

self | the FolksAntiLinkable instance |
other_persona | . the persona to check is anti-linked . | [in]

#### Returns

`true` if an anti-link exists, `false` otherwise

Since: 0.7.3

### folks_anti_linkable_add_anti_links ()

    void
    folks_anti_linkable_add_anti_links (FolksAntiLinkable *self,
                                        GeeSet *other_personas,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);

Add anti-links to other personas.

The UIDs of all personas in `other_personas` will be added to this persona's anti-links set and the changes propagated to backends.

Any attempt to anti-link a persona with itself is not an error, but is ignored.

This method is safe to call multiple times concurrently (e.g. begin one asynchronous call, then begin another before the first has finished).

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_add_anti_links_finish()`

#### Parameters

self | the FolksAntiLinkable instance |
other_personas | . the personas to anti-link to this one . | [in]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

Since: 0.7.3

### folks_anti_linkable_add_anti_links_finish ()

    void
    folks_anti_linkable_add_anti_links_finish
                                   (FolksAntiLinkable *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Add anti-links to other personas.

The UIDs of all personas in `other_personas` will be added to this persona's anti-links set and the changes propagated to backends.

Any attempt to anti-link a persona with itself is not an error, but is ignored.

This method is safe to call multiple times concurrently (e.g. begin one asynchronous call, then begin another before the first has finished).

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_add_anti_links()`

#### Parameters

self | the FolksAntiLinkable instance |
_res_ | a GAsyncResult |
error | location to store the error occurring, or `NULL` to ignore. | [error-domains FolksPropertyError]

Since: 0.7.3

### folks_anti_linkable_remove_anti_links ()

    void
    folks_anti_linkable_remove_anti_links (FolksAntiLinkable *self,
                                           GeeSet *other_personas,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);

Remove anti-links to other personas.

The UIDs of all personas in `other_personas` will be removed from this persona's anti-links set and the changes propagated to backends.

If the global anti-link is set, this will not have any effect until the global anti-link is removed.

This method is safe to call multiple times concurrently (e.g. begin one asynchronous call, then begin another before the first has finished).

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_remove_anti_links_finish()`

#### Parameters

self | the FolksAntiLinkable instance |
other_personas | . the personas to remove anti-links from this one . | [in]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

Since: 0.7.3

### folks_anti_linkable_remove_anti_links_finish ()

    void
    folks_anti_linkable_remove_anti_links_finish
                                   (FolksAntiLinkable *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Remove anti-links to other personas.

The UIDs of all personas in `other_personas` will be removed from this persona's anti-links set and the changes propagated to backends.

If the global anti-link is set, this will not have any effect until the global anti-link is removed.

This method is safe to call multiple times concurrently (e.g. begin one asynchronous call, then begin another before the first has finished).

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_remove_anti_links()`

#### Parameters

self | the FolksAntiLinkable instance |
_res_ | a GAsyncResult |
error | location to store the error occurring, or `NULL` to ignore. | [error-domains FolksPropertyError]

Since: 0.7.3

### folks_anti_linkable_add_global_anti_link ()

    void
    folks_anti_linkable_add_global_anti_link
                                   (FolksAntiLinkable *self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);

Prevent persona from being linked with any other personas

This function will add a wildcard `*` to the set of anti-links, which will prevent the persona from being linked with any other personas.

To make the persona linkable again you need to remove the global anti-link

This method is safe to call multiple times concurrently (e.g. begin one asynchronous call, then begin another before the first has finished).

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_add_global_anti_link_finish()`

#### Parameters

self | the FolksAntiLinkable instance |
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

Since: 0.9.7

### folks_anti_linkable_add_global_anti_link_finish ()

    void
    folks_anti_linkable_add_global_anti_link_finish
                                   (FolksAntiLinkable *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Prevent persona from being linked with any other personas

This function will add a wildcard `*` to the set of anti-links, which will prevent the persona from being linked with any other personas.

To make the persona linkable again you need to remove the global anti-link

This method is safe to call multiple times concurrently (e.g. begin one asynchronous call, then begin another before the first has finished).

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_add_global_anti_link()`

#### Parameters

self | the FolksAntiLinkable instance |
_res_ | a GAsyncResult |
error | location to store the error occurring, or `NULL` to ignore. | [error-domains FolksPropertyError]

Since: 0.9.7

### folks_anti_linkable_remove_global_anti_link ()

    void
    folks_anti_linkable_remove_global_anti_link
                                   (FolksAntiLinkable *self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);

Allow persona to be linked with other personas

This function removes the wildcard `*` from the set of anti-links, allowing the persona to be linked again.

This method is safe to call multiple times concurrently (e.g. begin one asynchronous call, then begin another before the first has finished).

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_remove_global_anti_link_finish()`

#### Parameters

self | the FolksAntiLinkable instance |
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

Since: 0.9.7

### folks_anti_linkable_remove_global_anti_link_finish ()

    void
    folks_anti_linkable_remove_global_anti_link_finish
                                   (FolksAntiLinkable *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Allow persona to be linked with other personas

This function removes the wildcard `*` from the set of anti-links, allowing the persona to be linked again.

This method is safe to call multiple times concurrently (e.g. begin one asynchronous call, then begin another before the first has finished).

FolksPropertyError will be returned in `error`

if setting the anti-links failed

See also: `folks_anti_linkable_remove_global_anti_link()`

#### Parameters

self | the FolksAntiLinkable instance |
_res_ | a GAsyncResult |
error | location to store the error occurring, or `NULL` to ignore. | [error-domains FolksPropertyError]

Since: 0.9.7

### folks_anti_linkable_has_global_anti_link ()

    gboolean
    folks_anti_linkable_has_global_anti_link
                                   (FolksAntiLinkable *self);

Check if the persona has a global anti link.

If the persona has global anti link this means that the persona can not be linked with any other persona.

#### Parameters

self | the FolksAntiLinkable instance |

Since: 0.9.7

### folks_anti_linkable_get_anti_links ()

    GeeSet *
    folks_anti_linkable_get_anti_links (FolksAntiLinkable *self);

Get and return the current value of the "anti-links" property.

UIDs of anti-linked FolksPersonas.

The FolksPersonas identified by their UIDs in this set are guaranteed to not be linked to this FolksPersona, even if their linkable properties match.

No UIDs may be `null`. Well-formed but non-existent UIDs (i.e. UIDs which can be successfully parsed, but which don't currently correspond to a FolksPersona instance) are permitted, as personas may appear and disappear over time.

The special UID `*` is used as a wildcard to mark the persona as globally anti-linked. See `folks_anti_linkable_has_global_anti_link()`.

It is expected, but not guaranteed, that anti-links made between personas will be reciprocal. That is, if persona A lists persona B's UID in its "anti-links" set, persona B will typically also list persona A in its anti-links set.

#### Parameters

self | the FolksAntiLinkable instance to query |

#### Returns

the value of the "anti-links" property

Since: 0.7.3

### folks_anti_linkable_set_anti_links ()

    void
    folks_anti_linkable_set_anti_links (FolksAntiLinkable *self,
                                        GeeSet *value);

Set the value of the "anti-links" property to `value` .

UIDs of anti-linked FolksPersonas.

The FolksPersonas identified by their UIDs in this set are guaranteed to not be linked to this FolksPersona, even if their linkable properties match.

No UIDs may be `null`. Well-formed but non-existent UIDs (i.e. UIDs which can be successfully parsed, but which don't currently correspond to a FolksPersona instance) are permitted, as personas may appear and disappear over time.

The special UID `*` is used as a wildcard to mark the persona as globally anti-linked. See `folks_anti_linkable_has_global_anti_link()`.

It is expected, but not guaranteed, that anti-links made between personas will be reciprocal. That is, if persona A lists persona B's UID in its "anti-links" set, persona B will typically also list persona A in its anti-links set.

#### Parameters

self | the FolksAntiLinkable instance to modify |
value | the new value of the "anti-links" property |

Since: 0.7.3

## Types and Values

### FolksAntiLinkable

    typedef struct _FolksAntiLinkable FolksAntiLinkable;

Interface for FolksPersona subclasses from backends which support storage of, anti-linking data.

Anti-links are stored as a set of "uid"s with each FolksPersona (A), specifying that A must not be linked into an FolksIndividual with any of the personas in its anti-links set.

Since: 0.7.3

### struct FolksAntiLinkableIface

    struct FolksAntiLinkableIface {
    	GTypeInterface parent_iface;
    	void (*change_anti_links) (FolksAntiLinkable* self, GeeSet* anti_links, GAsyncReadyCallback _callback_, gpointer _user_data_);
    	void (*change_anti_links_finish) (FolksAntiLinkable* self, GAsyncResult* _res_, GError** error);
    	GeeSet* (*get_anti_links) (FolksAntiLinkable* self);
    	void (*set_anti_links) (FolksAntiLinkable* self, GeeSet* value);
    };

Interface for creating FolksAntiLinkable implementations.

#### Members

GTypeInterface `parent_iface`; | the parent interface structure |
`change_anti_links` () | virtual method called by `folks_anti_linkable_change_anti_links()` |
`change_anti_links_finish` () | asynchronous finish function for `change_anti_links`, called by `folks_anti_linkable_change_anti_links()` |
`get_anti_links` () | getter method for the abstract property "anti-links" |
`set_anti_links` () | setter method for the abstract property "anti-links" |