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

Module for managing table borders (cells and ranges).

New in version 0.9.0.

class ooodev.format.inner.direct.calc.border.borders.Borders(*, right=None, left=None, top=None, bottom=None, border_side=None, vertical=None, horizontal=None, distance=None, diagonal_down=None, diagonal_up=None, shadow=None, padding=None)[source]

Bases: StyleMulti

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, vertical=None, horizontal=None, distance=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

  • horizontal (Side, optional) – Specifies the line style of horizontal lines for the inner part of a cell range.

  • vertical (Side, optional) – Specifies the line style of vertical lines for the inner part of a cell range.

  • distance (float, UnitT, optional) – Contains the distance between the lines and other contents in mm units or Class UnitT.

  • 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 (padding, optional) – Cell 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.ParagraphProperties 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, optional) – 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, optional) – Side value

  • self (_TBorders) –

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 (_TBorders) –

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 (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_distance(value)[source]

Gets copy of instance with distance set or removed

Parameters:
  • value (float, UnitT, optional) – Distance value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_horizontal(value)[source]

Gets copy of instance with horizontal set or removed

Parameters:
  • value (Side, optional) – 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, optional) – 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, optional) – 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, optional) – 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, optional) – 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, optional) – Side value

  • self (_TBorders) –

Returns:

Borders instance

Return type:

Borders

fmt_vertical(value)[source]

Gets copy of instance with vertical set or removed

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

  • self (_TBorders) –

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 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_border_table: TableBorderStruct

Gets border table instance

Return type:

TableBorderStruct

property prop_inner_diagonal_dn: Side | None

Gets inner Diagonal down instance

Return type:

Side | None

property prop_inner_diagonal_up: Side | None

Gets inner Diagonal up instance

Return type:

Side | None

property prop_inner_padding: Padding

Gets Padding instance

Return type:

Padding

property prop_inner_shadow: Shadow | None

Gets inner shadow instance

Return type:

Shadow | None