SharingAccount

SharingAccount — A sharing account defined by a user.

Synopsis

void                sharing_account_free                (SharingAccount *self);
gboolean            sharing_account_set_param           (const SharingAccount *self,
                                                         const gchar *key,
                                                         const gchar *value);
gchar*              sharing_account_get_param           (const SharingAccount *self,
                                                         const gchar *key);
#define             sharing_account_set_username        (self,value)
#define             sharing_account_get_username        (self)
#define             sharing_account_set_password        (self,value)
#define             sharing_account_get_password        (self)
gboolean            sharing_account_set_option_values   (const SharingAccount *self,
                                                         const gchar *key,
                                                         const GSList *values);

Description

SharingAccount contains user-defined information, including a username and password, as well as optional extra parameters.

Details

sharing_account_free ()

void                sharing_account_free                (SharingAccount *self);

Frees memory from the list of SharingAccounts.

self : the SharingAccount to free

sharing_account_set_param ()

gboolean            sharing_account_set_param           (const SharingAccount *self,
                                                         const gchar *key,
                                                         const gchar *value);

Set a parameter value of a SharingAccount, and update the old value if the key already exists.

self : a SharingAccount
key : the parameter
value : the parameter value to be set, or NULL to unset
Returns : TRUE if self, key and value are != NULL and the parameter was successfully set, FALSE otherwise

sharing_account_get_param ()

gchar*              sharing_account_get_param           (const SharingAccount *self,
                                                         const gchar *key);

Get a parameter value of a SharingAccount.

self : a SharingAccount
key : the parameter
Returns : a newly-allocated parameter value, if self and key are != NULL and the key is found, or NULL otherwise. The string must be freed with g_free() when it is no longer needed.

sharing_account_set_username()

#define             sharing_account_set_username(self,value)

Macro for setting the username to account.

self : Used SharingAccount.
value : Username to set.

sharing_account_get_username()

#define             sharing_account_get_username(self)

Macro for getting the username from account.

self : Used SharingAccount.
Returns : Username as gchar*.

sharing_account_set_password()

#define             sharing_account_set_password(self,value)

Macro for setting the password to account.

self : Used SharingAccount.
value : Password to set.

sharing_account_get_password()

#define             sharing_account_get_password(self)

Macro for getting the username from account.

Returns : Password as gchar*

sharing_account_set_option_values ()

gboolean            sharing_account_set_option_values   (const SharingAccount *self,
                                                         const gchar *key,
                                                         const GSList *values);

Set updatable option values of a SharingAccount.

self : a SharingAccount
key : a parameter
values : a GSList of SharingServiceOptionValue to be stored
Returns : TRUE on success, FALSE otherwise