# Accessibility::Selector Interface Reference

`import "Accessibility_Selector.idl";`

## Public Types
enum | CommandResult { COMMAND_RESULT_INVALID, COMMAND_RESULT_SUCCESS, COMMAND_RESULT_FAILED, COMMAND_RESULT_OBSOLETE, COMMAND_RESULT_LAST_DEFINED }
## Public Member Functions
CommandList | getCommands ()
boolean | replaceCommands (in CommandList commands)
boolean | refreshCommands ()
CommandResult | activateCommand (in Command cmd)
void | registerChangeListener (in CommandListener listener)
void | deregisterChangeListener (in CommandListener listener)
## Data Fields
readonly attribute boolean | supportsReplace

## Detailed Description

This interface is intended for use by assistive technologies and related user-agents. Via this interface, an assistive technology or user agent may expose a series of choices or selections in textual form, which can be activated on demand by a client of the Selector interface.

Examples of the use of this interface include voice-command and remote-control applications, in which the user interaction is wholly or partly delegated by the implementor to an external agent.

Since:
  AT-SPI 1.7.0

## Member Enumeration Documentation

enum Accessibility::Selector::CommandResult

A code returned by a call to activateCommand, indicating the result of the activation request.

Enumerator:

  COMMAND_RESULT_INVALID | The command was invalid or ill-formed; usually indicates an error condition.
  COMMAND_RESULT_SUCCESS | The command was successfully activated.
  COMMAND_RESULT_FAILED | The command was valid, but could not be activated. This may be due to problems with permissions or error conditions.
  COMMAND_RESULT_OBSOLETE | The command is no longer valid in the current program context. This may mean that the application has changed state in such a way that the specified command it no longer applicable, or because changes to the application state have rendered it ambiguous. Commands should be re-fetched and a new selection made.
  COMMAND_RESULT_LAST_DEFINED | Defines size of enumeration; do not use this value as a parameter.

## Member Function Documentation

CommandResult Accessibility::Selector::activateCommand | ( | in Command | cmd | ) |

Request that the Selector invoke the specified Command.

Parameters:

  | cmd | the Command to activate/invoke.

Returns:
  a CommandResult indicating whether the request was honored, and the reason for failure if the Command could not be activated or invoked.

void Accessibility::Selector::deregisterChangeListener | ( | in CommandListener | listener | ) |

Tell the Selector instance to cease notifying the specified CommandListener of changes to the command list.

Parameters:

  | listener | the CommandListener to remove from the notification list.

CommandList Accessibility::Selector::getCommands | ( |  | ) |

Query the Selector for the current CommandList.

Returns:
  the currently available CommandList

boolean Accessibility::Selector::refreshCommands | ( |  | ) |

Ask the Selector to re-calculate its CommandList.

Note:
  in most cases the Selector will continuously update its CommandList without recourse to this call. This call is equivalent to getCommands, except that after refreshCommands the new CommandList will be returned via any registered CommandListener instances rather than synchronously via this call.

Returns:
  TRUE if the CommandList changed.

void Accessibility::Selector::registerChangeListener | ( | in CommandListener | listener | ) |

Register a :CommandListener instance for notification of changes to the command set.

Parameters:

  | listener | the CommandListener to be notified of changes.

boolean Accessibility::Selector::replaceCommands | ( | in CommandList | commands | ) |

Returns:
  TRUE if the replacement request was successful, FALSE if the request could not be honored.

## Field Documentation

readonly attribute boolean Accessibility::Selector::supportsReplace

This attribute is TRUE if this Selector allows its CommandList to be specified by the client

The documentation for this interface was generated from the following file:

- /home/liyuan/src-git/at-spi/idl/Accessibility_Selector.idl