ooodev.adapter.text.word_cursor_partial module

class ooodev.adapter.text.word_cursor_partial.WordCursorPartial(component, interface=com.sun.star.text.XWordCursor)[source]

Bases: object

Partial class for XWordCursor.

Parameters:
  • component (XWordCursor) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.text.XWordCursor)[source]

Constructor

Parameters:
  • component (XWordCursor) – UNO Component that implements com.sun.star.text.XWordCursor interface.

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XWordCursor.

Return type:

None

goto_end_of_word(expand=False)[source]

Moves the cursor to the end of the current word.

Parameters:

expand (bool, optional) – If True, the selection is expanded to the end of the word. Defaults to False.

Returns:

True if the cursor is moved, False otherwise.

Return type:

bool

goto_next_word(expand=False)[source]

Moves the cursor to the next word.

Parameters:

expand (bool, optional) – If True, the selection is expanded to the end of the word. Defaults to False.

Returns:

True if the cursor is moved, False otherwise.

Return type:

bool

Note

The function returning True does not necessarily mean that the cursor is located at the next word, or any word at all! This may happen for example if it travels over empty paragraphs.

goto_previous_word(expand=False)[source]

Moves the cursor to the previous word.

Parameters:

expand (bool, optional) – If True, the selection is expanded to the start of the word. Defaults to False.

Returns:

True if the cursor is moved, False otherwise.

Return type:

bool

Note

The function returning True does not necessarily mean that the cursor is located at the previous word, or any word at all! This may happen for example if it travels over empty paragraphs.

goto_start_of_word(expand=False)[source]

Moves the cursor to the start of the current word.

Parameters:

expand (bool, optional) – If True, the selection is expanded to the start of the word. Defaults to False.

Returns:

True if the cursor is moved, False otherwise.

Return type:

bool

is_end_of_word()[source]

Returns True if the cursor is at the end of a word.

Return type:

bool

is_start_of_word()[source]

Returns True if the cursor is at the start of a word.

Return type:

bool