edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::AccessibleTextEditorWidget Class Reference

#include <accessibletexteditorwidget.h>

+ Inheritance diagram for edbee::AccessibleTextEditorWidget:
+ Collaboration diagram for edbee::AccessibleTextEditorWidget:

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

TextDocumenttextDocument () const
 
TextSelectiontextSelection () const
 
TextEditorControllercontroller () const
 
TextRendererrenderer () const
 
TextEditorWidgettextWidget () const
 

Constructor & Destructor Documentation

◆ AccessibleTextEditorWidget()

edbee::AccessibleTextEditorWidget::AccessibleTextEditorWidget ( TextEditorWidget * widget)
explicit

◆ ~AccessibleTextEditorWidget()

edbee::AccessibleTextEditorWidget::~AccessibleTextEditorWidget ( )
virtual

Member Function Documentation

◆ addSelection()

void edbee::AccessibleTextEditorWidget::addSelection ( int startOffset,
int endOffset )
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.

◆ attributes()

QString edbee::AccessibleTextEditorWidget::attributes ( int offset,
int * startOffset,
int * endOffset ) const
overridevirtual

Returns the text attributes at the position offset. In addition the range of the attributes is returned in startOffset and endOffset.

◆ characterCount()

int edbee::AccessibleTextEditorWidget::characterCount ( ) const
overridevirtual

Returns the length of the text (total size including spaces).

◆ characterRect()

QRect edbee::AccessibleTextEditorWidget::characterRect ( int offset) const
overridevirtual

Returns the position and size of the character at position offset in screen coordinates.

◆ controller()

TextEditorController * edbee::AccessibleTextEditorWidget::controller ( ) const
protected

◆ cursorPosition()

int edbee::AccessibleTextEditorWidget::cursorPosition ( ) const
overridevirtual

Returns the current cursor position.

◆ eventWidgetForTextEditor()

QWidget * edbee::AccessibleTextEditorWidget::eventWidgetForTextEditor ( TextEditorWidget * widget)
static

Returns the widget that should be used for accessibility events.

◆ factory()

QAccessibleInterface * edbee::AccessibleTextEditorWidget::factory ( const QString & className,
QObject * object )
static

Construct the AccessibleTextEditor interface for the given widget.

◆ focusChild()

QAccessibleInterface * edbee::AccessibleTextEditorWidget::focusChild ( ) const
overridevirtual

◆ interface_cast()

void * edbee::AccessibleTextEditorWidget::interface_cast ( QAccessible::InterfaceType t)
override

◆ notifyTextChangeEvent()

void edbee::AccessibleTextEditorWidget::notifyTextChangeEvent ( TextEditorWidget * widget,
TextBufferChange * change,
QString oldText )
static

Notifies a text change event happens.

Todo
: When a caret is included, (Inherited change, use this caret position)

◆ notifyTextSelectionEvent()

void edbee::AccessibleTextEditorWidget::notifyTextSelectionEvent ( TextEditorWidget * widget,
TextSelection * selection )
static

Notifies a text-selection change event.

◆ offsetAtPoint()

int edbee::AccessibleTextEditorWidget::offsetAtPoint ( const QPoint & point) const
overridevirtual

Returns the offset of the character at the point in screen coordinates.

◆ rect()

QRect edbee::AccessibleTextEditorWidget::rect ( ) const
overridevirtual

Returns the rectangle for the editor widget It returns the location of the textWidget (even when the TextComponent has got focus)

◆ removeSelection()

void edbee::AccessibleTextEditorWidget::removeSelection ( int selectionIndex)
overridevirtual

Clears the selection with index selectionIndex.

◆ renderer()

TextRenderer * edbee::AccessibleTextEditorWidget::renderer ( ) const
protected

◆ scrollToSubstring()

void edbee::AccessibleTextEditorWidget::scrollToSubstring ( int startIndex,
int endIndex )
overridevirtual

Ensures that the text between startIndex and endIndex is visible.

◆ selection()

void edbee::AccessibleTextEditorWidget::selection ( int selectionIndex,
int * startOffset,
int * endOffset ) const
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.

◆ selectionCount()

int edbee::AccessibleTextEditorWidget::selectionCount ( ) const
overridevirtual

Returns the number of selections in this text.

◆ setCursorPosition()

void edbee::AccessibleTextEditorWidget::setCursorPosition ( int position)
overridevirtual

Move the cursor position.

◆ setSelection()

void edbee::AccessibleTextEditorWidget::setSelection ( int selectionIndex,
int startOffset,
int endOffset )
overridevirtual

Set the selection selectionIndex to the range from startOffset to endOffset.

◆ state()

QAccessible::State edbee::AccessibleTextEditorWidget::state ( ) const
override

◆ text() [1/2]

QString edbee::AccessibleTextEditorWidget::text ( int startOffset,
int endOffset ) const
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.

◆ text() [2/2]

QString edbee::AccessibleTextEditorWidget::text ( QAccessible::Text t) const
overridevirtual

◆ textAfterOffset()

QString edbee::AccessibleTextEditorWidget::textAfterOffset ( int vOffset,
QAccessible::TextBoundaryType boundaryType,
int * startOffset,
int * endOffset ) const
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.

◆ textAtOffset()

QString edbee::AccessibleTextEditorWidget::textAtOffset ( int vOffset,
QAccessible::TextBoundaryType boundaryType,
int * startOffset,
int * endOffset ) const
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.

◆ textBeforeOffset()

QString edbee::AccessibleTextEditorWidget::textBeforeOffset ( int offset,
QAccessible::TextBoundaryType boundaryType,
int * startOffset,
int * endOffset ) const
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.

◆ textDocument()

TextDocument * edbee::AccessibleTextEditorWidget::textDocument ( ) const
protected

◆ textSelection()

TextSelection * edbee::AccessibleTextEditorWidget::textSelection ( ) const
protected

◆ textWidget()

TextEditorWidget * edbee::AccessibleTextEditorWidget::textWidget ( ) const
protected

The documentation for this class was generated from the following files: