## EAccountList

EAccountList

## Synopsis

    struct              EAccountList;
    enum                e_account_find_t;
    EAccountList *      e_account_list_new                  (GConfClient *client);
    void                e_account_list_construct            (EAccountList *account_list,
                                                             GConfClient *client);
    void                e_account_list_save                 (EAccountList *account_list);
    void                e_account_list_add                  (EAccountList *account_list,
                                                             EAccount *account);
    void                e_account_list_change               (EAccountList *account_list,
                                                             EAccount *account);
    void                e_account_list_remove               (EAccountList *account_list,
                                                             EAccount *account);
    const EAccount *    e_account_list_get_default          (EAccountList *account_list);
    void                e_account_list_set_default          (EAccountList *account_list,
                                                             EAccount *account);
    const EAccount *    e_account_list_find                 (EAccountList *account_list,
                                                             e_account_find_t type,
                                                             const gchar *key);
    void                e_account_list_prune_proxies        (EAccountList *account_list);
    void                e_account_list_remove_account_proxies
                                                            (EAccountList *account_list,
                                                             EAccount *account);
    gboolean            e_account_list_account_has_proxies  (EAccountList *account_list,
                                                             EAccount *account);

## Object Hierarchy

      GObject
       +----EList
             +----EAccountList

## Signals

      "account-added"                                  : Run Last
      "account-changed"                                : Run Last
      "account-removed"                                : Run Last

## Description

## Details

### struct EAccountList

    struct EAccountList;

Contains only private data that should be read and manipulated using the functions below.

### enum e_account_find_t

    typedef enum {
    	E_ACCOUNT_FIND_NAME,
    	E_ACCOUNT_FIND_UID,
    	E_ACCOUNT_FIND_ID_NAME,
    	E_ACCOUNT_FIND_ID_ADDRESS,
    	E_ACCOUNT_FIND_PARENT_UID
    } e_account_find_t;

### e_account_list_new ()

    EAccountList *      e_account_list_new                  (GConfClient *client);

Reads the list of accounts from `client` and listens for changes. Will emit `account_added`, `account_changed`, and `account_removed` signals according to notifications from GConf.

You can modify the list using `e_list_append()`, `e_list_remove()`, and `e_iterator_delete()`. After adding, removing, or changing accounts, you must call `e_account_list_save()` to push the changes back to GConf.

`client` : | a GConfClient
Returns : | the list of accounts

### e_account_list_construct ()

    void                e_account_list_construct            (EAccountList *account_list,
                                                             GConfClient *client);

### e_account_list_save ()

    void                e_account_list_save                 (EAccountList *account_list);

Saves `account_list` to GConf. Signals will be emitted for changes.

`account_list` : | an EAccountList

### e_account_list_add ()

    void                e_account_list_add                  (EAccountList *account_list,
                                                             EAccount *account);

Adds `account` to `account_list` and emits the "account-added" signal.

`account_list` : | an EAccountList
`account` : | an EAccount

### e_account_list_change ()

    void                e_account_list_change               (EAccountList *account_list,
                                                             EAccount *account);

Emits the "account-changed" signal.

`account_list` : | an EAccountList
`account` : | an EAccount

### e_account_list_remove ()

    void                e_account_list_remove               (EAccountList *account_list,
                                                             EAccount *account);

Removes `account` from `account` list, and emits the "account-removed" signal. If `account` was the default account, then the first account in `account_list` becomes the new default.

`account_list` : | an EAccountList
`account` : | an EAccount

### e_account_list_get_default ()

    const EAccount *    e_account_list_get_default          (EAccountList *account_list);

Get the default EAccount. If no default is specified, or the default has become stale, then the first account is made the default.

`account_list` : | an EAccountList
Returns : | the default EAccount, or `NULL` if no accounts are defined.

### e_account_list_set_default ()

    void                e_account_list_set_default          (EAccountList *account_list,
                                                             EAccount *account);

Set the `account` to be the default account in `account_list`.

`account_list` : | an EAccountList
`account` : | an EAccount

### e_account_list_find ()

    const EAccount *    e_account_list_find                 (EAccountList *account_list,
                                                             e_account_find_t type,
                                                             const gchar *key);

Perform a search of `account_list` on a single key.

`type` must be set from one of the following search types: E_ACCOUNT_FIND_NAME - Find an account by account name. E_ACCOUNT_FIND_ID_NAME - Find an account by the owner's identity name. E_ACCOUNT_FIND_ID_ADDRESS - Find an account by the owner's identity address.

`account_list` : | an EAccountList
`type` : | type of search
`key` : | the search key
Returns : | The account or `NULL` if it doesn't exist.

### e_account_list_prune_proxies ()

    void                e_account_list_prune_proxies        (EAccountList *account_list);

### e_account_list_remove_account_proxies ()

    void                e_account_list_remove_account_proxies
                                                            (EAccountList *account_list,
                                                             EAccount *account);

### e_account_list_account_has_proxies ()

    gboolean            e_account_list_account_has_proxies  (EAccountList *account_list,
                                                             EAccount *account);

## Signal Details

### The `"account-added"` signal

    void                user_function                      (EAccountList *eaccountlist,
                                                            EAccount     *arg1,
                                                            gpointer      user_data)         : Run Last

`eaccountlist` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"account-changed"` signal

    void                user_function                      (EAccountList *eaccountlist,
                                                            EAccount     *arg1,
                                                            gpointer      user_data)         : Run Last

`eaccountlist` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"account-removed"` signal

    void                user_function                      (EAccountList *eaccountlist,
                                                            EAccount     *arg1,
                                                            gpointer      user_data)         : Run Last

`eaccountlist` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.