## ESourceSelector

ESourceSelector

## Synopsis

    struct              ESourceSelector;
    GtkWidget *         e_source_selector_new               (ESourceRegistry *registry,
                                                             const gchar *extension_name);
    ESourceRegistry *   e_source_selector_get_registry      (ESourceSelector *selector);
    const gchar *       e_source_selector_get_extension_name
                                                            (ESourceSelector *selector);
    gboolean            e_source_selector_get_show_colors   (ESourceSelector *selector);
    void                e_source_selector_set_show_colors   (ESourceSelector *selector,
                                                             gboolean show_colors);
    gboolean            e_source_selector_get_show_toggles  (ESourceSelector *selector);
    void                e_source_selector_set_show_toggles  (ESourceSelector *selector,
                                                             gboolean show_toggles);
    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_set_select_new    (ESourceSelector *selector,
                                                             gboolean state);
    void                e_source_selector_edit_primary_selection
                                                            (ESourceSelector *selector);
    ESource *           e_source_selector_ref_primary_selection
                                                            (ESourceSelector *selector);
    void                e_source_selector_set_primary_selection
                                                            (ESourceSelector *selector,
                                                             ESource *source);
    ESource *           e_source_selector_ref_source_by_path
                                                            (ESourceSelector *selector,
                                                             GtkTreePath *path);
    void                e_source_selector_queue_write       (ESourceSelector *selector,
                                                             ESource *source);

## Object Hierarchy

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

## Implemented Interfaces

ESourceSelector implements AtkImplementorIface, GtkBuildable and GtkScrollable.

## Properties

      "extension-name"           gchar*                : Read / Write / Construct Only
      "primary-selection"        ESource*              : Read / Write
      "registry"                 ESourceRegistry*      : Read / Write / Construct Only
      "show-colors"              gboolean              : Read / Write
      "show-toggles"             gboolean              : Read / Write

## 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               (ESourceRegistry *registry,
                                                             const gchar *extension_name);

Displays a list of sources from `registry` having an extension named `extension_name`. The sources are grouped by backend or groupware account, which are described by the parent source.

`registry` : | an ESourceRegistry
`extension_name` : | the name of an ESource extension
Returns : | a new ESourceSelector

### e_source_selector_get_registry ()

    ESourceRegistry *   e_source_selector_get_registry      (ESourceSelector *selector);

Returns the ESourceRegistry that `selector` is getting sources from.

`selector` : | an ESourceSelector
Returns : | an ESourceRegistry

Since 3.6

### e_source_selector_get_extension_name ()

    const gchar *       e_source_selector_get_extension_name
                                                            (ESourceSelector *selector);

Returns the extension name used to filter which sources are displayed.

`selector` : | an ESourceSelector
Returns : | the ESource extension name

Since 3.6

### e_source_selector_get_show_colors ()

    gboolean            e_source_selector_get_show_colors   (ESourceSelector *selector);

Returns whether colors are shown next to data sources.

`selector` : | an ESourceSelector
Returns : | `TRUE` if colors are being shown

Since 3.6

### e_source_selector_set_show_colors ()

    void                e_source_selector_set_show_colors   (ESourceSelector *selector,
                                                             gboolean show_colors);

Sets whether to show colors next to data sources.

`selector` : | an ESourceSelector
`show_colors` : | whether to show colors

Since 3.6

### e_source_selector_get_show_toggles ()

    gboolean            e_source_selector_get_show_toggles  (ESourceSelector *selector);

Returns whether toggles are shown next to data sources.

`selector` : | an ESourceSelector
Returns : | `TRUE` if toggles are being shown

Since 3.6

### e_source_selector_set_show_toggles ()

    void                e_source_selector_set_show_toggles  (ESourceSelector *selector,
                                                             gboolean show_toggles);

Sets whether to show toggles next to data sources.

`selector` : | an ESourceSelector
`show_toggles` : | whether to show toggles

Since 3.6

### 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_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_ref_primary_selection ()

    ESource *           e_source_selector_ref_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).

The returned ESource is referenced for thread-safety and must be unreferenced with `g_object_unref()` when finished with it.

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

Since 3.6

### e_source_selector_set_primary_selection ()

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

Highlights `source` in `selector`. The highlighted ESource is called the primary selection.

Do not confuse this function with `e_source_selector_select_source()`, which activates the check box next to an ESource's display name in `selector`. This function does not alter the check box.

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

### e_source_selector_ref_source_by_path ()

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

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

The returned ESource is referenced for thread-safety and must be unreferenced with `g_object_unref()` when finished with it.

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

Since 3.6

### e_source_selector_queue_write ()

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

Queues a main loop idle callback to write changes to `source` back to the D-Bus registry service.

`selector` : | an ESourceSelecetor
`source` : | an ESource with changes to be written

Since 3.6

## Property Details

### The `"extension-name"` property

      "extension-name"           gchar*                : Read / Write / Construct Only

Default value: NULL

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

      "primary-selection"        ESource*              : Read / Write

### The `"registry"` property

      "registry"                 ESourceRegistry*      : Read / Write / Construct Only

### The `"show-colors"` property

      "show-colors"              gboolean              : Read / Write

Default value: TRUE

### The `"show-toggles"` property

      "show-toggles"             gboolean              : Read / Write

Default value: TRUE

## 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