ooodev.format.writer.direct.char.borders package

Module contents

class ooodev.format.writer.direct.char.borders.Borders(*, right=None, left=None, top=None, bottom=None, all=None, shadow=None, padding=None)[source]

Bases: StyleMulti

Border used in styles for characters.

All methods starting with fmt_ can be used to chain together Borders properties.

New in version 0.9.0.

__init__(*, right=None, left=None, top=None, bottom=None, all=None, shadow=None, padding=None)[source]

Constructor

Parameters:
  • left (Side | None, optional) – Determines the line style at the left edge.

  • right (Side | None, optional) – Determines the line style at the right edge.

  • top (Side | None, optional) – Determines the line style at the top edge.

  • bottom (Side | None, optional) – Determines the line style at the bottom edge.

  • all (Side | None, optional) – Determines the line style at the top, bottom, left, right edges. If this argument has a value then arguments top, bottom, left, right are ignored

  • shadow (Shadow | None, optional) – Character Shadow

  • padding (Padding | None, optional) – Character padding

Return type:

None

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

Applies padding to obj

Parameters:

obj (object) – Object that supports com.sun.star.style.CharacterProperties service.

Return type:

None

fmt_border_side(value)[source]

Gets copy of instance with left, right, top, bottom sides set or removed

Parameters:
  • value (Side | None) – Side value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_bottom(value)[source]

Gets copy of instance with bottom set or removed

Parameters:
  • value (Side | None) – Side value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_left(value)[source]

Gets copy of instance with left set or removed

Parameters:
  • value (Side | None) – Side value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_padding(value)[source]

Gets copy of instance with padding set or removed

Parameters:
  • value (Padding | None) – Padding value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_right(value)[source]

Gets copy of instance with right set or removed

Parameters:
  • value (Side | None) – Side value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_shadow(value)[source]

Gets copy of instance with shadow set or removed

Parameters:
  • value (Shadow | None) – Shadow value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_top(value)[source]

Gets copy of instance with top set or removed

Parameters:
  • value (Side | None) – Side value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

property default: _TBorders

Gets Default Border.

Return type:

TypeVar(_TBorders, bound= Borders)

property empty: _TBorders

Gets Empty Border. When style is applied formatting is removed.

Return type:

TypeVar(_TBorders, bound= Borders)

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_inner_padding: InnerPadding | None

Gets Padding Instance

Return type:

InnerPadding | None

property prop_inner_shadow: InnerShadow | None

Gets Shadow Instance

Return type:

InnerShadow | None

property prop_inner_sides: Sides | None

Gets Sides Instance

Return type:

Sides | None

class ooodev.format.writer.direct.char.borders.Padding(*, left=None, right=None, top=None, bottom=None, all=None)[source]

Bases: AbstractPadding

Paragraph Border Padding

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.9.0.

__init__(*, left=None, right=None, top=None, bottom=None, all=None)[source]

Constructor

Parameters:
  • left (float, UnitT, optional) – Left (in mm units) or Class UnitT.

  • right (float, UnitT, optional) – Right (in mm units) or Class UnitT.

  • top (float, UnitT, optional) – Top (in mm units) or Class UnitT.

  • bottom (float, UnitT, optional) – Bottom (in mm units) or Class UnitT.

  • all (float, UnitT, optional) – Left, right, top, bottom (in mm units) or Class UnitT. If argument is present then left, right, top, and bottom arguments are ignored.

Raises:

ValueError – If any argument value is less than zero.

Return type:

None

property default: _TPadding

Gets BorderPadding default.

Return type:

TypeVar(_TPadding, bound= Padding)

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

class ooodev.format.writer.direct.char.borders.Shadow(*, location=ShadowLocation.BOTTOM_RIGHT, color=8421504, transparent=False, width=1.76)[source]

Bases: ShadowStruct

Shadow struct

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.9.0.

__init__(*, location=ShadowLocation.BOTTOM_RIGHT, color=8421504, transparent=False, width=1.76)[source]

Constructor

Parameters:
  • location (ShadowLocation, optional) – contains the location of the shadow. Default to ShadowLocation.BOTTOM_RIGHT.

  • color (Color, optional) – contains the color value of the shadow. Defaults to StandardColor.GRAY.

  • transparent (bool, optional) – Shadow transparency. Defaults to False.

  • width (float, UnitT, optional) – contains the size of the shadow (in mm units) or Class UnitT. Defaults to 1.76.

Raises:

ValueError – If color or width are less than zero.

Return type:

None

class ooodev.format.writer.direct.char.borders.Sides(*, left=None, right=None, top=None, bottom=None, all=None)[source]

Bases: AbstractSides

Character Border.

Any properties starting with prop_ set or get current instance values.

All methods starting with fmt_ can be used to chain together Sides properties.

New in version 0.9.0.

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind