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
isSINGLE
,LINE_1_15
,LINE_1_5
, orDOUBLE
thenvalue
is ignored.If
LineMode
isAT_LEAST
,LEADING
, orFIXED
thenvalue
is a float (in mm units
) or Class UnitTIf
LineMode
isPROPORTIONAL
then value is an int representing percentage. For example95
equals95%
,130
equals130%
- 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 toParaLineSpacing
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 aLineSpacingStruct
- Parameters:
ln_spacing (UnoLineSpacing) – UNO
LineSpacing
object.- Returns:
LineSpacingStruct
set with Line spacing properties.- Return type:
- get_attrs()[source]
Gets the attributes that are slated for change in the current instance
- Returns:
Tuple of attributes
- Return type:
Tuple(str, …)
- 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:
- 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