Class WriteStyleFamilies

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

Bases: StyleFamiliesComp, IndexAccessPartial, QiPartial

Represents writer paragraph content.

Contains Enumeration Access.

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

Constructor

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

  • component (Any) – UNO object that supports com.sun.star.text.Paragraph service.

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

Return type:

None

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_by_name(name)

Gets the element with the specified name.

Parameters:

name (str) – The name of the element.

Returns:

The element with the specified name.

Return type:

Any

get_count()

Gets the number of elements contained in the container.

Returns:

The number of elements.

Return type:

int

get_element_names()

Gets the names of all elements contained in the container.

Returns:

The names of all elements.

Return type:

tuple[str, …]

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_names()[source]

Gets a sorted list of style family names

Raises:

Exception – If unable to names.

Returns:

List of style names

Return type:

List[str]

get_style_family(name)[source]

Gets a style family by name.

Parameters:

name (str | FamilyNamesKind) – Name of style family.

Raises:

Exception – If unable to get style family.

Returns:

Style family.

Return type:

WriteStyleFamily

has_by_name(name)

Checks if the container has an element with the specified name.

Parameters:

name (str) – The name of the element.

Returns:

True if the container has an element with the specified name, otherwise False.

Return type:

bool

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 component: com.sun.star.style.StyleFamilies

StyleFamilies Component

Return type:

StyleFamilies

property owner: WriteDoc

Owner of this component.

Return type:

WriteDoc