WockyBareContact

## WockyBareContact WockyBareContact — Wrapper around a roster item. |

## Synopsis

    #include <wocky/wocky-bare-contact.h>

                        WockyBareContactClass;
                        WockyBareContactPrivate;
    WockyBareContact *  wocky_bare_contact_new              (const gchar *jid);
    const gchar *       wocky_bare_contact_get_jid          (WockyBareContact *contact);
    const gchar *       wocky_bare_contact_get_name         (WockyBareContact *contact);
    void                wocky_bare_contact_set_name         (WockyBareContact *contact,
                                                             const gchar *name);
    WockyRosterSubscriptionFlags  wocky_bare_contact_get_subscription
                                                            (WockyBareContact *contact);
    void                wocky_bare_contact_set_subscription (WockyBareContact *contact,
                                                             WockyRosterSubscriptionFlags subscription);
    void                wocky_bare_contact_set_groups       (WockyBareContact *contact,
                                                             gchar **groups);
    gboolean            wocky_bare_contact_equal            (WockyBareContact *a,
                                                             WockyBareContact *b);
    void                wocky_bare_contact_add_group        (WockyBareContact *contact,
                                                             const gchar *group);
    gboolean            wocky_bare_contact_in_group         (WockyBareContact *contact,
                                                             const gchar *group);
    void                wocky_bare_contact_remove_group     (WockyBareContact *contact,
                                                             const gchar *group);
    WockyBareContact *  wocky_bare_contact_copy             (WockyBareContact *contact);
    void                wocky_bare_contact_debug_print      (WockyBareContact *contact);
    void                wocky_bare_contact_add_resource     (WockyBareContact *contact,
                                                             WockyResourceContact *resource);
    GSList *            wocky_bare_contact_get_resources    (WockyBareContact *contact);

## Description

Stores information regarding a roster item and provides a higher level API for altering its details.

## Details

### WockyBareContactClass

    typedef struct {
    } WockyBareContactClass;

The class of a WockyBareContact.

### WockyBareContactPrivate

    typedef struct _WockyBareContactPrivate WockyBareContactPrivate;

### wocky_bare_contact_new ()

    WockyBareContact *  wocky_bare_contact_new              (const gchar *jid);

Creates a new WockyBareContact for a given JID.

`jid` : | the JID of the contact to create
Returns : | a newly constructed WockyBareContact

### wocky_bare_contact_get_jid ()

    const gchar *       wocky_bare_contact_get_jid          (WockyBareContact *contact);

Returns the JID of the contact wrapped by `contact`.

`contact` : | a WockyBareContact instance
Returns : | `contact`'s JID.

### wocky_bare_contact_get_name ()

    const gchar *       wocky_bare_contact_get_name         (WockyBareContact *contact);

Returns the name of the contact wrapped by `contact`.

`contact` : | WockyBareContact instance
Returns : | `contact`'s name

### wocky_bare_contact_set_name ()

    void                wocky_bare_contact_set_name         (WockyBareContact *contact,
                                                             const gchar *name);

Sets `contact`'s name to `name`.

`contact` : | a WockyBareContact instance
`name` : | the name to set `contact`

### wocky_bare_contact_get_subscription ()

    WockyRosterSubscriptionFlags  wocky_bare_contact_get_subscription
                                                            (WockyBareContact *contact);

Gets the subscription type `contact` has.

`contact` : | a WockyBareContact instance
Returns : | `contact`'s subscription.

### wocky_bare_contact_set_subscription ()

    void                wocky_bare_contact_set_subscription (WockyBareContact *contact,
                                                             WockyRosterSubscriptionFlags subscription);

Sets the subscription of `contact`.

`contact` : | a WockyBareContact instance
`subscription` : | the new subscription type

### wocky_bare_contact_set_groups ()

    void                wocky_bare_contact_set_groups       (WockyBareContact *contact,
                                                             gchar **groups);

Sets `contact`'s groups.

`contact` : | a WockyBareContact instance
`groups` : | a list of groups

### wocky_bare_contact_equal ()

    gboolean            wocky_bare_contact_equal            (WockyBareContact *a,
                                                             WockyBareContact *b);

Compares whether two WockyBareContact instances refer to the same roster item.

`a` : | a WockyBareContact instance
`b` : | a WockyBareContact instance to compare with `a`
Returns : | TRUE if the two contacts match.

### wocky_bare_contact_add_group ()

    void                wocky_bare_contact_add_group        (WockyBareContact *contact,
                                                             const gchar *group);

Adds `group` to contact's groups.

`contact` : | a WockyBareContact instance
`group` : | a group

### wocky_bare_contact_in_group ()

    gboolean            wocky_bare_contact_in_group         (WockyBareContact *contact,
                                                             const gchar *group);

Determines whether the given contact is in `group`.

`contact` : | a WockyBareContact instance
`group` : | a group
Returns : | TRUE if the contact is in the given group.

### wocky_bare_contact_remove_group ()

    void                wocky_bare_contact_remove_group     (WockyBareContact *contact,
                                                             const gchar *group);

Removes `group` from the contact's groups.

`contact` : | a WockyBareContact instance
`group` : | a group

### wocky_bare_contact_copy ()

    WockyBareContact *  wocky_bare_contact_copy             (WockyBareContact *contact);

Convenience function to obtain a copy of the given WockyBareContact.

`contact` : | a WockyBareContact instance
Returns : | a newly created WockyBareContact which is a copy of the given one.

### wocky_bare_contact_debug_print ()

    void                wocky_bare_contact_debug_print      (WockyBareContact *contact);

Prints debug information for the given WockyBareContact.

`contact` : | a WockyBareContact instance

### wocky_bare_contact_add_resource ()

    void                wocky_bare_contact_add_resource     (WockyBareContact *contact,
                                                             WockyResourceContact *resource);

Adds `resource` to the contact's resources. The WockyBareContact instance doesn't assume a reference to `resource`.

`contact` : | a WockyBareContact instance
`resource` : | a WockyResourceContact instance

### wocky_bare_contact_get_resources ()

    GSList *            wocky_bare_contact_get_resources    (WockyBareContact *contact);

Gets a GSList of all the contact's resources. You should call g_slist_free on the list when done with it.

`contact` : | a WockyBareContact instance
Returns : | a GSList of WockyResourceContact objects.