LibreOffice: XTextCursor Interface Reference

LibreOffice LibreOffice 26.8 SDK API Reference

Loading...
Searching...
No Matches
XTextCursor Interface Referencepublished

extends a text range by method to modify its position. More...

`import "XTextCursor.idl";`

Inheritance diagram for XTextCursor:

## Public Member Functions
void | collapseToStart ()
| sets the end of the position to the start.
void | collapseToEnd ()
| sets the start of the position to the end.
boolean | isCollapsed ()
| determines if the start and end positions are the same.
boolean | goLeft ([in] short nCount, [in] boolean bExpand)
| moves the cursor the specified number of characters to the left.
boolean | goRight ([in] short nCount, [in] boolean bExpand)
| moves the cursor the specified number of characters to the right.
void | gotoStart ([in] boolean bExpand)
| moves the cursor to the start of the text.
void | gotoEnd ([in] boolean bExpand)
| moves the cursor to the end of the text.
void | gotoRange ([in] com::sun::star::text::XTextRange xRange, [in] boolean bExpand)
| moves or expands the cursor to a specified TextRange.
Public Member Functions inherited from XTextRange
XText | getText ()
XTextRange | getStart ()
XTextRange | getEnd ()
string | getString ()
void | setString ([in] string aString)
| the whole string of characters of this piece of text is replaced.
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.

## Detailed Description

extends a text range by method to modify its position.

## Member Function Documentation

## ◆ collapseToEnd()

void collapseToEnd | ( |  | ) |

sets the start of the position to the end.

## ◆ collapseToStart()

void collapseToStart | ( |  | ) |

sets the end of the position to the start.

## ◆ goLeft()

boolean goLeft | ( | [in] short | nCount,
|  | [in] boolean | bExpand )

moves the cursor the specified number of characters to the left.

Parameters

  nCount | the number of characters to move.
  bExpand | specifies if the current selection of the cursor should be expanded or not.

Returns
  TRUE if the command was successfully completed. FALSE otherwise.

Note: Even if the command was not completed successfully it may be completed partially. E.g. if it was required to move 5 characters but it is only possible to move 3 FALSE will be returned and the cursor moves only those 3 characters.

## ◆ goRight()

boolean goRight | ( | [in] short | nCount,
|  | [in] boolean | bExpand )

moves the cursor the specified number of characters to the right.

Parameters

  nCount | the number of characters to move.
  bExpand | specifies if the current selection of the cursor should be expanded or not.

Returns
  TRUE if the command was successfully completed. FALSE otherwise.

Note: Even if the command was not completed successfully it may be completed partially. E.g. if it was required to move 5 characters but it is only possible to move 3 FALSE will be returned and the cursor moves only those 3 characters.

## ◆ gotoEnd()

void gotoEnd | ( | [in] boolean | bExpand | ) |

moves the cursor to the end of the text.

## ◆ gotoRange()

void gotoRange | ( | [in] com::sun::star::text::XTextRange | xRange,
|  | [in] boolean | bExpand )

moves or expands the cursor to a specified TextRange.

## ◆ gotoStart()

void gotoStart | ( | [in] boolean | bExpand | ) |

moves the cursor to the start of the text.

## ◆ isCollapsed()

boolean isCollapsed | ( |  | ) |

determines if the start and end positions are the same.

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

- com/sun/star/text/XTextCursor.idl