ooodev.adapter.document.storage_based_document_partial module

class ooodev.adapter.document.storage_based_document_partial.StorageBasedDocumentPartial(component, interface=com.sun.star.document.XStorageBasedDocument)[source]

Bases: object

Partial class for XStorageBasedDocument.

Parameters:
  • component (XStorageBasedDocument) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.document.XStorageBasedDocument)[source]

Constructor

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

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

Return type:

None

add_storage_change_listener(listener)[source]

Allows to register a listener that will be notified when another storage is set to the document.

Return type:

None

Parameters:

listener (com.sun.star.document.XStorageChangeListener) –

get_document_storage()[source]

Allows to get the storage the document is based on.

Raises:
  • com.sun.star.io.IOExceptionIOException

  • com.sun.star.uno.ExceptionException

Return type:

XStorage

load_from_storage(storage, *media_descriptor)[source]

Lets the document load itself using provided storage.

Raises:
  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

  • com.sun.star.frame.DoubleInitializationExceptionDoubleInitializationException

  • com.sun.star.io.IOExceptionIOException

  • com.sun.star.uno.ExceptionException

Return type:

None

Parameters:
  • storage (com.sun.star.embed.XStorage) –

  • media_descriptor (PropertyValue) –

remove_storage_change_listener(listener)[source]

Allows to deregister the listener.

Return type:

None

Parameters:

listener (com.sun.star.document.XStorageChangeListener) –

store_to_storage(storage, *media_descriptor)[source]

Lets the document store itself to the provided storage.

Raises:
  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

  • com.sun.star.io.IOExceptionIOException

  • com.sun.star.uno.ExceptionException

Return type:

None

Parameters:
  • storage (com.sun.star.embed.XStorage) –

  • media_descriptor (PropertyValue) –

switch_to_storage(storage)[source]

Allows to switch the document to the provided storage.

Raises:
  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

  • com.sun.star.io.IOExceptionIOException

  • com.sun.star.uno.ExceptionException

Return type:

None

Parameters:

storage (com.sun.star.embed.XStorage) –