Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QAccessibleInterface

    java.lang.Object
      com.trolltech.qt.internal.QSignalEmitterInternal
          com.trolltech.qt.QSignalEmitter
              com.trolltech.qt.QtJambiObject
                  com.trolltech.qt.gui.QAccessible
                      com.trolltech.qt.gui.QAccessibleInterface

All Implemented Interfaces:
  QtJambiInterface

Direct Known Subclasses:
  QAccessibleObject

    public abstract class QAccessibleInterface

extends QAccessible

The `QAccessibleInterface` class defines an interface that exposes information about accessible objects. Accessibility tools (also called AT Clients), such as screen readers or braille displays, require high-level information about accessible objects in an application. Accessible objects provide specialized input and output methods, making it possible for users to use accessibility tools with enabled applications (AT Servers).

Every element that the user needs to interact with or react to is an accessible object, and should provide this information. These are mainly visual objects, such as widgets and widget elements, but can also be content, such as sounds.

The AT client uses three basic concepts to acquire information about any accessible object in an application:

- Properties The client can read information about accessible objects. In some cases the client can also modify these properties; such as text in a line edit.
- Actions The client can invoke actions like pressing a button or .
- Relationships and Navigation The client can traverse from one accessible object to another, using the relationships between objects.

The `QAccessibleInterface` defines the API for these three concepts.

## Relationships and Navigation

The functions `childCount()` and `indexOfChild()` return the number of children of an accessible object and the index a child object has in its parent. The `childAt()` function returns the index of a child at a given position.

The `relationTo()` function provides information about how two different objects relate to each other, and `navigate()` allows traversing from one object to another object with a given relationship.

## Properties

The central property of an accessible objects is what `role()` it has. Different objects can have the same role, e.g. both the "Add line" element in a scroll bar and the `OK` button in a dialog have the same role, "button". The role implies what kind of interaction the user can perform with the user interface element.

An object's `state()` property is a combination of different state flags and can describe both how the object's state differs from a "normal" state, e.g. it might be unavailable, and also how it behaves, e.g. it might be selectable.

The `text()` property provides textual information about the object. An object usually has a name, but can provide extended information such as a description, help text, or information about any keyboard accelerators it provides. Some objects allow changing the `text()` property through the `setText()` function, but this information is in most cases read-only.

The `rect()` property provides information about the geometry of an accessible object. This information is usually only available for visual objects.

## Actions and Selection

To enable the user to interact with an accessible object the object must expose information about the actions that it can perform. `userActionCount()` returns the number of actions supported by an accessible object, and `actionText()` returns textual information about those actions. `doAction()` invokes an action.

Objects that support selections can define actions to change the selection.

### Objects and children

A `QAccessibleInterface` provides information about the accessible object, and can also provide information for the children of that object if those children don't provide a `QAccessibleInterface` implementation themselves. This is practical if the object has many similar children (e.g. items in a list view), or if the children are an integral part of the object itself, for example, the different sections in a scroll bar.

If an accessible object provides information about its children through one `QAccessibleInterface`, the children are referenced using indexes. The index is 1-based for the children, i.e. 0 refers to the object itself, 1 to the first child, 2 to the second child, and so on.

All functions in `QAccessibleInterface` that take a child index relate to the object itself if the index is 0, or to the child specified. If a child provides its own interface implementation (which can be retrieved through navigation) asking the parent for information about that child will usually not succeed.

See also:
  `QAccessible`.

Nested Class Summary
`static class` | `QAccessibleInterface.Target`

Nested classes/interfaces inherited from class com.trolltech.qt.gui.QAccessible
`QAccessible.Action, QAccessible.Event, QAccessible.Method, QAccessible.Relation, QAccessible.RelationFlag, QAccessible.Role, QAccessible.State, QAccessible.StateFlag, QAccessible.Text`

Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
`QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal`

Field Summary

Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`currentSender`

Constructor Summary
`QAccessibleInterface()`

Method Summary
`abstract java.lang.String` | `actionText(int action, QAccessible.Text t, int child)` Returns the text property `t` of the action `action` supported by the object, or of the object's child if `child` is not 0.
`abstract int` | `childAt(int x, int y)` Returns the 1-based index of the child that contains the screen coordinates (`x`, `y`).
`abstract int` | `childCount()` Returns the number of children that belong to this object.
`abstract boolean` | `doAction(int action, int child, java.util.List params)` Asks the object, or the object's `child` if `child` is not 0, to execute `action` using the parameters, `params`.
`abstract int` | `indexOfChild(QAccessibleInterface arg__1)` Returns the 1-based index of the object `child` in this object's children list, or -1 if `child` is not a child of this object.
`java.lang.Object` | `invokeMethod(QAccessible.Method method, int child, java.util.List params)` Invokes a `method` on `child` with the given parameters `params` and returns the result of the operation as `QVariant`.
`abstract boolean` | `isValid()` Returns true if all the data necessary to use this interface implementation is valid (e.
`abstract QAccessibleInterface.Target` | `navigate(QAccessible.RelationFlag relation, int index)` Navigates from this object to an object that has a relationship `relation` to this object, and returns the respective object in `target`.
`abstract QObject` | `object()` Returns a pointer to the `QObject` this interface implementation provides information for.
`abstract QRect` | `rect(int child)` Returns the geometry of the object, or of the object's child if `child` is not 0.
`abstract QAccessible.Relation` | `relationTo(int child, QAccessibleInterface other, int otherChild)` Returns the relationship between this object's `child` and the `other` object's `otherChild`.
`abstract QAccessible.Role` | `role(int child)` Returns the role of the object, or of the object's child if `child` is not 0.
`abstract void` | `setText(QAccessible.Text t, int child, java.lang.String text)` Sets the text property `t` of the object, or of the object's child if `child` is not 0, to `text`.
`abstract QAccessible.State` | `state(int child)` Returns the current state of the object, or of the object's child if `child` is not 0.
`java.util.Set` | `supportedMethods()` Returns a QSet of `Method` s that are supported by this accessible interface.
`abstract java.lang.String` | `text(QAccessible.Text t, int child)` Returns the value of the text property `t` of the object, or of the object's child if `child` is not 0.
`abstract int` | `userActionCount(int child)` Returns the number of custom actions of the object, or of the object's child if `child` is not 0.

Methods inherited from class com.trolltech.qt.gui.QAccessible
`isActive, queryAccessibleInterface, setRootObject, updateAccessibility`

Methods inherited from class com.trolltech.qt.QtJambiObject
`dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr`

Methods inherited from class com.trolltech.qt.QSignalEmitter
`blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread`

Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`__qt_signalInitialization`

Methods inherited from class java.lang.Object
`clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Constructor Detail

### QAccessibleInterface

    public QAccessibleInterface()

Method Detail

### invokeMethod

    public final java.lang.Object invokeMethod(QAccessible.Method method,
                                               int child,
                                               java.util.List params)

  Invokes a `method` on `child` with the given parameters `params` and returns the result of the operation as `QVariant`.

  Note that the type of the returned `QVariant` depends on the action.

  Returns an invalid `QVariant` if the object doesn't support the action.

### supportedMethods

    public final java.util.Set supportedMethods()

  Returns a QSet of `Method` s that are supported by this accessible interface.

See also:
  `QAccessible::Method` , and `invokeMethod()`.

### actionText

    public abstract java.lang.String actionText(int action,
                                                QAccessible.Text t,
                                                int child)

  Returns the text property `t` of the action `action` supported by the object, or of the object's child if `child` is not 0.

See also:
  `text()`, and `userActionCount()`.

### childAt

    public abstract int childAt(int x,
                                int y)

  Returns the 1-based index of the child that contains the screen coordinates (`x`, `y`). This function returns 0 if the point is positioned on the object itself. If the tested point is outside the boundaries of the object this function returns -1.

  This function is only relyable for visible objects (invisible object might not be laid out correctly).

  All visual objects provide this information.

See also:
  `rect()`.

### childCount

    public abstract int childCount()

  Returns the number of children that belong to this object. A child can provide accessibility information on its own (e.g. a child widget), or be a sub-element of this accessible object.

  All objects provide this information.

See also:
  `indexOfChild()`.

### doAction

    public abstract boolean doAction(int action,
                                     int child,
                                     java.util.List params)

  Asks the object, or the object's `child` if `child` is not 0, to execute `action` using the parameters, `params`. Returns true if the action could be executed; otherwise returns false.

  `action` can be a predefined or a custom action.

See also:
  `userActionCount()`, and `actionText()`.

### indexOfChild

    public abstract int indexOfChild(QAccessibleInterface arg__1)

  Returns the 1-based index of the object `child` in this object's children list, or -1 if `child` is not a child of this object. 0 is not a possible return value.

  All objects provide this information about their children.

See also:
  `childCount()`.

### isValid

    public abstract boolean isValid()

  Returns true if all the data necessary to use this interface implementation is valid (e. . all pointers are non-null); otherwise returns false.

See also:
  `object()`.

### navigate

    public abstract QAccessibleInterface.Target navigate(QAccessible.RelationFlag relation,
                                                         int index)

  Navigates from this object to an object that has a relationship `relation` to this object, and returns the respective object in `target`. It is the caller's responsibility to delete *`target` after use.

  If an object is found, `target` is set to point to the object, and the index of the child of `target` is returned. The return value is 0 if `target` itself is the requested object. `target` is set to null if this object is the target object (i.e. the requested object is a handled by this object).

  If no object is found `target` is set to null, and the return value is -1.

  The `entry` parameter has two different meanings:

  - Hierarchical and Logical relationships -- if multiple objects with the requested relationship exist `entry` specifies which one to return. `entry` is 1-based, e.g. use 1 to get the first (and possibly only) object with the requested relationship.

    The following code demonstrates how to use this function to navigate to the first child of an object:
    The following code example is written in c++.

                QAccessibleInterface *child = 0;
                int targetChild = object->navigate(Accessible::Child, 1, &child);
                if (child) {
                    // ...
                    delete child;
                }

  - Geometric relationships -- the index of the child from which to start navigating in the specified direction. `entry` can be 0 to navigate to a sibling of this object, or non-null to navigate within contained children that don't provide their own accessible information.
  Note that the `Descendent` value for `relation` is not supported.

  All objects support navigation.

See also:
  `relationTo()`, and `childCount()`.

### object

    public abstract QObject object()

  Returns a pointer to the `QObject` this interface implementation provides information for.

See also:
  `isValid()`.

### rect

    public abstract QRect rect(int child)

  Returns the geometry of the object, or of the object's child if `child` is not 0. The geometry is in screen coordinates.

  This function is only reliable for visible objects (invisible objects might not be laid out correctly).

  All visual objects provide this information.

See also:
  `childAt()`.

### relationTo

    public abstract QAccessible.Relation relationTo(int child,
                                                    QAccessibleInterface other,
                                                    int otherChild)

  Returns the relationship between this object's `child` and the `other` object's `otherChild`. If `child` is 0 the object's own relation is returned.

  The returned value indicates the relation of the called object to the `other` object, e.g. if this object is a child of `other` the return value will be `Child`.

  The return value is a combination of the bit flags in the QAccessible::Relation enumeration.

  All objects provide this information.

See also:
  `indexOfChild()`, and `navigate()`.

### role

    public abstract QAccessible.Role role(int child)

  Returns the role of the object, or of the object's child if `child` is not 0. The role of an object is usually static.

  All accessible objects have a role.

See also:
  `text()`, and `state()`.

### setText

    public abstract void setText(QAccessible.Text t,
                                 int child,
                                 java.lang.String text)

  Sets the text property `t` of the object, or of the object's child if `child` is not 0, to `text`.

  Note that the text properties of most objects are read-only.

See also:
  `text()`.

### state

    public abstract QAccessible.State state(int child)

  Returns the current state of the object, or of the object's child if `child` is not 0. The returned value is a combination of the flags in the `QAccessible::StateFlag` enumeration.

  All accessible objects have a state.

See also:
  `text()`, and `role()`.

### text

    public abstract java.lang.String text(QAccessible.Text t,
                                          int child)

  Returns the value of the text property `t` of the object, or of the object's child if `child` is not 0.

  The `Name` is a string used by clients to identify, find, or announce an accessible object for the user. All objects must have a name that is unique within their container. The name can be used differently by clients, so the name should both give a short description of the object and be unique.

  An accessible object's `Description` provides textual information about an object's visual appearance. The description is primarily used to provide greater context for vision-impaired users, but is also used for context searching or other applications. Not all objects have a description. An "OK" button would not need a description, but a tool button that shows a picture of a smiley would.

  The `Value` of an accessible object represents visual information contained by the object, e.g. the text in a line edit. Usually, the value can be modified by the user. Not all objects have a value, e.g. static text labels don't, and some objects have a state that already is the value, e.g. toggle buttons.

  The `Help` text provides information about the function and usage of an accessible object. Not all objects provide this information.

  The `Accelerator` is a keyboard shortcut that activates the object's default action. A keyboard shortcut is the underlined character in the text of a menu, menu item or widget, and is either the character itself, or a combination of this character and a modifier key like Alt, Ctrl or Shift. Command controls like tool buttons also have shortcut keys and usually display them in their tooltip.

  All objects provide a string for `Name` .

See also:
  `setText()`, `role()`, and `state()`.

### userActionCount

    public abstract int userActionCount(int child)

  Returns the number of custom actions of the object, or of the object's child if `child` is not 0.

  The `Action` type enumerates predefined actions: these are not included in the returned value.

See also:
  `actionText()`, and `doAction()`.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD