QAccessibleTextInterface Class
The QAccessibleTextInterface class implements support for text handling. More...
Header: | #include <QAccessibleTextInterface> |
qmake: | QT += gui |
Public Functions
virtual | ~QAccessibleTextInterface() |
virtual QString | textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const |
virtual QString | textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const |
virtual QString | textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const |
Detailed Description
This interface corresponds to the IAccessibleText interface. It should be implemented for widgets that display more text than a plain label. Labels should be represented by only QAccessibleInterface and return their text as name (QAccessibleInterface::text() with QAccessible::Name as type). The QAccessibleTextInterface is typically for text that a screen reader might want to read line by line, and for widgets that support text selection and input. This interface is, for example, implemented for QLineEdit.
Member Function Documentation
[virtual]
QAccessibleTextInterface::~QAccessibleTextInterface()
Destroys the QAccessibleTextInterface.
[virtual]
QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const
Returns the text item of type boundaryType that is right after offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.
This default implementation is provided for small text edits. A word processor or text editor should provide their own efficient implementations. This function makes no distinction between paragraphs and lines.
Note: this function can not take the cursor position into account. By convention an offset of -2 means that this function should use the cursor position as offset. Thus an offset of -2 must be converted to the cursor position before calling this function. An offset of -1 is used for the text length and custom implementations of this function have to return the result as if the length was passed in as offset.
[virtual]
QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const
Returns the text item of type boundaryType at offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.
This default implementation is provided for small text edits. A word processor or text editor should provide their own efficient implementations. This function makes no distinction between paragraphs and lines.
Note: this function can not take the cursor position into account. By convention an offset of -2 means that this function should use the cursor position as offset. Thus an offset of -2 must be converted to the cursor position before calling this function. An offset of -1 is used for the text length and custom implementations of this function have to return the result as if the length was passed in as offset.
[virtual]
QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const
Returns the text item of type boundaryType that is close to offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.
This default implementation is provided for small text edits. A word processor or text editor should provide their own efficient implementations. This function makes no distinction between paragraphs and lines.
Note: this function can not take the cursor position into account. By convention an offset of -2 means that this function should use the cursor position as offset. Thus an offset of -2 must be converted to the cursor position before calling this function. An offset of -1 is used for the text length and custom implementations of this function have to return the result as if the length was passed in as offset.