Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: text ::

interface XTextCursor
Base Interfaces
XTextCursorXTextRange

XTextRange
(referenced interface's summary:)
describes the object's position in a text.
Description
extends a text range by method to modify its position.

Methods' Summary
collapseToStart sets the end of the position to the start.  
collapseToEnd sets the start of the position to the end.  
isCollapsed determines if the start and end positions are the same.  
goLeft moves the cursor the specified number of characters to the left.  
goRight moves the cursor the specified number of characters to the right.  
gotoStart moves the cursor to the start of the text.  
gotoEnd moves the cursor to the end of the text.  
gotoRange moves or expands the cursor to a specified TextRange.  
Methods' Details
collapseToStart
[oneway] void
collapseToStart();

Description
sets the end of the position to the start.
collapseToEnd
[oneway] void
collapseToEnd();

Description
sets the start of the position to the end.
isCollapsed
boolean
isCollapsed();

Description
determines if the start and end positions are the same.
goLeft
boolean
goLeft( [in] short  nCount,
[in] boolean  bExpand );

Description
moves the cursor the specified number of characters to the left.
Parameter nCount
the number of characters to move.
Parameter 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 );

Description
moves the cursor the specified number of characters to the right.
Parameter nCount
the number of characters to move.
Parameter 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.

gotoStart
void
gotoStart( [in] boolean  bExpand );

Description
moves the cursor to the start of the text.
gotoEnd
void
gotoEnd( [in] boolean  bExpand );

Description
moves the cursor to the end of the text.
gotoRange
void
gotoRange( [in] XTextRange  xRange,
[in] boolean  bExpand );

Description
moves or expands the cursor to a specified TextRange.
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.