ooodev.adapter.text.text_view_cursor_partial module

class ooodev.adapter.text.text_view_cursor_partial.TextViewCursorPartial(component, interface=com.sun.star.text.XTextViewCursor)[source]

Bases: TextCursorPartial

Partial class for XTextViewCursor.

Parameters:
  • component (XTextViewCursor) –

  • interface (UnoInterface | None) –

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

Constructor

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

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

Return type:

None

get_position()[source]

Gets the cursor’s coordinates relative to the top left position of the first page of the document in 1/100 mm.

Returns:

The cursor’s coordinates as com.sun.star.awt.Point. in 1/100 mm.

Return type:

Point

Note

The X coordinate is the horizontal position, the Y coordinate is the vertical position.

Warning

The X is relative to the document window and not the document page. This means when the document window size changes the X coordinate will change even if the cursor has not moved. This is also the case if the document zoom changes.

When the document page is zoomed all the way to fill the document window the X coordinate is 0 when at the left hand page margin (beginning of a line).

The Y coordinate is relative to the top of the document window and not the top of the document page. The Y coordinate seems not to be affected by Document Zoom or scroll position.

is_visible()[source]

Returns True if the cursor is visible.

Return type:

bool

set_visible(visible=True)[source]

Sets the visibility of the cursor.

Parameters:

visible (bool, optional) – True to set the view cursor visible, False to hide it. Defaults to True.

Return type:

None