Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: accessibility ::

unpublished interface XAccessibleMultiLineText
Base Interfaces
XAccessibleMultiLineTextXAccessibleText

XAccessibleText
(referenced interface's summary:)
Implement this interface to give read-only access to a text.
Usage Restrictions
not published
Description
not yet published

Methods' Summary
getLineNumberAtIndex Returns the line number at the specified index.  
getTextAtLineNumber Retuns the text of the specified line.  
getTextAtLineWithCaret Returns the text of the line in which the caret is located.  
getNumberOfLineWithCaret Returns the number of the line in which the caret is located.  
Methods' Details
getLineNumberAtIndex
long
getLineNumberAtIndex( [in] long  nIndex )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
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.

Parameter nIndex
Index for which the line number should be returned. The valid range is 0..length.
Returns
Returns the line number of the specified text index.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if the index is invalid.
getTextAtLineNumber
TextSegment
getTextAtLineNumber( [in] long  nLineNo )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
Retuns 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.

Parameter nLineNo
The 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.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if the line number is invalid
getTextAtLineWithCaret
TextSegment
getTextAtLineWithCaret();

Description
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 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.
getNumberOfLineWithCaret
long
getNumberOfLineWithCaret();

Description
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.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.