ooodev.format.inner.direct.structs.line_spacing_struct module

Module for Shadow format (LineSpacing) struct.

New in version 0.9.0.

class ooodev.format.inner.direct.structs.line_spacing_struct.LineSpacingStruct(mode=ModeKind.SINGLE, value=0)[source]

Bases: StructBase

Line Spacing struct

__init__(mode=ModeKind.SINGLE, value=0)[source]

Constructor

Parameters:
  • mode (LineMode, optional) – This value specifies the way the spacing is specified.

  • value (Real, UnitT, optional) – This value specifies the spacing in regard to Mode.

Raises:

ValueError – If value are less than zero.

Return type:

None

Note

If LineMode is SINGLE, LINE_1_15, LINE_1_5, or DOUBLE then value is ignored.

If LineMode is AT_LEAST, LEADING, or FIXED then value is a float (in mm units) or Class UnitT

If LineMode is PROPORTIONAL then value is an int representing percentage. For example 95 equals 95%, 130 equals 130%

apply(obj: Any, *, keys: Dict[str, str])[source]
apply(obj: Any)
apply(obj, **kwargs)

Applies style to object

Parameters:
  • obj (object) – Object that contains a LineSpacing property.

  • keys – (Dict[str, str], optional): key map for properties. Can be spacing which maps to ParaLineSpacing by default.

Events:
Return type:

None

copy()[source]
copy(**kwargs)
copy(**kwargs)

Gets a copy of instance as a new instance

Return type:

TypeVar(_TLineSpacingStruct, bound= LineSpacingStruct)

Parameters:

self (_TLineSpacingStruct) –

classmethod from_uno_struct(ln_spacing)[source]
classmethod from_uno_struct(ln_spacing, **kwargs)
classmethod from_uno_struct(ln_spacing, **kwargs)

Converts a UNO LineSpacing struct into a LineSpacingStruct

Parameters:

ln_spacing (UnoLineSpacing) – UNO LineSpacing object.

Returns:

LineSpacingStruct set with Line spacing properties.

Return type:

LineSpacingStruct

get_attrs()[source]

Gets the attributes that are slated for change in the current instance

Returns:

Tuple of attributes

Return type:

Tuple(str, …)

get_uno_struct()[source]

Gets UNO Gradient from instance.

Returns:

Gradient instance

Return type:

Gradient

property default: _TLineSpacingStruct

Gets empty Line Spacing. Static Property.

Return type:

TypeVar(_TLineSpacingStruct, bound= LineSpacingStruct)

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_mode: ModeKind

Gets mode value

Return type:

ModeKind

property prop_value: int

Gets the spacing value in regard to Mode

Return type:

int