ooodev.adapter.script.library_container_partial module
- class ooodev.adapter.script.library_container_partial.LibraryContainerPartial(component, interface=com.sun.star.script.XLibraryContainer)[source]
Bases:
object
Partial class for XLibraryContainer.
- Parameters:
component (XLibraryContainer) –
interface (UnoInterface | None) –
- __init__(component, interface=com.sun.star.script.XLibraryContainer)[source]
Constructor
- Parameters:
component (XLibraryContainer) – UNO Component that implements
com.sun.star.script.XLibraryContainer
interface.interface (UnoInterface, optional) – The interface to be validated. Defaults to
XLibraryContainer
.
- Return type:
None
- create_library(name)[source]
Creates a new library.
- Parameters:
name (str) – The name of the library.
- Raises:
com.sun.star.lang.IllegalArgumentException –
IllegalArgumentException
com.sun.star.container.ElementExistException –
ElementExistException
- Return type:
- create_library_link(name: str, storage_url: str, read_only: typing_extensions.Literal[True]) ooodev.adapter.container.name_access_comp.NameAccessComp [source]
- create_library_link(name: str, storage_url: str, read_only: typing_extensions.Literal[False]) ooodev.adapter.container.name_container_comp.NameContainerComp
- create_library_link(name, storage_url, read_only=False)
Creates a link to an
external
library that then can be accessed using this library manager.The format of the StorageURL is a matter of the implementation. If the read only flag is set, the linked library cannot be modified. In this case, the returned component really is only an NameAccessComp. If
read_only
isFalse
(and the referenced storage allows write access) the returned component also can be a NameContainerComp.- Parameters:
name (str) – The name of the library link.
storage_url (str) – The URL of the library to be linked.
read_only (bool) – If true, the linked library cannot be modified.
- Raises:
com.sun.star.lang.IllegalArgumentException –
IllegalArgumentException
com.sun.star.container.ElementExistException –
ElementExistException
- Returns:
The created library link.
- Return type:
- is_library_loaded(name)[source]
returns true if the accessed library is already loaded from the storage, otherwise false.
- Raises:
com.sun.star.container.NoSuchElementException –
NoSuchElementException
- Return type:
bool
- Parameters:
name (str) –
- load_library(name)[source]
Causes the accessed library to be loaded from its storage if it hasn’t already been loaded.
- Raises:
com.sun.star.container.NoSuchElementException –
NoSuchElementException
com.sun.star.lang.WrappedTargetException –
WrappedTargetException
- Return type:
None
- Parameters:
name (str) –
- remove_library(name)[source]
removes the library item with the specified name.
If the accessed library item is a link only the link is removed, not the target library.
- Raises:
com.sun.star.container.NoSuchElementException –
NoSuchElementException
com.sun.star.lang.WrappedTargetException –
WrappedTargetException
- Return type:
None
- Parameters:
name (str) –