ooodev.format.inner.direct.draw.shape.para.alignment.alignment module
Module for managing shape paragraph alignment.
New in version 0.17.8.
- class ooodev.format.inner.direct.draw.shape.para.alignment.alignment.Alignment(*, align=None, align_last=None, expand_single_word=None)[source]
Bases:
StyleBase
Shape Paragraph Alignment
Any properties starting with
prop_
set or get current instance values.All methods starting with
fmt_
can be used to chain together properties.New in version 0.17.8.
- __init__(*, align=None, align_last=None, expand_single_word=None)[source]
Constructor
- Parameters:
align (ParagraphAdjust, optional) – Determines horizontal alignment of a paragraph.
align_last (LastLineKind, optional) – Determines the adjustment of the last line.
expand_single_word (bool, optional) – Determines if single words are stretched. It is only valid if
align
andalign_last
are also valid.
- Return type:
None
- apply(obj: Any)[source]
- apply(obj: Any, **kwargs)
- apply(obj, **kwargs)
Applies alignment to
obj
- Parameters:
obj (object) – UNO object that supports
com.sun.star.style.ParagraphProperties
service.- Return type:
None
- static convert_int_to_paragraph_adjust(num)[source]
Converts integer value to
ParagraphAdjust
.When Writer saves
ParagraphAdjust
value intoParaAdjust
it converts it to a integer value.- Parameters:
num (int) – Number to convert
- Returns:
Number as
ParagraphAdjust
- Return type:
ParagraphAdjust
- fmt_align(value)[source]
Gets copy of instance with horizontal alignment set or removed
- Parameters:
value (ParagraphAdjust | None) – Alignment value
self (_TAlignment) –
- Returns:
Alignment instance
- Return type:
- fmt_align_last(value)[source]
Gets copy of instance with align last set or removed
- Parameters:
value (LastLineKind | None) – Align last value
self (_TAlignment) –
- Returns:
Alignment instance
- Return type:
- fmt_expand_single_word(value)[source]
Gets copy of instance with expand single word set or removed
- Parameters:
value (LastLineKind | None) – Expand single word value
self (_TAlignment) –
- Returns:
Alignment instance
- Return type:
- classmethod from_obj(obj)[source]
- classmethod from_obj(obj, **kwargs)
- classmethod from_obj(obj, **kwargs)
Gets Padding instance from object
- Parameters:
obj (object) – UNO object.
- Raises:
NotSupportedError – If
obj
is not supported.- Returns:
Alignment that represents
obj
alignment.- Return type:
- property align_center: _TAlignment
Gets copy of instance with align set to center
- Return type:
TypeVar
(_TAlignment
, bound= Alignment)
- property align_left: _TAlignment
Gets copy of instance with align set to left
- Return type:
TypeVar
(_TAlignment
, bound= Alignment)
- property align_right: _TAlignment
Gets copy of instance with align set to left
- Return type:
TypeVar
(_TAlignment
, bound= Alignment)
- property default: _TAlignment
Gets Alignment default.
- Return type:
TypeVar
(_TAlignment
, bound= Alignment)
- property expand_single_word: _TAlignment
Gets copy of instance with expand single word set
- Return type:
TypeVar
(_TAlignment
, bound= Alignment)
- property justified: _TAlignment
Gets copy of instance with align set to block
- Return type:
TypeVar
(_TAlignment
, bound= Alignment)
- property prop_align: ParagraphAdjust | None
Gets/Sets horizontal alignment of a paragraph.
- Return type:
ParagraphAdjust | None
- property prop_align_last: LastLineKind | None
Gets/Sets the adjustment of the last line.
- Return type:
LastLineKind | None
- property prop_expand_single_word: bool | None
Gets/Sets Determines if single words are stretched.
It is only valid if
prop_align
andprop_align_last
are also valid.- Return type:
bool | None
- property prop_format_kind: FormatKind
Gets the kind of style
- Return type: