Class EnumHelper

class ooodev.utils.kind.enum_helper.EnumHelper[source]

Class for managing enumeration.

static get_enum_info(name)[source]

Gets information on a specific enumeration.

Parameters:

name (str) – The name of the enumeration such as com.sun.star.awt.FontSlant.

Returns:

The enumeration information, or None if not found.

Return type:

EnumTypeDescriptionComp | None

classmethod get_enum_name_from_value(type_name, value)[source]

Returns the enumeration member name from the value.

Parameters:
  • type_name (str) – The full name of the enumeration such as com.sun.star.awt.FontSlant.

  • value (int) – The enumeration member value.

Raises:

ValueError – If the enumeration is not found.

Returns:

The enumeration member name such as ITALIC.

Return type:

str

classmethod get_enum_value_from_name(type_name, name)[source]

Returns the enumeration member value from the name.

Parameters:
  • type_name (str) – The full name of the enumeration such as com.sun.star.awt.FontSlant.

  • name (str) – The enumeration member name such as ITALIC.

Raises:

ValueError – If the enumeration is not found.

Returns:

The enumeration member value.

Return type:

int

classmethod get_uno_enum_from_name(type_name, name)[source]

Returns the UNO enumeration from the value.

Parameters:
  • type_name (str) – The full name of the enumeration such as com.sun.star.awt.FontSlant.

  • name (str) – The enumeration member name such as ITALIC.

Raises:

ValueError – If the enumeration is not found.

Returns:

The UNO enumeration.

Return type:

uno.Enum

classmethod get_uno_enum_from_value(type_name, value)[source]

Returns the UNO enumeration from the value.

Parameters:
  • type_name (str) – The full name of the enumeration such as com.sun.star.awt.FontSlant.

  • value (int) – The enumeration member value.

Raises:

ValueError – If the enumeration is not found.

Returns:

The UNO enumeration.

Return type:

uno.Enum