#include <accessibletexteditorwidget.h>
Public Member Functions | |
AccessibleTextEditorWidget (TextEditorWidget *widget) | |
virtual | ~AccessibleTextEditorWidget () |
void * | interface_cast (QAccessible::InterfaceType t) override |
QAccessible::State | state () const override |
virtual void | selection (int selectionIndex, int *startOffset, int *endOffset) const override |
Returns a selection. The size of the selection is returned in startOffset and endOffset. If there is no selection both startOffset and endOffset are nullptr. | |
virtual int | selectionCount () const override |
Returns the number of selections in this text. | |
virtual void | addSelection (int startOffset, int endOffset) override |
Select the text from startOffset to endOffset. The startOffset is the first character that will be selected. The endOffset is the first character that will not be selected. | |
virtual void | removeSelection (int selectionIndex) override |
Clears the selection with index selectionIndex. | |
virtual void | setSelection (int selectionIndex, int startOffset, int endOffset) override |
Set the selection selectionIndex to the range from startOffset to endOffset. | |
virtual int | cursorPosition () const override |
Returns the current cursor position. | |
virtual void | setCursorPosition (int position) override |
Move the cursor position. | |
virtual QString | text (QAccessible::Text t) const override |
virtual QString | text (int startOffset, int endOffset) const override |
Returns the text from startOffset to endOffset. The startOffset is the first character that will be returned. The endOffset is the first character that will not be returned. | |
virtual int | characterCount () const override |
Returns the length of the text (total size including spaces). | |
virtual QRect | characterRect (int offset) const override |
Returns the position and size of the character at position offset in screen coordinates. | |
virtual int | offsetAtPoint (const QPoint &point) const override |
Returns the offset of the character at the point in screen coordinates. | |
virtual void | scrollToSubstring (int startIndex, int endIndex) override |
Ensures that the text between startIndex and endIndex is visible. | |
virtual QString | attributes (int offset, int *startOffset, int *endOffset) const override |
Returns the text attributes at the position offset. In addition the range of the attributes is returned in startOffset and endOffset. | |
virtual QString | textAfterOffset (int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const override |
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. | |
virtual QString | textAtOffset (int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const override |
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. | |
virtual QString | textBeforeOffset (int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const override |
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. | |
virtual QAccessibleInterface * | focusChild () const override |
virtual QRect | rect () const override |
Returns the rectangle for the editor widget It returns the location of the textWidget (even when the TextComponent has got focus) | |
Static Public Member Functions | |
static QAccessibleInterface * | factory (const QString &className, QObject *object) |
Construct the AccessibleTextEditor interface for the given widget. | |
static QWidget * | eventWidgetForTextEditor (TextEditorWidget *widget) |
Returns the widget that should be used for accessibility events. | |
static void | notifyTextSelectionEvent (TextEditorWidget *widget, TextSelection *selection) |
Notifies a text-selection change event. | |
static void | notifyTextChangeEvent (TextEditorWidget *widget, TextBufferChange *change, QString oldText) |
Notifies a text change event happens. | |
Protected Member Functions | |
TextDocument * | textDocument () const |
TextSelection * | textSelection () const |
TextEditorController * | controller () const |
TextRenderer * | renderer () const |
TextEditorWidget * | textWidget () const |
|
explicit |
|
virtual |
|
overridevirtual |
Select the text from startOffset to endOffset. The startOffset is the first character that will be selected. The endOffset is the first character that will not be selected.
When the object supports multiple selections (e.g. in a word processor), this adds a new selection, otherwise it replaces the previous selection.
The selection will be endOffset - startOffset characters long.
|
overridevirtual |
Returns the text attributes at the position offset. In addition the range of the attributes is returned in startOffset and endOffset.
|
overridevirtual |
Returns the length of the text (total size including spaces).
|
overridevirtual |
Returns the position and size of the character at position offset in screen coordinates.
|
protected |
|
overridevirtual |
Returns the current cursor position.
|
static |
Returns the widget that should be used for accessibility events.
|
static |
Construct the AccessibleTextEditor interface for the given widget.
|
overridevirtual |
|
override |
|
static |
Notifies a text change event happens.
|
static |
Notifies a text-selection change event.
|
overridevirtual |
Returns the offset of the character at the point in screen coordinates.
|
overridevirtual |
Returns the rectangle for the editor widget It returns the location of the textWidget (even when the TextComponent has got focus)
|
overridevirtual |
Clears the selection with index selectionIndex.
|
protected |
|
overridevirtual |
Ensures that the text between startIndex and endIndex is visible.
|
overridevirtual |
Returns a selection. The size of the selection is returned in startOffset and endOffset. If there is no selection both startOffset and endOffset are nullptr.
The accessibility APIs support multiple selections. For most widgets though, only one selection is supported with selectionIndex equal to 0.
|
overridevirtual |
Returns the number of selections in this text.
|
overridevirtual |
Move the cursor position.
|
overridevirtual |
Set the selection selectionIndex to the range from startOffset to endOffset.
|
override |
|
overridevirtual |
Returns the text from startOffset to endOffset. The startOffset is the first character that will be returned. The endOffset is the first character that will not be returned.
|
overridevirtual |
|
overridevirtual |
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.
|
overridevirtual |
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.
|
overridevirtual |
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.
|
protected |
|
protected |
|
protected |