LibreOffice: XAccessibleHypertext Interface Reference

LibreOffice LibreOffice 7.3 SDK API Reference

Public Member Functions | List of all members
XAccessibleHypertext Interface Reference

Implement this interface to expose the hypertext structure of a document. More...

`import"XAccessibleHypertext.idl";`

Inheritance diagram for XAccessibleHypertext:

## Public Member Functions
long | getHyperLinkCount ()
| Returns the number of links and link groups contained within this hypertext document. More...
XAccessibleHyperlink | getHyperLink ([in] long nLinkIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Return the specified link. More...
long | getHyperLinkIndex ([in] long nCharIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Returns the index of the hyperlink that is associated with this character index. More...
Public Member Functions inherited from XAccessibleText
long | getCaretPosition ()
| Return the position of the caret. More...
boolean | setCaretPosition ([in] long nIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Set the position of the caret. More...
char | getCharacter ([in] long nIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Return the character at the specified position. More...
sequence<::com::sun::star::beans::PropertyValue > | getCharacterAttributes ([in] long nIndex, [in] sequence< string > aRequestedAttributes) raises (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::beans::UnknownPropertyException)
| Get the attribute set for the specified position. More...
::com::sun::star::awt::Rectangle | getCharacterBounds ([in] long nIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Return the bounding box of the specified position. More...
long | getCharacterCount ()
| Return the number of characters in the represented text. More...
long | getIndexAtPoint ([in] ::com::sun::star::awt::Point aPoint)
| Return the text position for the specified screen position. More...
string | getSelectedText ()
| Return the selected text. More...
long | getSelectionStart ()
| Return the position of the start of the selection. More...
long | getSelectionEnd ()
| Return the position of the end of the selection. More...
boolean | setSelection ([in] long nStartIndex, [in] long nEndIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Set a new selection. More...
string | getText ()
| Return the whole text. More...
string | getTextRange ([in] long nStartIndex, [in] long nEndIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Return the specified text range. More...
TextSegment | getTextAtIndex ([in] long nIndex, [in] short nTextType) raises (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException)
| Get a text portion around the given position. More...
TextSegment | getTextBeforeIndex ([in] long nIndex, [in] short nTextType) raises (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException)
| Get a text portion before the given position. More...
TextSegment | getTextBehindIndex ([in] long nIndex, [in] short nTextType) raises (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException)
| Get a text portion behind the given position. More...
boolean | copyText ([in] long nStartIndex, [in] long nEndIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Copy the specified text into the clipboard. More...
boolean | scrollSubstringTo ([in] long nStartIndex, [in] long nEndIndex, [in] AccessibleScrollType aScrollType) raises (::com::sun::star::lang::IndexOutOfBoundsException)
| Scroll the specified text to make it visible on screen. More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

Implement this interface to expose the hypertext structure of a document.

The XAccessibleHypertext interface is the main interface to expose hyperlinks in a document, typically a text document, that are used to reference other (parts of) documents. For supporting the XAccessibleHypertext::getLinkIndex() method of this interface and other character related methods of the XAccessibleHyperlink interface, it is necessary to also support the XAccessibleText interface.

See also
  XAccessibleHyperlink, XAccessibleText

Since
  OOo 1.1.2

## Member Function Documentation

## ◆ getHyperLink()

XAccessibleHyperlink getHyperLink | ( | [in] long | nLinkIndex | ) |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException
| ) |  |

Return the specified link.

The returned XAccessibleHyperlink object encapsulates the hyperlink and provides several kinds of information describing it.

Parameters

  nLinkIndex | This index specifies the hyperlink to return.

Returns
  If the given index is valid, i.e. lies in the interval from 0 to the number of links minus one, a reference to the specified hyperlink object is returned. If the index is invalid then an empty reference is returned.

## ◆ getHyperLinkCount()

long getHyperLinkCount | ( |  | ) |

Returns the number of links and link groups contained within this hypertext document.

Returns
  The number of links and link groups within this hypertext document. Returns 0 if there is no link.

## ◆ getHyperLinkIndex()

long getHyperLinkIndex | ( | [in] long | nCharIndex | ) |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException
| ) |  |

Returns the index of the hyperlink that is associated with this character index.

In a HTML document this is the case when a <a href> tag spans (includes) the given character index.

Parameters

  nCharIndex | Index of the character for which to return the link index. If the XAccessibleText interface is used to represent the text containing the link, then the character index is only valid if it is greater than or equal to zero and lower than the number of characters in the text. See that interface's documentation for more details.

Returns
  Returns the index of the hyperlink that is associated with this character index, or throws an exception if there is no hyperlink associated with this index.

See also
  XAccessibleText.

The documentation for this interface was generated from the following file:

- com/sun/star/accessibility/XAccessibleHypertext.idl