Accessibility/AccessAPI

From MozillaWiki
Jump to: navigation, search

Introduction

Access API specification is a set of interfaces helping to inspect, interact to and manage applications running on the platform. This specification in conjunction with other mechanisms and specs like Text-to-Speech (TTS) allows the creation of web-based assistive technologies software such as screen readers, screen magnifiers and others running within the browser.

Security and Privacy Considerations

The API defined in this specification can be used to get information about and from applications running on the platform. The distribution of this information could potentially compromise the user's privacy. A conforming implementation of this specification must provide a mechanism that protects the user's privacy and this mechanism should ensure that no information is retrievable without the user's express permission.

NavigatorAccess Interface

The Access interface is exposed on the Navigator object.

Navigator implements NavigatorAccess;

All instances of the Navigator type are defined to also implement the NavigatorAccess interface.

[NoInterfaceObject]
interface NavigatorAccess {
    readonly attribute AccessManager access;
};

Attributes

access of type AccessManager, readonly
  The object that exposes the information about running applications.
  No exceptions.

AccessManager Interface

[NoInterfaceObject]
interface AccessManager {
  readonly attribute Application applications[];
  void switchTo(Application application);
};

Attributes

applications of type array of Application
  The array of applications running on the platforms.
  No expections.

Methods

switchTo
  Brings the application into foreground.
  Parameter: application
  Type: Application
  Description: an application to show up

Application Interface

[NoInterfaceObject]
interface Application {
  readonly Accessible firstWindow;
  readonly Accessible lastWindow;
  readonly Accessible activeWindow;

  readonly string name;
  readonly string brandName;
};

Accessible Interface

[NoInterfaceObject]
interface Accessible {
  readonly Accessible firstChild;
  readonly Accessible lastChild;
  readonly Accessible nextSibling;
  readonly Accessible prevSibling;

  readonly AccessibleDocument document;
  readonly AccessibleWindow window;

  readonly Role role;
  readonly State state;

  readonly string name;
  readonly string description;
  readonly string value;

  readonly KeyBinding accesskey;
  readonly KeyBinding keyboardShortcut;

  readonly unsigned int actionCount;
  string getActionName(int index);
  void invokeAction(int index);

  Relation getRelation(RelationType type);
  string getAttribute(string attributeName);
  readonly GroupPosition groupPosition;
  readonly Rect boundary;
};

Role Interface

[NoInterfaceObject]
interface Role {
  const unsigned short TITLEBAR = 0;
  const unsigned short BLABLA;
};


State Interface

[NoInterfaceObject]
interface State {
  const unsigned short EDITABLE = 0;
  const unsigned short BLABLA;
};

KeyBinding Interface

[NoInterfaceObject]
interface KeyBinding {
  const unsigned short Shift = 1;
  const unsigned short Control = 2;
  const unsigned short Alt = 4;
  const unsigned short Meta = 8;

  readonly unsigned int key;
  readonly unsigned int modifierMask;

  bool isEmpty();
};


Relation Interface

[NoInterfaceObject]
interface Relation {
  Accessible next();
};

GroupPosition Interface

[NoInterfaceObject]
interface GroupPosition {
  readonly unsigned int level;
  readonly unsigned int position;
  readonly unsigned int size;
};

AccessibleDocument Interface

[NoInterfaceObject]
interface AccessibleDocument {
  
};


AccessibleDocument Interface

[NoInterfaceObject]
interface AccessibleDocument {
  readonly VirtualCursor virtualCursor;
};

VirtualCursor Interface

[NoInterfaceObject]
interface VirtualCursor {
  Accessible next();
};