ATK Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# AtkSelection

## Name

AtkSelection -- The ATK interface implemented by container objects whose AtkObject children can be selected.

## Synopsis

    struct      AtkSelection;
    gboolean    atk_selection_add_selection     (AtkSelection *selection,
                                                 gint i);
    gboolean    atk_selection_clear_selection   (AtkSelection *selection);
    AtkObject*  atk_selection_ref_selection     (AtkSelection *selection,
                                                 gint i);
    gint        atk_selection_get_selection_count
                                                (AtkSelection *selection);
    gboolean    atk_selection_is_child_selected (AtkSelection *selection,
                                                 gint i);
    gboolean    atk_selection_remove_selection  (AtkSelection *selection,
                                                 gint i);
    gboolean    atk_selection_select_all_selection
                                                (AtkSelection *selection);

## Object Hierarchy

      GInterface
       +----AtkSelection

## Signal Prototypes

    "selection-changed"
                void        user_function      (AtkSelection *atkselection,
                                                gpointer user_data);

## Description

AtkSelection should be implemented by UI components with children which are exposed by atk_object_ref_child and atk_object_get_n_children, if the use of the parent UI component ordinarily involves selection of one or more of the objects corresponding to those AtkObject children - for example, selectable lists.

Note that other types of "selection" (for instance text selection) are accomplished a other ATK interfaces - AtkSelection is limited to the selection/deselection of children.

## Details

### struct AtkSelection

    struct AtkSelection;

The AtkAction structure does not contain any fields.

### atk_selection_add_selection ()

    gboolean    atk_selection_add_selection     (AtkSelection *selection,
                                                 gint i);

Adds the specified accessible child of the object to the object's selection.

`selection` :

  a GObject instance that implements AtkSelectionIface

`i` :

  a gint specifying the child index.

Returns :

  TRUE if success, FALSE otherwise.

### atk_selection_clear_selection ()

    gboolean    atk_selection_clear_selection   (AtkSelection *selection);

Clears the selection in the object so that no children in the object are selected.

`selection` :

  a GObject instance that implements AtkSelectionIface

Returns :

  TRUE if success, FALSE otherwise.

### atk_selection_ref_selection ()

    AtkObject*  atk_selection_ref_selection     (AtkSelection *selection,
                                                 gint i);

Gets a reference to the accessible object representing the specified selected child of the object. Note: callers should not rely on `NULL` or on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or the atk_get_accessible_value() convenience method.

`selection` :

  a GObject instance that implements AtkSelectionIface

`i` :

  a gint specifying the index in the selection set. (e.g. the ith selection as opposed to the ith child).

Returns :

  an AtkObject representing the selected accessible , or `NULL` if `selection` does not implement this interface.

### atk_selection_get_selection_count ()

    gint        atk_selection_get_selection_count
                                                (AtkSelection *selection);

Gets the number of accessible children currently selected. Note: callers should not rely on `NULL` or on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or the atk_get_accessible_value() convenience method.

`selection` :

  a GObject instance that implements AtkSelectionIface

Returns :

  a gint representing the number of items selected, or 0 if `selection` does not implement this interface.

### atk_selection_is_child_selected ()

    gboolean    atk_selection_is_child_selected (AtkSelection *selection,
                                                 gint i);

Determines if the current child of this object is selected Note: callers should not rely on `NULL` or on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or the atk_get_accessible_value() convenience method.

`selection` :

  a GObject instance that implements AtkSelectionIface

`i` :

  a gint specifying the child index.

Returns :

  a gboolean representing the specified child is selected, or 0 if `selection` does not implement this interface.

### atk_selection_remove_selection ()

    gboolean    atk_selection_remove_selection  (AtkSelection *selection,
                                                 gint i);

Removes the specified child of the object from the object's selection.

`selection` :

  a GObject instance that implements AtkSelectionIface

`i` :

  a gint specifying the index in the selection set. (e.g. the ith selection as opposed to the ith child).

Returns :

  TRUE if success, FALSE otherwise.

### atk_selection_select_all_selection ()

    gboolean    atk_selection_select_all_selection
                                                (AtkSelection *selection);

Causes every child of the object to be selected if the object supports multiple selections.

`selection` :

  a GObject instance that implements AtkSelectionIface

Returns :

  TRUE if success, FALSE otherwise.

## Signals

### The "selection-changed" signal

    void        user_function                  (AtkSelection *atkselection,
                                                gpointer user_data);

`atkselection` :

  the object which received the signal.

`user_data` :

  user data set when the signal handler was connected.

## See Also

AtkText

<<< Previous Page | Home | Up | Next Page >>>
AtkRelationSet | AtkState