ooodev.format.inner.direct.calc.alignment.text_align module

class ooodev.format.inner.direct.calc.alignment.text_align.HoriAlignKind(value)[source]

Bases: Enum

Text Align Horizontal Align Values.

get_justify_method()[source]

Gets the value that is typically applied to HoriJustifyMethod property.

Return type:

int

get_justify_value()[source]

Gets the enum value that is typically applied to HoriJustify property.

Return type:

CellHoriJustify

CENTER = (0, <CellHoriJustify.CENTER: 'CENTER'>)

Contents are horizontally centered.

DEFAULT = (0, <CellHoriJustify.STANDARD: 'STANDARD'>)

Default alignment is used.

DISTRIBUTED = (1, <CellHoriJustify.BLOCK: 'BLOCK'>)

Contents are justified to the cell width.

FILLED = (0, <CellHoriJustify.REPEAT: 'REPEAT'>)

Contents are repeated to fill the cell.

JUSTIFIED = (0, <CellHoriJustify.BLOCK: 'BLOCK'>)

Contents are justified to the cell width.

LEFT = (0, <CellHoriJustify.LEFT: 'LEFT'>)

Contents are aligned to the left edge of the cell.

RIGHT = (0, <CellHoriJustify.RIGHT: 'RIGHT'>)

Contents are aligned to the right edge of the cell.

class ooodev.format.inner.direct.calc.alignment.text_align.TextAlign(hori_align=None, indent=None, vert_align=None)[source]

Bases: StyleBase

Cell Text Alignment.

New in version 0.9.0.

__init__(hori_align=None, indent=None, vert_align=None)[source]

Constructor

Parameters:
  • hori_align (HoriAlignKind, optional) – Specifies Horizontal Alignment.

  • indent (float | UnitT | None) – (float, UnitT, optional): Specifies indent in pt (point) units or Class UnitT. Only used when hori_align is set to HoriAlignKind.LEFT

  • vert_align (VertAdjustKind, optional) – Specifies Vertical Alignment.

Return type:

None

classmethod from_obj(obj)[source]
classmethod from_obj(obj, **kwargs)
classmethod from_obj(obj, **kwargs)

Gets instance from object

Parameters:

obj (object) – UNO Object.

Raises:

NotSupportedError – If obj is not supported.

Returns:

Instance that represents Text Alignment.

Return type:

TextAlign

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_hori_align: HoriAlignKind | None

Gets/Sets Horizontal align value.

Return type:

HoriAlignKind | None

property prop_indent: UnitPT | None

Gets/Sets indent.

Return type:

UnitPT | None

property prop_vert_align: VertAlignKind | None

Gets/Sets vertical align value.

Return type:

VertAlignKind | None

class ooodev.format.inner.direct.calc.alignment.text_align.VertAlignKind(value)[source]

Bases: Enum

Text Align Vertical Align Values.

get_justify_method()[source]

Gets the value that is typically applied to VertJustifyMethod property.

Return type:

int

get_justify_value()[source]

Gets the value that is typically applied to VertJustify property.

Return type:

int

BOTTOM = (0, 3)

Contents are aligned to the lower edge of the cell.

DEFAULT = (0, 0)

Default alignment is used.

DISTRIBUTED = (1, 4)

Contents are distributed to the cell height.

JUSTIFIED = (0, 4)

Contents are justified to the cell height.

MIDDLE = (0, 2)

Contents are aligned to the vertical middle of the cell.

TOP = (0, 1)

Contents are aligned with the upper edge of the cell.