webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | List of all members
AccessibleText Class Reference

#include <AccessibleTextImpl.h>

Inheritance diagram for AccessibleText:
IAccessibleText2 IAccessibleEditableText IAccessibleText

Public Member Functions

 AccessibleText (WebCore::AccessibilityObject *, HWND)
 
virtual ~AccessibleText ()
 
virtual HRESULT STDMETHODCALLTYPE addSelection (long startOffset, long endOffset)
 Adds a text selection. More...
 
virtual HRESULT STDMETHODCALLTYPE get_attributes (long offset, long *startOffset, long *endOffset, BSTR *textAttributes)
 
virtual HRESULT STDMETHODCALLTYPE get_caretOffset (long *offset)
 
virtual HRESULT STDMETHODCALLTYPE get_characterExtents (long offset, enum IA2CoordinateType coordType, long *x, long *y, long *width, long *height)
 
virtual HRESULT STDMETHODCALLTYPE get_nSelections (long *nSelections)
 
virtual HRESULT STDMETHODCALLTYPE get_offsetAtPoint (long x, long y, enum IA2CoordinateType coordType, long *offset)
 
virtual HRESULT STDMETHODCALLTYPE get_selection (long selectionIndex, long *startOffset, long *endOffset)
 
virtual HRESULT STDMETHODCALLTYPE get_text (long startOffset, long endOffset, BSTR *text)
 
virtual HRESULT STDMETHODCALLTYPE get_textBeforeOffset (long offset, enum IA2TextBoundaryType boundaryType, long *startOffset, long *endOffset, BSTR *text)
 
virtual HRESULT STDMETHODCALLTYPE get_textAfterOffset (long offset, enum IA2TextBoundaryType boundaryType, long *startOffset, long *endOffset, BSTR *text)
 
virtual HRESULT STDMETHODCALLTYPE get_textAtOffset (long offset, enum IA2TextBoundaryType boundaryType, long *startOffset, long *endOffset, BSTR *text)
 
virtual HRESULT STDMETHODCALLTYPE removeSelection (long selectionIndex)
 Unselects a range of text. More...
 
virtual HRESULT STDMETHODCALLTYPE setCaretOffset (long offset)
 Sets the position of the caret. More...
 
virtual HRESULT STDMETHODCALLTYPE setSelection (long selectionIndex, long startOffset, long endOffset)
 Changes the bounds of an existing selection. More...
 
virtual HRESULT STDMETHODCALLTYPE get_nCharacters (long *characters)
 
virtual HRESULT STDMETHODCALLTYPE scrollSubstringTo (long startIndex, long endIndex, enum IA2ScrollType scrollType)
 Makes a specific part of string visible on screen. More...
 
virtual HRESULT STDMETHODCALLTYPE scrollSubstringToPoint (long startIndex, long endIndex, enum IA2CoordinateType coordinateType, long x, long y)
 Moves the top left of a substring to a specified location. More...
 
virtual HRESULT STDMETHODCALLTYPE get_newText (IA2TextSegment *newText)
 
virtual HRESULT STDMETHODCALLTYPE get_oldText (IA2TextSegment *oldText)
 
virtual HRESULT STDMETHODCALLTYPE get_attributeRange (long offset, BSTR filter, long *startOffset, long *endOffset, BSTR *attributeValues)
 
virtual HRESULT STDMETHODCALLTYPE copyText (long startOffset, long endOffset)
 Copies the text range into the clipboard. More...
 
virtual HRESULT STDMETHODCALLTYPE deleteText (long startOffset, long endOffset)
 Deletes a range of text. More...
 
virtual HRESULT STDMETHODCALLTYPE insertText (long offset, BSTR *text)
 Inserts text at the specified position. More...
 
virtual HRESULT STDMETHODCALLTYPE cutText (long startOffset, long endOffset)
 Deletes a range of text and copies it to the clipboard. More...
 
virtual HRESULT STDMETHODCALLTYPE pasteText (long offset)
 Pastes content from the clipboard. More...
 
virtual HRESULT STDMETHODCALLTYPE replaceText (long startOffset, long endOffset, BSTR *text)
 Replaces text. More...
 
virtual HRESULT STDMETHODCALLTYPE setAttributes (long startOffset, long endOffset, BSTR *attributes)
 Replaces the attributes of a text range by the given set of attributes. More...
 
virtual HRESULT STDMETHODCALLTYPE QueryInterface (_In_ REFIID riid, _COM_Outptr_ void **ppvObject)
 
virtual ULONG STDMETHODCALLTYPE AddRef ()
 
virtual ULONG STDMETHODCALLTYPE Release ()
 
virtual HRESULT STDMETHODCALLTYPE get_attributes (BSTR *attributes)
 

Additional Inherited Members

- Properties inherited from IAccessibleText2
BSTR attributeRange ([in] long offset, [in] BSTR filter, [out] long startOffset, [out] long endOffset) [get]
 Returns the range and of the specified set of attributes. More...
 
- Properties inherited from IAccessibleText
BSTR attributes ([in] long offset, [out] long startOffset, [out] long endOffset) [get]
 Returns text attributes. More...
 
long caretOffset [get]
 Returns the position of the caret. More...
 
long characterExtents ([in] long offset, [in] IA2CoordinateType coordType, [out] long x, [out] long y, [out] long width) [get]
 Returns the bounding box of the specified position. More...
 
long nSelections [get]
 Returns the number of active non-contiguous selections. More...
 
long offsetAtPoint ([in] long x, [in] long y, [in] IA2CoordinateType coordType) [get]
 Returns the text position for the specified screen position. More...
 
long selection ([in] long selectionIndex, [out] long startOffset) [get]
 Returns the character offsets of Nth active text selection. More...
 
BSTR text ([in] long startOffset, [in] long endOffset) [get]
 Returns the substring between the two given indices. More...
 
BSTR textBeforeOffset ([in] long offset, [in] IA2TextBoundaryType boundaryType, [out] long startOffset, [out] long endOffset) [get]
 Returns a text portion before the given position. More...
 
BSTR textAfterOffset ([in] long offset, [in] IA2TextBoundaryType boundaryType, [out] long startOffset, [out] long endOffset) [get]
 Returns a text portion after the given position. More...
 
BSTR textAtOffset ([in] long offset, [in] IA2TextBoundaryType boundaryType, [out] long startOffset, [out] long endOffset) [get]
 Returns a text portion that spans the given position. More...
 
long nCharacters [get]
 Returns total number of characters. More...
 
IA2TextSegment newText [get]
 Returns any inserted text. More...
 
IA2TextSegment oldText [get]
 Returns any removed text. More...
 

Constructor & Destructor Documentation

◆ AccessibleText()

AccessibleText::AccessibleText ( WebCore::AccessibilityObject obj,
HWND  window 
)

◆ ~AccessibleText()

virtual AccessibleText::~AccessibleText ( )
inlinevirtual

Member Function Documentation

◆ AddRef()

virtual ULONG STDMETHODCALLTYPE AccessibleText::AddRef ( )
inlinevirtual

◆ addSelection()

HRESULT AccessibleText::addSelection ( long  startOffset,
long  endOffset 
)
virtual

Adds a text selection.

Parameters
[in]startOffsetStarting offset ( 0 based).
[in]endOffsetOffset of first character after new selection (0 based).
Return values
S_OK
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleText methods.

Implements IAccessibleText.

◆ copyText()

HRESULT AccessibleText::copyText ( long  startOffset,
long  endOffset 
)
virtual

Copies the text range into the clipboard.

The selection is set to the specified offsets and then selection is copied into the system clipboard.

Parameters
[in]startOffsetStart index of the text to moved into the clipboard. The valid range is 0..length.
[in]endOffsetEnd index of the text to moved into the clipboard. The valid range is 0..length.
Return values
S_OK
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleEditableText methods.
Deprecated:
This function is available via the application's GUI.

Implements IAccessibleEditableText.

◆ cutText()

HRESULT AccessibleText::cutText ( long  startOffset,
long  endOffset 
)
virtual

Deletes a range of text and copies it to the clipboard.

The selection is set to the specified offsets, the selection is then copied into the system clipboard, and then the selection is deleted.

Parameters
[in]startOffsetStart index of the text to be deleted. The valid range is 0..length.
[in]endOffsetEnd index of the text to be deleted. The valid range is 0..length.
Return values
S_OK
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleEditableText methods.
Deprecated:
This function is available via the application's GUI.

Implements IAccessibleEditableText.

◆ deleteText()

HRESULT AccessibleText::deleteText ( long  startOffset,
long  endOffset 
)
virtual

Deletes a range of text.

The text between and including the two given indices is deleted from the text represented by this object.

Parameters
[in]startOffsetStart index of the text to be deleted. The valid range is 0..length.
[in]endOffsetEnd index of the text to be deleted. The valid range is 0..length.
Return values
S_OK
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleEditableText methods.

Implements IAccessibleEditableText.

◆ get_attributeRange()

HRESULT AccessibleText::get_attributeRange ( long  offset,
BSTR  filter,
long *  startOffset,
long *  endOffset,
BSTR attributeValues 
)
virtual

◆ get_attributes() [1/2]

HRESULT AccessibleText::get_attributes ( long  offset,
long *  startOffset,
long *  endOffset,
BSTR textAttributes 
)
virtual

◆ get_attributes() [2/2]

HRESULT AccessibleText::get_attributes ( BSTR attributes)
virtual

◆ get_caretOffset()

HRESULT AccessibleText::get_caretOffset ( long *  offset)
virtual

◆ get_characterExtents()

HRESULT AccessibleText::get_characterExtents ( long  offset,
enum IA2CoordinateType  coordType,
long *  x,
long *  y,
long *  width,
long *  height 
)
virtual

◆ get_nCharacters()

HRESULT AccessibleText::get_nCharacters ( long *  characters)
virtual

◆ get_newText()

HRESULT AccessibleText::get_newText ( IA2TextSegment newText)
virtual

◆ get_nSelections()

HRESULT AccessibleText::get_nSelections ( long *  nSelections)
virtual

◆ get_offsetAtPoint()

HRESULT AccessibleText::get_offsetAtPoint ( long  x,
long  y,
enum IA2CoordinateType  coordType,
long *  offset 
)
virtual

◆ get_oldText()

HRESULT AccessibleText::get_oldText ( IA2TextSegment oldText)
virtual

◆ get_selection()

HRESULT AccessibleText::get_selection ( long  selectionIndex,
long *  startOffset,
long *  endOffset 
)
virtual

◆ get_text()

HRESULT AccessibleText::get_text ( long  startOffset,
long  endOffset,
BSTR text 
)
virtual

◆ get_textAfterOffset()

HRESULT AccessibleText::get_textAfterOffset ( long  offset,
enum IA2TextBoundaryType  boundaryType,
long *  startOffset,
long *  endOffset,
BSTR text 
)
virtual

◆ get_textAtOffset()

HRESULT AccessibleText::get_textAtOffset ( long  offset,
enum IA2TextBoundaryType  boundaryType,
long *  startOffset,
long *  endOffset,
BSTR text 
)
virtual

◆ get_textBeforeOffset()

HRESULT AccessibleText::get_textBeforeOffset ( long  offset,
enum IA2TextBoundaryType  boundaryType,
long *  startOffset,
long *  endOffset,
BSTR text 
)
virtual

◆ insertText()

HRESULT AccessibleText::insertText ( long  offset,
BSTR text 
)
virtual

Inserts text at the specified position.

The specified string is inserted at the given index into the text represented by this object.

Parameters
[in]offsetIndex at which to insert the text. The valid range is 0..length. Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleEditableText methods.
[in]textText that is inserted.
Return values
S_OK
E_INVALIDARGif bad [in] passed

Implements IAccessibleEditableText.

◆ pasteText()

HRESULT AccessibleText::pasteText ( long  offset)
virtual

Pastes content from the clipboard.

Any existing selection is removed, the clipboard content is then pasted into this object's text at the given offset. This method is similar to the insertText method. If the index is not valid the system clipboard content is not inserted. The behavior is the same as when Ctrl+V is used, i.e. the pasted contents are not necessarily plain text.

Parameters
[in]offsetIndex at which to insert the content from the system clipboard into the text represented by this object. The valid range is 0..length. Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleEditableText methods.
Return values
S_OK
E_INVALIDARGif bad [in] passed
Deprecated:
This function is available via the application's GUI.

Implements IAccessibleEditableText.

◆ QueryInterface()

HRESULT AccessibleText::QueryInterface ( _In_ REFIID  riid,
_COM_Outptr_ void **  ppvObject 
)
virtual

◆ Release()

ULONG AccessibleText::Release ( void  )
virtual

◆ removeSelection()

HRESULT AccessibleText::removeSelection ( long  selectionIndex)
virtual

Unselects a range of text.

Parameters
[in]selectionIndexIndex of selection to remove (0 based).
Return values
S_OK
E_INVALIDARGif bad [in] passed

Implements IAccessibleText.

◆ replaceText()

HRESULT AccessibleText::replaceText ( long  startOffset,
long  endOffset,
BSTR text 
)
virtual

Replaces text.

The text between the two given indices is replaced by the specified replacement string. This method is equivalent to calling first IAccessibleEditableText::deleteText with the two indices and then calling IAccessibleEditableText::insertText with the replacement text at the start index.

Parameters
[in]startOffsetStart index of the text to be replaced. The valid range is 0..length.
[in]endOffsetEnd index of the text to be replaced. The valid range is 0..length.
[in]textThe Text that replaces the text between the given indices.
Return values
S_OK
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleEditableText methods.

Implements IAccessibleEditableText.

◆ scrollSubstringTo()

HRESULT AccessibleText::scrollSubstringTo ( long  startIndex,
long  endIndex,
enum IA2ScrollType  scrollType 
)
virtual

Makes a specific part of string visible on screen.

Parameters
[in]startIndex0 based character offset.
[in]endIndex0 based character offset - the offset of the character just past the last character of the string.
[in]scrollTypeDefines where the object should be placed on the screen.
Return values
S_OK
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleText methods.

Implements IAccessibleText.

◆ scrollSubstringToPoint()

HRESULT AccessibleText::scrollSubstringToPoint ( long  startIndex,
long  endIndex,
enum IA2CoordinateType  coordinateType,
long  x,
long  y 
)
virtual

Moves the top left of a substring to a specified location.

Parameters
[in]startIndex0 based character offset.
[in]endIndex0 based character offset - the offset of the character just past the last character of the string.
[in]coordinateTypeSpecifies whether the coordinates are relative to the screen or the parent object.
[in]xDefines the x coordinate.
[in]yDefines the y coordinate.
Return values
S_OK
S_FALSEif the object is already at the specified location.
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleText methods.

Implements IAccessibleText.

◆ setAttributes()

HRESULT AccessibleText::setAttributes ( long  startOffset,
long  endOffset,
BSTR attributes 
)
virtual

Replaces the attributes of a text range by the given set of attributes.

Sets the attributes for the text between the two given indices. The old attributes are replaced by the new list of attributes.

Parameters
[in]startOffsetStart index of the text whose attributes are modified. The valid range is 0..length.
[in]endOffsetEnd index of the text whose attributes are modified. The valid range is 0..length.
[in]attributesSet of attributes that replaces the old list of attributes of the specified text portion.
Return values
S_OK
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleEditableText methods.

Implements IAccessibleEditableText.

◆ setCaretOffset()

HRESULT AccessibleText::setCaretOffset ( long  offset)
virtual

Sets the position of the caret.

The caret position/offset is that of the character logically following it, e.g. to the right of it in a left to right language.

Setting the caret position may or may not alter the current selection. A change of the selection is notified to the accessibility event listeners with an ::IA2_EVENT_TEXT_SELECTION_CHANGED event.

When the new caret position differs from the old one (which, of course, is the standard case) this is notified to the accessibility event listeners with an ::IA2_EVENT_TEXT_CARET_MOVED event.

Parameters
[in]offsetThe new index of the caret. This caret is actually placed to the left side of the character with that index. An index of 0 places the caret so that the next insertion goes before the first character. An index of IAccessibleText::nCharacters leads to insertion after the last character. Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleText methods.
Return values
S_OK
E_FAILif the caret cannot be set
E_INVALIDARGif bad [in] passed

Implements IAccessibleText.

◆ setSelection()

HRESULT AccessibleText::setSelection ( long  selectionIndex,
long  startOffset,
long  endOffset 
)
virtual

Changes the bounds of an existing selection.

Parameters
[in]selectionIndexIndex of selection to change (0 based)
[in]startOffsetNew starting offset (0 based)
[in]endOffsetNew ending offset (0 based) - the offset of the character just past the last character of the selection.
Return values
S_OK
E_INVALIDARGif bad [in] passed
Note
Refer to Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods for information about special offsets that can be used in IAccessibleText methods.

Implements IAccessibleText.


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