Class WriteTextPortions

class ooodev.write.WriteTextPortions(owner, component, lo_inst=None)[source]

Bases: LoInstPropsPartial, WriteDocPropPartial, EnumerationAccessPartial, QiPartial, Generic[T]

Represents writer Text Portions.

Contains Enumeration Access.

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

Constructor

Parameters:
  • owner (T) – Owner of this component.

  • component (XText) – UNO object that supports com.sun.star.text.TextPortion service.

  • lo_inst (LoInst, optional) – Lo instance. Defaults to None.

Return type:

None

__next__()[source]

Gets the next element.

Returns:

Next element.

Return type:

WriteTextPortion[T]

create_enumeration()

Creates an enumeration of the container’s elements.

Return type:

XEnumeration

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

has_elements()

Determines whether the container has elements.

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.

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property office_doc: OfficeDocumentT

Office Document.

Return type:

OfficeDocumentT

property owner: T

Owner of this component.

Return type:

TypeVar(T, bound= ComponentT)

property write_doc: WriteDoc

Write Document.

Return type:

WriteDoc