Qt Jambi Home

com.trolltech.qt.gui
Class QAccessibleWidget

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.gui.QAccessible
              extended by com.trolltech.qt.gui.QAccessibleInterface
                  extended by com.trolltech.qt.gui.QAccessibleObject
                      extended by com.trolltech.qt.gui.QAccessibleWidget
All Implemented Interfaces:
QtJambiInterface

public class QAccessibleWidget
extends QAccessibleObject

The QAccessibleWidget class implements the QAccessibleInterface for QWidgets.

This class is convenient to use as a base class for custom implementations of QAccessibleInterfaces that provide information about widget objects.

The class provides functions to retrieve the parentObject (the widget's parent widget), and the associated widget. Controlling signals can be added with addControllingSignal, and setters are provided for various aspects of the interface implementation, for example setValue, setDescription, setAccelerator, and setHelp.

See Also:
QAccessible, QAccessibleObject

Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QAccessibleInterface
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.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QAccessibleWidget(QWidget o)
          Equivalent to QAccessibleWidget(o, Client, QString()).
QAccessibleWidget(QWidget o, QAccessible.Role r)
          Equivalent to QAccessibleWidget(o, r, QString()).
QAccessibleWidget(QWidget o, QAccessible.Role r, java.lang.String name)
          Creates a QAccessibleWidget object for widget o.
 
Method Summary
 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.
protected  void addControllingSignal(java.lang.String signal)
          Registers signal as a controlling signal.
 int childAt(int x, int y)
          

Returns the 1-based index of the child that contains the screen coordinates (x, y).

 int childCount()
          

Returns the number of children that belong to this object.

 boolean doAction(int action, int child, java.util.List<java.lang.Object> params)
          Asks the object, or the object's child if child is not 0, to execute action using the parameters, params.
static QAccessibleWidget fromNativePointer(QNativePointer nativePointer)
          This function returns the QAccessibleWidget instance pointed to by nativePointer
 int indexOfChild(QAccessibleInterface child)
          

Returns the 1-based index of the object arg__1 in this object's children list, or -1 if arg__1 is not a child of this object.

 QAccessibleInterface.Target navigate(QAccessible.RelationFlag rel, int entry)
          Equivalent to navigate(rel, entry, ).
protected  QObject parentObject()
          Returns the associated widget's parent object, which is either the parent widget, or qApp for top-level widgets.
 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.

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

Returns the relationship between this object's child and the other object's otherChild.

 QAccessible.Role role(int child)
          

Returns the role of the object, or of the object's child if child is not 0.

protected  void setAccelerator(java.lang.String accel)
          Sets the accelerator of this interface implementation to accel.
protected  void setDescription(java.lang.String desc)
          Sets the description of this interface implementation to desc.
protected  void setHelp(java.lang.String help)
          Sets the help of this interface implementation to help.
protected  void setValue(java.lang.String value)
          Sets the value of this interface implementation to value.
 QAccessible.State state(int child)
          

Returns the current state of the object, or of the object's child if child is not 0.

 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.
 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.

protected  QWidget widget()
          Returns the associated widget.
 
Methods inherited from class com.trolltech.qt.gui.QAccessibleObject
isValid, object, setText
 
Methods inherited from class com.trolltech.qt.gui.QAccessibleInterface
invokeMethod, supportedMethods
 
Methods inherited from class com.trolltech.qt.gui.QAccessible
isActive, queryAccessibleInterface, setRootObject, updateAccessibility
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QAccessibleWidget

public QAccessibleWidget(QWidget o,
                         QAccessible.Role r)

Equivalent to QAccessibleWidget(o, r, QString()).


QAccessibleWidget

public QAccessibleWidget(QWidget o)

Equivalent to QAccessibleWidget(o, Client, QString()).


QAccessibleWidget

public QAccessibleWidget(QWidget o,
                         QAccessible.Role r,
                         java.lang.String name)

Creates a QAccessibleWidget object for widget o. r and name are optional parameters that set the object's role and name properties.

Method Detail

addControllingSignal

protected final void addControllingSignal(java.lang.String signal)

Registers signal as a controlling signal.

An object is a Controller to any other object connected to a controlling signal.


parentObject

protected final QObject parentObject()

Returns the associated widget's parent object, which is either the parent widget, or qApp for top-level widgets.


setAccelerator

protected final void setAccelerator(java.lang.String accel)

Sets the accelerator of this interface implementation to accel.

The default implementation of text returns the set value for the Accelerator text.

Note that the object wrapped by this interface is not modified.


setDescription

protected final void setDescription(java.lang.String desc)

Sets the description of this interface implementation to desc.

The default implementation of text returns the set value for the Description text.

Note that the object wrapped by this interface is not modified.


setHelp

protected final void setHelp(java.lang.String help)

Sets the help of this interface implementation to help.

The default implementation of text returns the set value for the Help text.

Note that the object wrapped by this interface is not modified.


setValue

protected final void setValue(java.lang.String value)

Sets the value of this interface implementation to value.

The default implementation of text returns the set value for the Value text.

Note that the object wrapped by this interface is not modified.


widget

protected final QWidget widget()

Returns the associated widget.


actionText

public 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.

Overrides:
actionText in class QAccessibleObject
See Also:
text, userActionCount

childAt

public 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.

Specified by:
childAt in class QAccessibleInterface
See Also:
rect

childCount

public 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.

Specified by:
childCount in class QAccessibleInterface
See Also:
indexOfChild

doAction

public boolean doAction(int action,
                        int child,
                        java.util.List<java.lang.Object> 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.

Overrides:
doAction in class QAccessibleObject
See Also:
userActionCount, actionText

indexOfChild

public int indexOfChild(QAccessibleInterface child)

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

All objects provide this information about their children.

Specified by:
indexOfChild in class QAccessibleInterface
See Also:
childCount

navigate

public QAccessibleInterface.Target navigate(QAccessible.RelationFlag rel,
                                            int entry)

Equivalent to navigate(rel, entry, ).

Specified by:
navigate in class QAccessibleInterface

rect

public 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.

Overrides:
rect in class QAccessibleObject
See Also:
childAt

relationTo

public 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.

Specified by:
relationTo in class QAccessibleInterface
See Also:
indexOfChild, navigate

role

public 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.

Specified by:
role in class QAccessibleInterface
See Also:
text, state

state

public 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.

Specified by:
state in class QAccessibleInterface
See Also:
text, role

text

public 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.

Specified by:
text in class QAccessibleInterface
See Also:
role, state

userActionCount

public 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.

Overrides:
userActionCount in class QAccessibleObject
See Also:
actionText, doAction

fromNativePointer

public static QAccessibleWidget fromNativePointer(QNativePointer nativePointer)
This function returns the QAccessibleWidget instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

Qt Jambi Home