## ESourceSelector ESourceSelector |

## Synopsis

    struct              ESourceSelector;
    GtkWidget *         e_source_selector_new               (ESourceList *list);
    ESourceList *       e_source_selector_get_source_list   (ESourceSelector *selector);
    void                e_source_selector_select_source     (ESourceSelector *selector,
                                                             ESource *source);
    void                e_source_selector_unselect_source   (ESourceSelector *selector,
                                                             ESource *source);
    void                e_source_selector_select_exclusive  (ESourceSelector *selector,
                                                             ESource *source);
    gboolean            e_source_selector_source_is_selected
                                                            (ESourceSelector *selector,
                                                             ESource *source);
    GSList *            e_source_selector_get_selection     (ESourceSelector *selector);
    void                e_source_selector_free_selection    (GSList *list);
    void                e_source_selector_show_selection    (ESourceSelector *selector,
                                                             gboolean show);
    gboolean            e_source_selector_selection_shown   (ESourceSelector *selector);
    void                e_source_selector_set_select_new    (ESourceSelector *selector,
                                                             gboolean state);
    void                e_source_selector_edit_primary_selection
                                                            (ESourceSelector *selector);
    ESource *           e_source_selector_get_primary_selection
                                                            (ESourceSelector *selector);
    void                e_source_selector_set_primary_selection
                                                            (ESourceSelector *selector,
                                                             ESource *source);
    ESourceGroup *      e_source_selector_get_primary_source_group
                                                            (ESourceSelector *selector);
    #define             e_source_selector_peek_primary_selection
    ESource *           e_source_selector_get_source_by_path
                                                            (ESourceSelector *selector,
                                                             GtkTreePath *path);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkWidget
                   +----GtkContainer
                         +----GtkTreeView
                               +----ESourceSelector

## Implemented Interfaces

ESourceSelector implements AtkImplementorIface, GtkBuildable and GtkScrollable.

## Properties

      "primary-selection"        ESource*              : Read / Write
      "source-list"              ESourceList*          : Read / Write / Construct Only

## Signals

      "data-dropped"                                   : Run Last
      "popup-event"                                    : Run Last
      "primary-selection-changed"                      : Run Last
      "selection-changed"                              : Run Last

## Description

## Details

### struct ESourceSelector

    struct ESourceSelector;

### e_source_selector_new ()

    GtkWidget *         e_source_selector_new               (ESourceList *list);

Create a new view for `list`. The view will update automatically when `list` changes.

`list` : | A source list.
Returns : | The newly created widget.

### e_source_selector_get_source_list ()

    ESourceList *       e_source_selector_get_source_list   (ESourceSelector *selector);

Returns the ESourceList that `selector` is rendering.

`selector` : | an ESourceSelector
Returns : | an ESourceList

Since 2.24

### e_source_selector_select_source ()

    void                e_source_selector_select_source     (ESourceSelector *selector,
                                                             ESource *source);

Select `source` in `selector`.

`selector` : | An ESourceSelector widget
`source` : | An ESource.

### e_source_selector_unselect_source ()

    void                e_source_selector_unselect_source   (ESourceSelector *selector,
                                                             ESource *source);

Unselect `source` in `selector`.

`selector` : | An ESourceSelector widget
`source` : | An ESource.

### e_source_selector_select_exclusive ()

    void                e_source_selector_select_exclusive  (ESourceSelector *selector,
                                                             ESource *source);

Select `source` in `selector` and unselect all others.

`selector` : | An ESourceSelector widget
`source` : | An ESource.

Since 2.30

### e_source_selector_source_is_selected ()

    gboolean            e_source_selector_source_is_selected
                                                            (ESourceSelector *selector,
                                                             ESource *source);

Check whether `source` is selected in `selector`.

`selector` : | An ESourceSelector widget
`source` : | An ESource.
Returns : | `TRUE` if `source` is currently selected, `FALSE` otherwise.

### e_source_selector_get_selection ()

    GSList *            e_source_selector_get_selection     (ESourceSelector *selector);

Get the list of selected sources, i.e. those that were enabled through the corresponding checkboxes in the tree.

`selector` : | an ESourceSelector
Returns : | A list of the ESources currently selected. The sources will be in the same order as they appear on the screen, and the list should be freed using `e_source_selector_free_selection()`.

### e_source_selector_free_selection ()

    void                e_source_selector_free_selection    (GSList *list);

### e_source_selector_show_selection ()

    void                e_source_selector_show_selection    (ESourceSelector *selector,
                                                             gboolean show);

Specify whether the checkboxes in the ESourceSelector should be shown or not.

`selector` : | An ESourceSelector widget

### e_source_selector_selection_shown ()

    gboolean            e_source_selector_selection_shown   (ESourceSelector *selector);

Check whether the checkboxes in the ESourceSelector are being shown or not.

`selector` : | an ESourceSelector
Returns : | `TRUE` if the checkboxes are shown, `FALSE` otherwise.

### e_source_selector_set_select_new ()

    void                e_source_selector_set_select_new    (ESourceSelector *selector,
                                                             gboolean state);

Set whether or not to select new sources added to `selector`.

`selector` : | An ESourceSelector widget
`state` : | A gboolean

### e_source_selector_edit_primary_selection ()

    void                e_source_selector_edit_primary_selection
                                                            (ESourceSelector *selector);

Allows the user to rename the primary selected source by opening an entry box directly in `selector`.

`selector` : | An ESourceSelector widget

Since 2.26

### e_source_selector_get_primary_selection ()

    ESource *           e_source_selector_get_primary_selection
                                                            (ESourceSelector *selector);

Get the primary selected source. The primary selection is the one that is highlighted through the normal GtkTreeView selection mechanism (as opposed to the "normal" selection, which is the set of source whose checkboxes are checked).

`selector` : | An ESourceSelector widget
Returns : | The selected source.

### e_source_selector_set_primary_selection ()

    void                e_source_selector_set_primary_selection
                                                            (ESourceSelector *selector,
                                                             ESource *source);

Set the primary selected source.

`selector` : | an ESourceSelector widget
`source` : | an ESource to select

### e_source_selector_get_primary_source_group ()

    ESourceGroup *      e_source_selector_get_primary_source_group
                                                            (ESourceSelector *selector);

Gets the primary source group associated with the selector.

`selector` : | an ESourceSelector
Returns : | primary_source_group if selector is valid, NULL otherwise.

### e_source_selector_peek_primary_selection

    #define             e_source_selector_peek_primary_selection

### Warning

`e_source_selector_peek_primary_selection` is deprecated and should not be used in newly-written code.

### e_source_selector_get_source_by_path ()

    ESource *           e_source_selector_get_source_by_path
                                                            (ESourceSelector *selector,
                                                             GtkTreePath *path);

Returns the ESource object at `path`, or `NULL` if `path` is invalid.

`selector` : | an ESourceSelector
`path` : | a GtkTreePath
Returns : | the ESource object at `path`, or `NULL`

Since 3.0

## Property Details

### The `"primary-selection"` property

      "primary-selection"        ESource*              : Read / Write

### The `"source-list"` property

      "source-list"              ESourceList*          : Read / Write / Construct Only

## Signal Details

### The `"data-dropped"` signal

    gboolean            user_function                      (ESourceSelector  *esourceselector,
                                                            GtkSelectionData *arg1,
                                                            ESource          *arg2,
                                                            GdkDragAction     arg3,
                                                            guint             arg4,
                                                            gpointer          user_data)            : Run Last

### The `"popup-event"` signal

    gboolean            user_function                      (ESourceSelector *esourceselector,
                                                            GObject         *arg1,
                                                            GdkEvent        *arg2,
                                                            gpointer         user_data)            : Run Last

### The `"primary-selection-changed"` signal

    void                user_function                      (ESourceSelector *esourceselector,
                                                            gpointer         user_data)            : Run Last

### The `"selection-changed"` signal

    void                user_function                      (ESourceSelector *esourceselector,
                                                            gpointer         user_data)            : Run Last