ChamplainSelectionLayer

## ChamplainSelectionLayer ChamplainSelectionLayer — A container for ChamplainMarker supporting selection |

## Synopsis

    enum                ChamplainSelectionMode;
                        ChamplainSelectionLayer;
    ChamplainLayer *    champlain_selection_layer_new       (void);
    void                champlain_selection_layer_set_selection_mode
                                                            (ChamplainSelectionLayer *layer,
                                                             ChamplainSelectionMode mode);
    ChamplainSelectionMode  champlain_selection_layer_get_selection_mode
                                                            (ChamplainSelectionLayer *layer);
    void                champlain_selection_layer_select    (ChamplainSelectionLayer *layer,
                                                             ChamplainBaseMarker *marker);
    void                champlain_selection_layer_unselect  (ChamplainSelectionLayer *layer,
                                                             ChamplainBaseMarker *marker);
    void                champlain_selection_layer_select_all
                                                            (ChamplainSelectionLayer *layer);
    void                champlain_selection_layer_unselect_all
                                                            (ChamplainSelectionLayer *layer);
    gboolean            champlain_selection_layer_marker_is_selected
                                                            (ChamplainSelectionLayer *layer,
                                                             ChamplainBaseMarker *marker);
    ChamplainBaseMarker * champlain_selection_layer_get_selected
                                                            (ChamplainSelectionLayer *layer);
    const GList *       champlain_selection_layer_get_selected_markers
                                                            (ChamplainSelectionLayer *layer);
    guint               champlain_selection_layer_count_selected_markers
                                                            (ChamplainSelectionLayer *layer);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActor
                   +----ClutterGroup
                         +----ChamplainLayer
                               +----ChamplainSelectionLayer

## Implemented Interfaces

ChamplainSelectionLayer implements ClutterScriptable and ClutterContainer.

## Properties

      "selection-mode"           ChamplainSelectionMode  : Read / Write

## Signals

      "changed"                                        : Run Last

## Description

A ChamplainSelectionLayer is little more than a ChamplainLayer. The markers can be selected.

## Details

### enum ChamplainSelectionMode

    typedef enum {
      CHAMPLAIN_SELECTION_NONE,
      CHAMPLAIN_SELECTION_SINGLE,
      CHAMPLAIN_SELECTION_MULTIPLE
    } ChamplainSelectionMode;

Selection mode

`CHAMPLAIN_SELECTION_NONE` | No marker can be selected.
`CHAMPLAIN_SELECTION_SINGLE` | Only one marker can be selected.
`CHAMPLAIN_SELECTION_MULTIPLE` | Multiple marker can be selected.

### ChamplainSelectionLayer

    typedef struct _ChamplainSelectionLayer ChamplainSelectionLayer;

### champlain_selection_layer_new ()

    ChamplainLayer *    champlain_selection_layer_new       (void);

Returns : | a new ChamplainSelectionLayer ready to be used as a ClutterContainer for the markers.

Since 0.4

### champlain_selection_layer_set_selection_mode ()

    void                champlain_selection_layer_set_selection_mode
                                                            (ChamplainSelectionLayer *layer,
                                                             ChamplainSelectionMode mode);

Sets the selection mode of the layer.

NOTE: changing selection mode to CHAMPLAIN_SELECTION_NONE or CHAMPLAIN_SELECTION_SINGLE will clear all previously selected markers.

`layer` : | a ChamplainSelectionLayer
`mode` : | a ChamplainSelectionMode value

Since 0.4

### champlain_selection_layer_get_selection_mode ()

    ChamplainSelectionMode  champlain_selection_layer_get_selection_mode
                                                            (ChamplainSelectionLayer *layer);

`layer` : | a ChamplainSelectionLayer
Returns : | the selection mode of the layer.

Since 0.4

### champlain_selection_layer_select ()

    void                champlain_selection_layer_select    (ChamplainSelectionLayer *layer,
                                                             ChamplainBaseMarker *marker);

Selects the marker.

`layer` : | a ChamplainSelectionLayer
`marker` : | a ChamplainBaseMarker

Since 0.4

### champlain_selection_layer_unselect ()

    void                champlain_selection_layer_unselect  (ChamplainSelectionLayer *layer,
                                                             ChamplainBaseMarker *marker);

Unselect the marker.

`layer` : | a ChamplainSelectionLayer
`marker` : | a ChamplainBaseMarker

Since 0.4

### champlain_selection_layer_select_all ()

    void                champlain_selection_layer_select_all
                                                            (ChamplainSelectionLayer *layer);

Selects all markers in the layer. This call will only work if the selection mode is set CHAMPLAIN_SELETION_MULTIPLE.

`layer` : | a ChamplainSelectionLayer

Since 0.4

### champlain_selection_layer_unselect_all ()

    void                champlain_selection_layer_unselect_all
                                                            (ChamplainSelectionLayer *layer);

Unselects all markers.

`layer` : | a ChamplainSelectionLayer

Since 0.4

### champlain_selection_layer_marker_is_selected ()

    gboolean            champlain_selection_layer_marker_is_selected
                                                            (ChamplainSelectionLayer *layer,
                                                             ChamplainBaseMarker *marker);

`layer` : | a ChamplainSelectionLayer
`marker` : | a ChamplainBaseMarker
Returns : | whether the marker is selected or not.

Since 0.4

### champlain_selection_layer_get_selected ()

    ChamplainBaseMarker * champlain_selection_layer_get_selected
                                                            (ChamplainSelectionLayer *layer);

This function will return NULL if in CHAMPLAIN_SELETION_MULTIPLE.

`layer` : | a ChamplainSelectionLayer
Returns : | the selected ChamplainBaseMarker or NULL if none is selected.

Since 0.4

### champlain_selection_layer_get_selected_markers ()

    const GList *       champlain_selection_layer_get_selected_markers
                                                            (ChamplainSelectionLayer *layer);

`layer` : | a ChamplainSelectionLayer
Returns : | the list of selected ChamplainBaseMarker or NULL if none is selected. You shouldn't free that list.

Since 0.4

### champlain_selection_layer_count_selected_markers ()

    guint               champlain_selection_layer_count_selected_markers
                                                            (ChamplainSelectionLayer *layer);

`layer` : | a ChamplainSelectionLayer
Returns : | the number of selected ChamplainBaseMarker

Since 0.4

## Property Details

### The `"selection-mode"` property

      "selection-mode"           ChamplainSelectionMode  : Read / Write

Determines the type of selection that will be performed.

Default value: CHAMPLAIN_SELECTION_SINGLE

## Signal Details

### The `"changed"` signal

    void                user_function                      (ChamplainSelectionLayer *arg0,
                                                            gpointer                 user_data)      : Run Last

The changed signal is emitted when the selected marker(s) change.

`user_data` : | user data set when the signal handler was connected.

Since 0.4.1