Class CalcSheetView

class ooodev.calc.CalcSheetView(owner, view, lo_inst=None)[source]

Bases: LoInstPropsPartial, SpreadsheetViewComp, SpreadsheetViewSettingsComp, QiPartial, PropPartial, StylePartial, ServicePartial, CalcDocPropPartial

Constructor.

Parameters:
  • lo_inst (LoInst, optional) – Lo instance.

  • owner (CalcDoc) –

  • view (XSpreadsheetView) –

abort_range_selection()

Aborts the current range selection.

Return type:

None

add_activation_event_listener(listener)

Adds the specified activation event listener to receive activation events from this source.

Parameters:

listener (XActivationEventListener) – The activation event listener to add.

Return type:

None

add_enhanced_mouse_click_handler(handler)

Adds the specified mouse click handler to receive mouse click events from this source.

Parameters:

handler (XEnhancedMouseClickHandler) – The mouse click handler to add.

Return type:

None

add_event_activation_event_events_disposing(cb)

Adds a listener for an event.

Event is invoked when the broadcaster is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_active_spreadsheet_changed(cb)

Adds a listener for an event.

Event is invoked whenever data or a selection changed.

The callback EventArgs.event_data will contain a UNO com.sun.star.sheet.ActivationEvent struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_descriptor_changed(cb)

Adds a listener for an event.

Event is invoked when the selected range is changed while range selection is active.

The callback EventArgs.event_data will contain a UNO com.sun.star.sheet.RangeSelectionEvent struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_enhanced_mouse_click_events_disposing(cb)

Adds a listener for an event.

Event is invoked when the broadcaster is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_key_events_disposing(cb)

Adds a listener for an event.

Event is invoked when the broadcaster is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_key_pressed(cb)

Adds a listener for an event.

Event is invoked when a key has been pressed.

The callback EventArgs.event_data will contain a UNO com.sun.star.awt.KeyEvent struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_key_released(cb)

Adds a listener for an event.

Event is invoked when a key has been released.

The callback EventArgs.event_data will contain a UNO com.sun.star.awt.KeyEvent struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_mouse_pressed(cb)

Adds a listener for an event.

Event is invoked when a mouse button has been pressed on a window.

The callback EventArgs.event_data will contain a UNO com.sun.star.awt.EnhancedMouseEvent struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_mouse_released(cb)

Adds a listener for an event.

Event is invoked when a mouse button has been released on a window.

The callback EventArgs.event_data will contain a UNO com.sun.star.awt.EnhancedMouseEvent struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_property_change(name, cb)

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
Return type:

None

add_event_property_change_events_disposing(name, cb)

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
Return type:

None

add_event_range_selection_change_events_disposing(cb)

Adds a listener for an event.

Event is invoked when the broadcaster is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_selection_change_events_disposing(cb)

Adds a listener for an event.

Event is invoked when the broadcaster is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_selection_changed(cb)

Adds a listener for an event.

Event is invoked when the selection changes.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

add_event_vetoable_change(name, cb)

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
Return type:

None

add_event_vetoable_change_events_disposing(name, cb)

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
Return type:

None

add_range_selection_change_listener(listener)

Adds the specified listener to receive events when the selection changes.

Parameters:

listener (XRangeSelectionChangeListener) – The listener to add.

Return type:

None

add_range_selection_listener(listener)

Adds the specified listener to receive events when the selection changes.

Parameters:

listener (XRangeSelectionListener) – The listener to add.

Return type:

None

add_selection_change_listener(listener)

Adds a selection change listener.

Parameters:

listener (XSelectionChangeListener) – The listener to be added.

Return type:

None

apply_styles(*styles, **kwargs)

Applies style to component.

Parameters:
  • obj. (styles expandable list of styles object such as Font to apply to) –

  • kwargs (Any, optional) – Expandable list of key value pairs.

  • styles (StyleT) –

Return type:

None

create_enumeration()

Creates an enumeration of the container’s elements.

Return type:

XEnumeration

freeze_at_position(col, row)

Freezes panes with the specified number of columns and rows.

To freeze only horizontally, specify rows as 0. To freeze only vertically, specify col as 0.

Parameters:
  • col (int) – The column to freeze.

  • row (int) – The row to freeze.

Return type:

None

get_active_sheet()

Gets the active sheet of the spreadsheet document.

Return type:

XSpreadsheet

get_by_index(idx)

Gets the element at the specified index.

Parameters:

idx (int) – The Zero-based index of the element.

Returns:

The element at the specified index.

Return type:

Any

get_count()

Gets the number of elements contained in the container.

Returns:

The number of elements.

Return type:

int

get_element_type()

Gets the type of the elements contained in the container.

Returns:

The type of the elements. None means that it is a multi-type container and you cannot determine the exact types with this interface.

Return type:

Any

get_first_visible_column()

Gets the first column that is visible in the pane.

Return type:

int

get_first_visible_row()

Gets the first row that is visible in the pane.

Return type:

int

get_is_window_split()

Gets whether the window is split.

Return type:

bool

get_property(name, default=<object object>)

Get property value

Parameters:
  • name (str) – Property Name.

  • default (Any, optional) – Return value if property value is None.

Returns:

Property value or default.

Return type:

Any

get_referred_cells()

Gets the cell range that is referred to.

Return type:

XCellRange

get_selection()[source]

Returns the current selection.

Returns:

Selection

Return type:

Any

get_services()

Gets service names for the instance.

Returns:

service names

Return type:

List[str]

get_split_column()

Gets the column where the window is split.

Return type:

int

get_split_horizontal()

Gets the horizontal position in pixels where the view is split.

Return type:

int

get_split_row()

Gets the row where the window is split.

Return type:

int

get_split_vertical()

Gets the vertical position in pixels where the view is split.

Return type:

int

get_visible_range()

Gets the address of the cell range that consists of the cells which are visible in the pane.

Return type:

CellRangeAddress

has_elements()

Determines whether the container has elements.

Return type:

bool

has_frozen_panes()

Gets whether the view has frozen panes.

Return type:

bool

qi(atype, raise_err=False)

Generic method that get an interface instance from an object.

Parameters:
  • atype (T) – Interface type to query obj for. Any Uno class that starts with ‘X’ such as XInterface

  • raise_err (bool, optional) – If True then raises MissingInterfaceError if result is None. Default False

Raises:

MissingInterfaceError – If ‘raise_err’ is ‘True’ and result is None

Returns:

instance of interface if supported; Otherwise, None

Return type:

T | None

Note

When raise_err=True return value will never be None.

remove_activation_event_listener(listener)

Removes the specified activation event listener so that it no longer receives activation events from this source.

Parameters:

listener (XActivationEventListener) – The activation event listener to remove.

Return type:

None

remove_enhanced_mouse_click_handler(handler)

Removes the specified mouse click handler so it does not receive mouse click events from this source anymore.

Parameters:

handler (XEnhancedMouseClickHandler) – The mouse click handler to remove.

Return type:

None

remove_event_activation_event_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_active_spreadsheet_changed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_descriptor_changed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_enhanced_mouse_click_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_key_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_key_pressed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_key_released(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_modified(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_mouse_pressed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_mouse_released(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_property_change(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_property_change_events_disposing(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_range_selection_change_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_selection_change_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (EventArgsCallbackT) –

remove_event_vetoable_change(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_vetoable_change_events_disposing(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_range_selection_change_listener(listener)

Removes the specified listener so it does not receive events when the selection changes.

Parameters:

listener (XRangeSelectionChangeListener) – The listener to remove.

Return type:

None

remove_range_selection_listener(listener)

Removes the specified listener so it does not receive events when the selection changes.

Parameters:

listener (XRangeSelectionListener) – The listener to remove.

Return type:

None

remove_selection_change_listener(listener)

Removes a selection change listener.

Parameters:

listener (XSelectionChangeListener) – The listener to be removed.

Return type:

None

select(selection: ooodev.calc.calc_cell_range.CalcCellRange)[source]
select(selection: ooodev.calc.calc_cell.CalcCell)
select(selection: ooodev.calc.calc_cell_cursor.CalcCellCursor)
select(selection)

Selects the object represented by xSelection if it is known and selectable in this object.

Parameters:

selection (Any) – Selection

Returns:

True if selection was successful; Otherwise, False

Return type:

bool

set_active_sheet(sheet)

Sets the active sheet of the spreadsheet document.

Return type:

None

Parameters:

sheet (XSpreadsheet) –

set_first_visible_column(column)

Sets the first column that is visible in the pane.

Return type:

None

Parameters:

column (int) –

set_first_visible_row(row)

Sets the first row that is visible in the pane.

Return type:

None

Parameters:

row (int) –

set_property(**kwargs)

Set property value

Parameters:

**kwargs (Any) – Variable length Key value pairs used to set properties.

Return type:

None

split_at_position(x, y)

Splits the window at the specified position.

Parameters:
  • x (int, UnitT) – The horizontal position in pixels or UnitT where the view is split.

  • y (int, UnitT) – The vertical position in pixels or UnitT where the view is split.

Return type:

None

start_range_selection(args)

Starts a range selection.

Parameters:

args (tuple[PropertyValue, ...]) – Specifies how the range selection is done.

support_service(*service)

Gets if instance supports a service.

Parameters:

*service (str) – Variable length argument list of UNO namespace strings such as com.sun.star.configuration.GroupAccess

Returns:

True if instance supports any passed in service; Otherwise, False

Return type:

bool

property calc_doc: CalcDoc

Calc Document.

Return type:

CalcDoc

property component: com.sun.star.sheet.SpreadsheetViewPane

Volatile Result Component

Return type:

SpreadsheetViewPane

property events_listener_activation_event: ActivationEventListener

Returns listener

Return type:

ActivationEventListener

property events_listener_enhanced_mouse_click: EnhancedMouseClickHandler

Returns listener

Return type:

EnhancedMouseClickHandler

property events_listener_key: KeyListener

Returns listener

Return type:

KeyListener

property events_listener_mouse_click: MouseClickHandler

Returns listener

Return type:

MouseClickHandler

property events_listener_range_selection_change: RangeSelectionChangeListener

Returns listener

Return type:

RangeSelectionChangeListener

property events_listener_selection_change: SelectionChangeListener

Returns listener

Return type:

SelectionChangeListener

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property show_formulas: bool

Gets/Sets whether formulas are displayed instead of their results.

Return type:

bool

property show_grid: bool

Gets/Sets whether the grid is displayed.

Return type:

bool

property show_help_lines: bool

Enables display of help lines when moving drawing objects.

Return type:

bool

property show_notes: bool

Gets/Sets whether a marker is shown for notes in cells.

Return type:

bool

property show_objects: SpreadsheetViewObjectsModeEnum

Gets/Sets whether objects are displayed.

Return type:

SpreadsheetViewObjectsModeEnum

property show_page_breaks: bool

Gets/Sets whether page breaks are displayed.

Return type:

bool

property show_zero_values: bool

Gets/Sets whether zero values are displayed.

Return type:

bool

property zoom_type: DocumentZoomTypeEnum

Gets/Sets the zoom type.

Can be set using an enum or an int.

  • OPTIMAL = 0

  • PAGE_WIDTH = 1

  • ENTIRE_PAGE = 2

  • BY_VALUE = 3

  • PAGE_WIDTH_EXACT = 4

Return type:

DocumentZoomTypeEnum

property zoom_value: int

Gets/Sets the zoom value.

Only valid if zoom_type = ooo.dyn.view.document_zoom_type.DocumentZoomTypeEnum.BY_VALUE or 3.

Return type:

int