ooodev.format.inner.modify.calc.border.borders module

class ooodev.format.inner.modify.calc.border.borders.Borders(*, right=None, left=None, top=None, bottom=None, border_side=None, diagonal_down=None, diagonal_up=None, shadow=None, padding=None, style_name=StyleCellKind.DEFAULT, style_family='CellStyles')[source]

Bases: CellStyleBaseMulti

Cell Style Borders.

New in version 0.9.0.

__init__(*, right=None, left=None, top=None, bottom=None, border_side=None, diagonal_down=None, diagonal_up=None, shadow=None, padding=None, style_name=StyleCellKind.DEFAULT, style_family='CellStyles')[source]

Constructor

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

  • right (Side, optional) – Specifies the line style at the right edge.

  • top (Side, optional) – Specifies the line style at the top edge.

  • bottom (Side, optional) – Specifies the line style at the bottom edge.

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

  • diagonal_down (Side, optional) – Specifies the line style from top-left to bottom-right diagonal.

  • diagonal_up (Side, optional) – Specifies the line style from bottom-left to top-right diagonal.

  • shadow (Shadow, optional) – Cell Shadow.

  • padding (BorderPadding, optional) – Cell padding.

  • style_name (StyleCellKind, str, optional) – Specifies the Cell Style that instance applies to. Default is Default Cell Style.

  • style_family (str, optional) – Style family. Default CellStyles.

Return type:

None

classmethod from_style(doc, style_name=StyleCellKind.DEFAULT, style_family='CellStyles')[source]

Gets instance from Document.

Parameters:
  • doc (object) – UNO Document Object.

  • style_name (StyleCellKind, str, optional) – Specifies the Cell Style that instance applies to. Default is Default Cell Style.

  • style_family (str, optional) – Style family. Default CellStyles.

Returns:

Borders instance from style properties.

Return type:

Borders

property prop_inner: InnerBorders

Gets/Sets Inner Borders instance

Return type:

InnerBorders

property prop_style_name: str

Gets/Sets property Style Name

Return type:

str

class ooodev.format.inner.modify.calc.border.borders.InnerBorders(*, right=None, left=None, top=None, bottom=None, border_side=None, diagonal_down=None, diagonal_up=None, shadow=None, padding=None)[source]

Bases: StyleMulti

Style Table Borders used in styles for table cells and ranges.

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__(*, right=None, left=None, top=None, bottom=None, border_side=None, diagonal_down=None, diagonal_up=None, shadow=None, padding=None)[source]

Constructor

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

  • right (Side, optional) – Specifies the line style at the right edge.

  • top (Side, optional) – Specifies the line style at the top edge.

  • bottom (Side, optional) – Specifies the line style at the bottom edge.

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

  • diagonal_down (Side, optional) – Specifies the line style from top-left to bottom-right diagonal.

  • diagonal_up (Side, optional) – Specifies the line style from bottom-left to top-right diagonal.

  • shadow (Shadow, optional) – Cell Shadow.

  • padding (BorderPadding, optional) – Cell padding.

Return type:

None

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

Applies styles to object

Parameters:

obj (object) – UNO object.

Return type:

None

fmt_bottom(value)[source]

Gets copy of instance with bottom set or removed

Parameters:
  • value (Side, optional) – Side value

  • self (_TInnerBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_diagonal_down(value)[source]

Gets copy of instance with diagonal down set or removed

Parameters:
  • value (Side, optional) – Side value

  • self (_TInnerBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_diagonal_up(value)[source]

Gets copy of instance with diagonal up set or removed

Parameters:
  • value (Side, optional) – Side value

  • self (_TInnerBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_left(value)[source]

Gets copy of instance with left set or removed

Parameters:
  • value (Side, optional) – Side value

  • self (_TInnerBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_padding(value)[source]

Gets copy of instance with padding set or removed

Parameters:
  • value (Padding, optional) – Padding value

  • self (_TInnerBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_right(value)[source]

Gets copy of instance with right set or removed

Parameters:
  • value (Side, optional) – Side value

  • self (_TInnerBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_shadow(value)[source]

Gets copy of instance with shadow set or removed

Parameters:
  • value (Shadow, optional) – Shadow value

  • self (_TInnerBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_top(value)[source]

Gets copy of instance with top set or removed

Parameters:
  • value (Side, optional) – Side value

  • self (_TInnerBorders) –

Returns:

Borders instance

Return type:

Borders

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

Gets Borders instance from object

Parameters:

obj (object) – UNO Object.

Raises:

NotSupportedServiceError – If obj is not supported.

Returns:

Borders that represents obj borders.

Return type:

Borders

property prop_bottom: Side | None

Gets/Sets inner Bottom instance

Return type:

Side | None

property prop_diagonal_dn: Side | None

Gets/Sets inner Diagonal down instance

Return type:

Side | None

property prop_diagonal_up: Side | None

Gets/Sets inner Diagonal up instance

Return type:

Side | None

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_left: Side | None

Gets/Sets inner Left instance

Return type:

Side | None

property prop_padding: Padding | None

Gets/Sets Padding instance

Return type:

Padding | None

property prop_right: Side | None

Gets/Sets inner Right instance

Return type:

Side | None

property prop_shadow: Shadow | None

Gets/Sets inner shadow instance

Return type:

Shadow | None

property prop_top: Side | None

Gets/Sets inner Top instance

Return type:

Side | None