LibreOffice
LibreOffice 24.2 SDK API Reference
Public Member Functions | List of all members
XAccessibleMultiLineText Interface Reference

Implement this interface to give provide a mapping between text index and line numbers. More...

import"XAccessibleMultiLineText.idl";

Inheritance diagram for XAccessibleMultiLineText:
XAccessibleText XInterface

Public Member Functions

long getLineNumberAtIndex ([in] long nIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException)
 Returns the line number at the specified index. More...
 
TextSegment getTextAtLineNumber ([in] long nLineNo) raises (::com::sun::star::lang::IndexOutOfBoundsException)
 Returns the text of the specified line. More...
 
TextSegment getTextAtLineWithCaret ()
 Returns the text of the line in which the caret is located. More...
 
long getNumberOfLineWithCaret ()
 Returns the number of the line in which the caret is located. 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::PropertyValuegetCharacterAttributes ([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 give provide a mapping between text index and line numbers.

This interface is typically used in conjunction with the XAccessibleText interface and extents it with a notion of line numbers

Since
OOo 3.0not yet published

Member Function Documentation

◆ getLineNumberAtIndex()

long getLineNumberAtIndex ( [in] long  nIndex)
raises (::com::sun::star::lang::IndexOutOfBoundsException
)

Returns the line number at the specified index.

For a text object that is spread over multiple lines, this method provides a mapping from a text index to the corresponding line number.

Parameters
nIndexIndex for which the line number should be returned. The valid range is 0..length.
Returns
Returns the line number of the specified text index.
Exceptions
com::sun::star::lang::IndexOutOfBoundsExceptionif the index is invalid.

◆ getNumberOfLineWithCaret()

long getNumberOfLineWithCaret ( )

Returns the number of the line in which the caret is located.

The line number returned will most of the time be identical to calling XAccessibleMultiLineText::getLineNumberAtIndex() with the index returned by XAccessibleText::getCaretPosition() beside the following special case:

Some text implementations place the caret at the end of the current line when the End key gets pressed. Since the index of this position is identical to the one of the first character of the following line, XAccessibleMultiLineText::getLineNumberAtIndex() will return the line following the current one in this case.

Returns
Returns the index of the line in which the caret is located or -1 if the paragraph does not have a valid caret position.

◆ getTextAtLineNumber()

TextSegment getTextAtLineNumber ( [in] long  nLineNo)
raises (::com::sun::star::lang::IndexOutOfBoundsException
)

Returns the text of the specified line.

Returns the substring of text that makes up the specified line number.

The number of lines can be obtained by calling XAccessibleMultiLineText::getLineNumberAtIndex() with the index of the last character. In a loop, the last line has been reached when TextSegment::SegmentEnd of the returned value is equal to the index of the last character of the text.

Parameters
nLineNoThe number of the line to return the substring from. The valid range is 0..getLineNumberAtIndex(getCharacterCount()).
Returns
Returns the requested text portion. This portion may be empty or invalid when no appropriate text portion is found.
Exceptions
com::sun::star::lang::IndexOutOfBoundsExceptionif the line number is invalid

◆ getTextAtLineWithCaret()

TextSegment getTextAtLineWithCaret ( )

Returns the text of the line in which the caret is located.

The substring returned will most of the time be identical to calling XAccessibleText::getTextAtIndex() with the index returned by XAccessibleText::getCaretPosition() and type AccessibleTextType::LINE beside the following special case:

Some text implementations place the caret at the end of the current line when the End key gets pressed. Since the index of this position is identical to the one of the first character of the following line, XAccessibleMultiLineText::getLineNumberAtIndex() will return the line following the current one in this case.

Returns
Returns the requested text portion. This portion may be empty or invalid if the paragraph object does not have a valid caret position.

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