Class CalcSheetView

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

Bases: _CalcSheetView, LoInstPropsPartial, SpreadsheetViewComp, SpreadsheetViewSettingsComp, ContextMenuInterceptorEvents, ContextMenuInterceptionPartial, PropPartial, StylePartial, ServicePartial, TheDictionaryPartial, CalcDocPropPartial, CompDefaultsPartial, UserInputInterceptionPartial, PropertySetPartial, TransferableSupplierPartial, ControllerBorderPartial, Controller2Partial, DispatchInformationProviderPartial, DispatchProviderPartial, InfobarProviderPartial, TitleChangeBroadcasterPartial, TitlePartial, InitializationPartial, TypeProviderPartial, UnoTunnelPartial, StatusIndicatorSupplierPartial, BorderResizeEvents, TitleChangeEvents

Parameters:
  • owner (CalcDoc) –

  • view (XSpreadsheetView) –

__init__(owner, view, lo_inst=None)[source]

Constructor.

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

  • owner (CalcDoc) –

  • view (XSpreadsheetView) –

Return type:

None

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_border_resize_listener(listener)

Adds the specified listener to receive events about controller’s border resizing.

Return type:

None

Parameters:

listener (com.sun.star.frame.XBorderResizeListener) –

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 (Any) –

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 (Any) –

add_event_border_resize_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 (Any) –

add_event_border_widths_changed(cb)

Adds a listener for an event.

Event is invoked when the controller’s border widths have been changed.

The callback EventArgs.event_data will contain a dictionary with keys obj and new_size. The obj will be a UNO object and new_size will be a com.sun.star.frame.BorderWidths struct.

Return type:

None

Parameters:

cb (Any) –

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 (Any) –

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 (Any) –

add_event_key_handler_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 (Any) –

add_event_key_handler_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 (Any) –

add_event_key_handler_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 (Any) –

add_event_listener(listener)

Adds an event listener to the component.

Parameters:

listener (XEventListener) – The event listener to be added.

Return type:

None

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 (Any) –

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 (Any) –

add_event_notify_context_menu_execute(cb)

Adds and registers a listener for an event.

Notifies the interceptor about the request to execute a ContextMenu. The interceptor has to decide whether the menu should be executed with or without being modified or may ignore the call.

The call back event is an instance of GenericArgs[ContextMenuInterceptorEventData].

The callback GenericArgs.event_data will be an instance of ContextMenuInterceptorEventData.

The event_data.action defaults to ContextMenuInterceptorAction.IGNORED and can be modified to change the action. IGNORED in this context means that The next registered XContextMenuInterceptor should be notified.

Return type:

None

Parameters:

cb (Any) –

Hint: - ContextMenuInterceptorAction is an enum that can be imported from ooo.dyn.ui.context_menu_interceptor_action.

Note

Registering an interceptor adds it to the front of the interceptor chain, so that it is called first. The order of removals is arbitrary. It is not necessary to remove the interceptor that registered last.

Each time this method is called, a new listener is created and registered if it does not already exist.

add_event_observers(*args)

Adds observers that gets their trigger method called when this class trigger method is called.

Parameters:

args (EventObserver) – One or more observers to add.

Return type:

None

Note

Observers are removed automatically when they are out of scope.

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:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

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:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

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 (Any) –

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 (Any) –

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 (Any) –

add_event_title_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 (Any) –

add_event_title_changed(cb)

Adds a listener for an event.

Event is invoked whenever the frame title has changed.

The callback EventArgs.event_data will contain a UNO com.sun.star.frame.TitleChangedEvent struct.

Return type:

None

Parameters:

cb (Any) –

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:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

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:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_key_handler(handler)

Adds a key handler.

Parameters:

handler (XKeyHandler) – The handler to be added.

Return type:

None

add_mouse_click_handler(handler)

Adds a mouse click handler.

Parameters:

handler (XMouseClickHandler) – The handler to be added.

Return type:

None

add_property_change_listener(name, listener)

Adds a listener for property changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be added.

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

add_title_change_listener(listener)

Add a listener.

Return type:

None

Parameters:

listener (com.sun.star.frame.XTitleChangeListener) –

add_vetoable_change_listener(name, listener)

Adds a listener for vetoable changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be added.

Return type:

None

append_infobar(id, primary_message, secondary_message, infobar_type, action_buttons, show_close_button)

Creates and displays a new Infobar.

The example below adds a new infobar named MyInfoBar with type INFO and close (x) button.

Parameters:
  • id (str) – The unique identifier of the Infobar.

  • primary_message (str) – The (short) primary message. Will appear at the start of the infobar in bold letters. May be empty.

  • secondary_message (str) – The (longer) secondary message. Will appear in normal letters after the primaryMessage

  • infobar_type (int | InfobarTypeEnum) – The type of the Infobar.

  • action_buttons (Tuple[StringPair, ...]) – A sequence of action buttons. The buttons will be added from Right to Left at the right side of the info bar. Each button is represented by a com.sun.star.beans.StringPair. StringPair: First represents the button label, while StringPair: Second represents the button URL which will be called on button click. The URL can be any URL, either external (http://libreoffice.org), or internal (.uno:Save), or from your extension (service:your.example.Extension?anyAction).

  • show_close_button (bool) – Whether the Close (x) button is shown at the end of the Infobar. Set to false, when you don’t want the user to close the Infobar.

Raises:

com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

None

Hint

  • InfobarTypeEnum can be imported from ooo.dyn.frame.infobar_type.

Example

from ooo.dyn.frame.infobar_type import InfobarTypeEnum
from ooodev.utils.props import Props

def add_infobar():
    # Create a new infobar
    buttons = (
        Props.make_sting_pair("Close doc", ".uno:CloseDoc"),
        Props.make_sting_pair("Paste into doc", ".uno:Paste"),
    )
    inst.append_infobar(
        id="MyInfoBar",
        primary_message="Hello world",
        secondary_message="Things happened. What now?",
        infobar_type=InfobarTypeEnum.INFO,
        action_buttons=buttons,
        show_close_button=True,
    )
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

attach_frame(frame)

Attaches the controller with its managing frame.

Parameters:

frame (XFrame) – The frame to be attached.

Return type:

None

attach_model(model)

Attaches the controller to a new model.

Parameters:

model (XModel) – The model to be attached.

Return type:

None

create_enumeration()

Creates an enumeration of the container’s elements.

Return type:

XEnumeration

dispose()

Disposes the component.

Return type:

None

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_border()

allows to get current border sizes of the document.

Return type:

BorderWidths

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_configurable_dispatch_information(command_group)

returns additional information about supported commands of a given command group.

Return type:

Tuple[DispatchInformation, ...]

Parameters:

command_group (int) –

get_control(model)

Returns the control from the specified model.

Parameters:

model (XControlModel) – The model of the control to be returned.

Returns:

The control from the specified model.

Return type:

XControl

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_form_controller(form)

Gets the FormControllerComp instance which operates on a given form.

A form controller is a component which controls the user interaction with the form layer, as long as the form is not in design mode.

Return type:

FormControllerComp

Parameters:

form (com.sun.star.form.XForm) –

get_frame()

Gets access to owner frame of this controller.

Returns:

The owner frame of this controller.

Return type:

XFrame

get_implementation_id()

Obsolete unique identifier.

Originally returned a sequence of bytes which, when non-empty, was used as an ID to distinguish unambiguously between two sets of types, for example to realize hashing functionality when the object is introspected. Two objects that returned the same non-empty ID had to return the same set of types in getTypes(). (If a unique ID could not be provided, this method was always allowed to return an empty sequence, though).

Return type:

ByteSequence

get_implementation_name()

Provides the implementation name of the service implementation.

Return type:

str

get_is_window_split()

Gets whether the window is split.

Return type:

bool

get_model()

Gets access to currently attached model.

Returns:

The currently attached model.

Return type:

XModel

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_property_set_info()

Returns the property set info.

Returns:

The property set info.

Return type:

XPropertySetInfo

get_property_value(name)

Returns the value of a property.

Parameters:

name (str) – The name of the property.

Returns:

The value of the property.

Return type:

Any

get_selection()

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_sidebar()

Get the sidebar if exists

since

LibreOffice 5.1

Return type:

XSidebarProvider

get_something(identifier)

Call this method to get something which is not specified in UNO, e.g.

an address to some C++ object.

Return type:

int

Parameters:

identifier (Tuple[int, ...]) –

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_status_indicator()

use XStatusIndicatorFactory.createStatusIndicator() instead of this

Return type:

XStatusIndicator

get_supported_command_groups()

Returns all supported command groups.

Returns:

Supported command groups.

Return type:

Tuple[CommandGroupEnum, …]

Note

If you want to get the groups as a tuple of integers call component.getSupportedCommandGroups().

Hint

  • CommandGroupEnum can be imported from ooo.dyn.frame.command_group

get_supported_service_names()

Provides the supported service names of the implementation, including also indirect service names.

Return type:

Tuple[str, ...]

get_title()

Returns the title of the object.

Return type:

str

get_transferable()

Gets access to a transferable representation of a selected part of an object.

Returns:

The transferable object representing the selection inside the supplying object

Return type:

XTransferable

get_types()

returns a sequence of all types (usually interface types) provided by the object.

Return type:

Tuple[Any, ...]

get_view_data()

Gets the view data.

Returns:

The view data.

Return type:

Any

has_elements()

Determines whether the container has elements.

Return type:

bool

has_frozen_panes()

Gets whether the view has frozen panes.

Return type:

bool

has_infobar(id)

Check if Infobar exists.

since

LibreOffice 7.0

Return type:

bool

Parameters:

id (str) –

initialize(*args)

Initializes the object.

It should be called directly after the object is created.

Raises:

com.sun.star.uno.ExceptionException

Return type:

None

Parameters:

args (Any) –

insert_transferable(transferable)

Hands over a transferable object that shall be inserted.

Parameters:

transferable (XTransferable) – The transferable object to be inserted

Return type:

None

is_form_design_mode()

Gets whether the view’s form layer is currently in design or alive mode

Note: This is a convenience method. In the user interface, the design mode is coupled with the .uno:SwitchControlDesignMode feature (see com.sun.star.frame.XDispatchProvider), and asking for the current mode is the same as asking for the state of this feature.

Return type:

bool

is_supported_interface(*interface)

Gets if instance supports an interface in the OooDev Framework.

This is a convenience method to check if the instance supports any of the passed in interfaces.

Rather then import the class and check if the instance is an instance of the class, this method allows to check by name.

Parameters:

*interface (str) – One or more case sensitive interface strings to test for.

Return type:

bool

Example:

from ooodev.adapter.beans.property_set_info_partial import PropertySetInfoPartial

if instance(my_instance, PropertySetInfoPartial):
    prop = instance.get_property_by_name()
    # do something

is functionally the same as:

if instance.is_supported_interface("com.sun.star.beans.XPropertySetInfo"):
    prop = instance.get_property_by_name()
    # do something

Short forms are also acceptable such as:

if instance.is_supported_interface("XPropertySetInfo"):
    prop = instance.get_property_by_name()
    # do something

or

if instance.is_supported_interface("PropertySetInfoPartial"):
    prop = instance.get_property_by_name()
    # do something
Returns:

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

Return type:

bool

Parameters:

interface (str) –

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.

query_adapter()

Queries the weak adapter.

It is important that the adapter must know, but not hold the adapted object. If the adapted object dies, all references to the adapter have to be notified to release the adapter.

Return type:

XAdapter

query_bordered_area(preliminary_rectangle)

Allows to get suggestion for resizing of object area surrounded by the border.

If the view is going to be resized/moved this method can be used to get suggested object area. Pixels are used as units.

Return type:

Rectangle

Parameters:

preliminary_rectangle (com.sun.star.awt.Rectangle) –

query_dispatch(url, target_frame_name, search_flags=FrameSearchFlagEnum.AUTO)

Returns a dispatch object for the specified URL.

Parameters:
  • url (URL) – Specifies the feature which should be supported by returned dispatch object.

  • target_frame_name (str) – Specifies the frame which should be the target for this request.

  • search_flags (int, FrameSearchFlagEnum, optional) – Optional search parameter for finding the frame if no special TargetFrameName was used.

Returns:

the dispatch object which provides queried functionality or None if no dispatch object is available.

Return type:

XDispatch

query_dispatches(requests)

Returns a list of dispatch objects for the specified URLs.

Actually this method is redundant to query_dispatch() to avoid multiple remote calls.

Parameters:

requests (Tuple[DispatchDescriptor, ...]) – Tuple of dispatch requests

Returns:

multiple dispatch interfaces for the specified descriptors at once

Return type:

Tuple[XDispatch | None, …]

register_context_menu_interceptor(interceptor)

Registers a context menu interceptor, which will become the first interceptor in the chain of registered interceptors.

Parameters:

interceptor (XContextMenuInterceptor) – The interceptor to be registered.

Return type:

None

release_context_menu_interceptor(interceptor)

Releases a context menu interceptor.

The order of removals is arbitrary. It is not necessary to remove the last registered interceptor first.

Parameters:

interceptor (XContextMenuInterceptor) – The interceptor to be released.

Return type:

None

removeBorderResizeListener(xListener)

Removes the specified listener.

Return type:

None

Parameters:

xListener (com.sun.star.frame.XBorderResizeListener) –

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 (Any) –

remove_event_active_spreadsheet_changed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_border_resize_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_border_widths_changed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_descriptor_changed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_enhanced_mouse_click_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_key_handler_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_key_handler_pressed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_key_handler_released(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_listener(listener)

Removes an event listener from the component.

Parameters:

listener (XEventListener) – The event listener to be removed.

Return type:

None

remove_event_mouse_pressed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_mouse_released(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_notify_context_menu_execute(cb)

Un-registers and removes a listener for an event.

Return type:

None

Parameters:

cb (Any) –

remove_event_observer(observer)

Removes an observer

Parameters:

observer (EventObserver) – One or more observers to add.

Returns:

True if observer has been removed; Otherwise, False.

Return type:

bool

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 (Any) –

remove_event_selection_change_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_selection_changed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_title_change_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_title_changed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

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_infobar(id)

Removes an existing Infobar.

Remove MyInfoBar infobar

Raises:

com.sun.star.container.NoSuchElementExceptionNoSuchElementException

Return type:

None

Parameters:

id (str) –

remove_key_handler(handler)

Removes a key handler.

Parameters:

handler (XKeyHandler) – The handler to be removed.

Return type:

None

remove_mouse_click_handler(handler)

Removes a mouse click handler.

Parameters:

handler (XMouseClickHandler) – The handler to be removed.

Return type:

None

remove_property_change_listener(name, listener)

Removes a listener for property changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be removed.

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

remove_title_change_listener(listener)

Remove a listener.

Return type:

None

Parameters:

listener (com.sun.star.frame.XTitleChangeListener) –

remove_vetoable_change_listener(name, listener)

Removes a listener for vetoable changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be removed.

Return type:

None

restore_view_data(data)

Restores the view data.

Parameters:

data (Any) – The view data to be restored.

Return type:

None

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_form_design_mode(design_mode)

Sets whether the view’s form layer is currently in design or alive mode

Note

This is a convenience method. In the user interface, the design mode is coupled with the .uno:SwitchControlDesignMode feature (see com.sun.star.frame.XDispatchProvider), and changing the current mode is the same as dispatching this feature URL.

Return type:

None

Parameters:

design_mode (bool) –

set_property(**kwargs)

Set property value

Parameters:

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

Return type:

None

set_property_value(name, value)

Sets the value of a property.

Parameters:
  • name (str) – The name of the property.

  • value (Any) – The value of the property.

Return type:

None

set_title(title)

Sets the title of the object.

Return type:

None

Parameters:

title (str) –

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.

subscribe_event(event_name, callback)

Add an event listener to current instance.

Parameters:
  • event_name (str) – Event Name.

  • callback (EventCallback) – Callback of the event listener.

Return type:

None

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

supports_all_services(*name)

Tests whether all the specified services are supported, i.e.

Parameters:

name (str) – One or more service name(s) to test such as com.sun.star.awt.MenuBar.

Raises:

ValueError – If no service name is provided.

Returns:

True if all the specified services are supported; Otherwise, False.

Return type:

bool

supports_service(*name)

Tests whether any of the specified service(s) are supported.

Parameters:

name (str) – One or more service name(s) to test such as com.sun.star.awt.MenuBar.

Returns:

True if any of the specified service(s) are supported; Otherwise, False.

Return type:

bool

suspend(suspend)

Is called to prepare the controller for closing the view.

Parameters:

suspend (bool) – True Force the controller to suspend his work, False Try to reactivate the controller.

Returns:

True If request was accepted and successfully finished; Otherwise, False.

Return type:

bool

trigger_event(event_name, event_args)

Trigger an event on current instance.

Parameters:
  • event_name (str) – Event Name.

  • event_args (EventArgsT) – Event Args.

Return type:

None

unsubscribe_event(event_name, callback)

Remove an event listener from current instance.

Parameters:
  • event_name (str) – Event Name.

  • callback (EventCallback) – Callback of the event listener.

Return type:

None

update_infobar(id, primary_message, secondary_message, infobar_type)

Updates an existing Infobar.

Use if you want to update only small parts of the Infobar.

Update the infobar and change the type to WARNING

Parameters:
  • id (str) – The unique identifier of the Infobar.

  • primary_message (str) – The (short) primary message. Will appear at the start of the infobar in bold letters. May be empty.

  • secondary_message (str) – The (longer) secondary message. Will appear in normal letters after the primaryMessage

  • infobar_type (int | InfobarTypeEnum) – The type of the Infobar.

Raises:

com.sun.star.container.NoSuchElementExceptionNoSuchElementException

Return type:

None

Hint

  • InfobarTypeEnum can be imported from ooo.dyn.frame.infobar_type.

property calc_doc: CalcDoc

Calc Document.

Return type:

CalcDoc

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

Spreadsheet View Component

Return type:

SpreadsheetView

property component_window: WindowComp

denotes the “root window” of the controller.

If the controller is plugged into a frame, this window acts as the frame’s ComponentWindow.

Return type:

WindowComp

property creation_arguments: Tuple[PropertyValue, ...]

Denotes the arguments used to create the instance.

Usually, controllers are created via XModel2.createViewController(), where the caller can pass not only a controller name, but also arguments parameterizing the to-be-created instance. Those arguments used at creation time can subsequently be retrieved using the CreationArguments member.

Return type:

Tuple[PropertyValue, ...]

property event_observer: EventObserver

Gets/Sets The Event Observer for this instance.

Return type:

EventObserver

property events_listener_activation_event: ActivationEventListener

Returns listener

Return type:

ActivationEventListener

property events_listener_border_resize: BorderResizeListener

Returns listener

Return type:

BorderResizeListener

property events_listener_enhanced_mouse_click: EnhancedMouseClickHandler

Returns listener

Return type:

EnhancedMouseClickHandler

property events_listener_key_handler: KeyHandler

Returns listener

Return type:

KeyHandler

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 events_listener_title_changed: TitleChangeListener

Returns listener

Return type:

TitleChangeListener

property extra_data: TheDict

Extra Data Key Value Pair Dictionary.

Properties can be assigned properties and access like a dictionary and with dot notation.

Note

This is a dictionary object that can be used to store key value pairs. Generally speaking this data is not part of the object’s main data structure and is not saved with the object (document).

This property is used to store data that is not part of the object’s main data structure and can be used however the developer sees fit.

Return type:

TheDict

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property office_doc: OfficeDocumentT

Office Document.

Return type:

OfficeDocumentT

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 view_controller_name: str

specifies the view name of the controller.

A view name is a logical name, which can be used to create views of the same type. The name is meaningful only in conjunction with XModel2.createViewController()

Return type:

str

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