LibreOffice
LibreOffice 24.2 SDK API Reference
|
Implement this interface to give provide a mapping between text index and line numbers. More...
import"XAccessibleMultiLineText.idl";
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::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... | |
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
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.
nIndex | Index for which the line number should be returned. The valid range is 0..length. |
com::sun::star::lang::IndexOutOfBoundsException | if the index is invalid. |
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.
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.
nLineNo | The number of the line to return the substring from. The valid range is 0..getLineNumberAtIndex(getCharacterCount()). |
com::sun::star::lang::IndexOutOfBoundsException | if the line number is invalid |
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.