## EmpathyAccountChooser

EmpathyAccountChooser — A widget used to choose from a list of accounts

## Synopsis

    #include <libempathy-gtk/empathy-account-chooser.h>

    gboolean            (*EmpathyAccountChooserFilterFunc)  (EmpathyAccount *account,
                                                             gpointer user_data);
                        EmpathyAccountChooser;
    GtkWidget *         empathy_account_chooser_new         (void);
    EmpathyAccount *    empathy_account_chooser_dup_account (EmpathyAccountChooser *chooser);
    TpConnection *      empathy_account_chooser_get_connection
                                                            (EmpathyAccountChooser *chooser);
    gboolean            empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
                                                             EmpathyAccount *account);
    gboolean            empathy_account_chooser_get_has_all_option
                                                            (EmpathyAccountChooser *chooser);
    void                empathy_account_chooser_set_has_all_option
                                                            (EmpathyAccountChooser *chooser,
                                                             gboolean has_all_option);
    void                empathy_account_chooser_set_filter  (EmpathyAccountChooser *chooser,
                                                             EmpathyAccountChooserFilterFunc filter,
                                                             gpointer user_data);
    gboolean            empathy_account_chooser_filter_is_connected
                                                            (EmpathyAccount *account,
                                                             gpointer user_data);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkBin
                                     +----GtkComboBox
                                           +----EmpathyAccountChooser

## Implemented Interfaces

EmpathyAccountChooser implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.

## Properties

      "has-all-option"           gboolean              : Read / Write

## Description

EmpathyAccountChooser is a widget which extends GtkComboBox to provide a chooser of available accounts.

## Details

### EmpathyAccountChooserFilterFunc ()

    gboolean            (*EmpathyAccountChooserFilterFunc)  (EmpathyAccount *account,
                                                             gpointer user_data);

A function which decides whether the account indicated by `account` is visible.

`account` : | an EmpathyAccount
`user_data` : | user data, or `NULL`
Returns : | whether the account indicated by `account` is visible.

### EmpathyAccountChooser

    typedef struct _EmpathyAccountChooser EmpathyAccountChooser;

Widget which extends GtkComboBox to provide a chooser of available accounts.

### empathy_account_chooser_new ()

    GtkWidget *         empathy_account_chooser_new         (void);

Creates a new EmpathyAccountChooser.

Returns : | A new EmpathyAccountChooser

### empathy_account_chooser_dup_account ()

    EmpathyAccount *    empathy_account_chooser_dup_account (EmpathyAccountChooser *chooser);

Returns the account which is currently selected in the chooser or `NULL` if there is no account selected. The EmpathyAccount returned should be unrefed with `g_object_unref()` when finished with.

`chooser` : | an EmpathyAccountChooser
Returns : | a new ref to the EmpathyAccount currently selected, or `NULL`.

### empathy_account_chooser_get_connection ()

    TpConnection *      empathy_account_chooser_get_connection
                                                            (EmpathyAccountChooser *chooser);

Returns a borrowed reference to the TpConnection associated with the account currently selected. The caller must reference the returned object with `g_object_ref()` if it will be kept

`chooser` : | an EmpathyAccountChooser
Returns : | a borrowed reference to the TpConnection associated with the account curently selected.

### empathy_account_chooser_set_account ()

    gboolean            empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
                                                             EmpathyAccount *account);

Sets the currently selected account to `account`, if it exists in the list.

`chooser` : | an EmpathyAccountChooser
`account` : | an EmpathyAccount
Returns : | whether the chooser was set to `account`.

### empathy_account_chooser_get_has_all_option ()

    gboolean            empathy_account_chooser_get_has_all_option
                                                            (EmpathyAccountChooser *chooser);

Returns whether `chooser` has the "has-all-option" property set to true.

`chooser` : | an EmpathyAccountChooser
Returns : | whether `chooser` has the "has-all-option" property enabled.

### empathy_account_chooser_set_has_all_option ()

    void                empathy_account_chooser_set_has_all_option
                                                            (EmpathyAccountChooser *chooser,
                                                             gboolean has_all_option);

Sets the "has-all-option" property.

`chooser` : | an EmpathyAccountChooser
`has_all_option` : | a new value for the "has-all-option" property

### empathy_account_chooser_set_filter ()

    void                empathy_account_chooser_set_filter  (EmpathyAccountChooser *chooser,
                                                             EmpathyAccountChooserFilterFunc filter,
                                                             gpointer user_data);

Sets a filter on the `chooser` so only accounts that are `TRUE` in the eyes of the filter are visible in the `chooser`.

`chooser` : | an EmpathyAccountChooser
`filter` : | a filter
`user_data` : | data to pass to `filter`, or `NULL`

### empathy_account_chooser_filter_is_connected ()

    gboolean            empathy_account_chooser_filter_is_connected
                                                            (EmpathyAccount *account,
                                                             gpointer user_data);

A useful EmpathyAccountChooserFilterFunc that one could pass into `empathy_account_chooser_set_filter()` and only show connected accounts.

`account` : | an EmpathyAccount
`user_data` : | user data or `NULL`
Returns : | Whether `account` is connected

## Property Details

### The `"has-all-option"` property

      "has-all-option"           gboolean              : Read / Write

Have an additional option in the list to mean all accounts.

Default value: FALSE