ooodev.format.draw.modify.area package

Submodules

Module contents

class ooodev.format.draw.modify.area.Color(*, color=-1, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Bases: FillStyleBaseMulti

Draw Style Fill Coloring

New in version 0.17.9.

__init__(*, color=-1, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Constructor

Parameters:
  • color (Color, optional) – Fill Color.

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

  • style_family (str, DrawStyleFamilyKind, optional) – Family Style. Defaults to graphics.

Return type:

None

classmethod from_style(doc, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Gets instance from Document.

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

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

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

Returns:

Color instance from document properties.

Return type:

Color

property prop_inner: Color

Gets Inner Color instance

Return type:

Color

property prop_style_name: str

Gets/Sets property Style Name

Return type:

str

class ooodev.format.draw.modify.area.Gradient(*, style=GradientStyle.LINEAR, step_count=0, offset=Offset(x=50, y=50), angle=0, border=0, grad_color=ColorRange(start=0, end=16777215), grad_intensity=IntensityRange(start=100, end=100), name='', style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Bases: FillStyleBaseMulti

Draw Style Fill Gradient

New in version 0.17.9.

__init__(*, style=GradientStyle.LINEAR, step_count=0, offset=Offset(x=50, y=50), angle=0, border=0, grad_color=ColorRange(start=0, end=16777215), grad_intensity=IntensityRange(start=100, end=100), name='', style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Constructor

Parameters:
  • style (GradientStyle, optional) – Specifies the style of the gradient. Defaults to GradientStyle.LINEAR.

  • step_count (int, optional) – Specifies the number of steps of change color. Defaults to 0.

  • offset (Offset, int, optional) – Specifies the X and Y coordinate, where the gradient begins. X is effectively the center of the RADIAL, ELLIPTICAL, SQUARE and RECT style gradients. Defaults to Offset(50, 50).

  • angle (Angle, int, optional) – Specifies angle of the gradient. Defaults to 0.

  • border (int, optional) – Specifies percent of the total width where just the start color is used. Defaults to 0.

  • grad_color (ColorRange, optional) – Specifies the color at the start point and stop point of the gradient. Defaults to ColorRange(Color(0), Color(16777215)).

  • grad_intensity (IntensityRange, optional) – Specifies the intensity at the start point and stop point of the gradient. Defaults to IntensityRange(100, 100).

  • name (str, optional) – Specifies the Fill Gradient Name.

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

  • style_family (str, DrawStyleFamilyKind, optional) – Family Style. Defaults to graphics.

Return type:

None

classmethod from_preset(preset, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Gets an instance from a preset

Parameters:
Returns:

Instance from preset.

Return type:

Gradient

classmethod from_style(doc, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Gets instance from Document.

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

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

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

Returns:

Gradient instance from document properties.

Return type:

Gradient

property prop_inner: Gradient

Gets Inner instance

Return type:

Gradient

property prop_style_name: str

Gets/Sets property Style Name

Return type:

str

class ooodev.format.draw.modify.area.Hatch(*, style=HatchStyle.SINGLE, color=0, space=0.0, angle=0, bg_color=-1, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Bases: FillStyleBaseMulti

Draw Style Fill Hatch

New in version 0.17.9.

__init__(*, style=HatchStyle.SINGLE, color=0, space=0.0, angle=0, bg_color=-1, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Constructor

Parameters:
  • bitmap (XBitmap, optional) – Bitmap instance. If name is not already in the Bitmap Table then this property is required.

  • name (str, optional) – Specifies the name of the pattern. This is also the name that is used to store bitmap in LibreOffice Bitmap Table.

  • tile (bool, optional) – Specified if bitmap is tiled. Defaults to True.

  • stretch (bool, optional) – Specifies if bitmap is stretched. Defaults to False.

  • auto_name (bool, optional) – Specifies if name is ensured to be unique. Defaults to False.

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

  • style_family (str, DrawStyleFamilyKind, optional) – Family Style. Defaults to graphics.

  • style (HatchStyle) –

  • color (Color) –

  • space (float | UnitT) –

  • angle (Angle | int) –

  • bg_color (Color) –

Return type:

None

classmethod from_preset(preset, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Gets an instance from a preset

Parameters:
Returns:

Instance from preset.

Return type:

Hatch

classmethod from_style(doc, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Gets instance from Document.

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

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

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

Returns:

Hatch instance from document properties.

Return type:

Hatch

property prop_inner: Hatch

Gets Inner instance

Return type:

Hatch

property prop_style_name: str

Gets/Sets property Style Name

Return type:

str

class ooodev.format.draw.modify.area.Img(*, bitmap=None, name='', mode=ImgStyleKind.TILED, size=None, position=None, pos_offset=None, tile_offset=None, auto_name=False, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Bases: Img

Shape Style Modify Area Fill Image

New in version 0.17.9.

__init__(*, bitmap=None, name='', mode=ImgStyleKind.TILED, size=None, position=None, pos_offset=None, tile_offset=None, auto_name=False, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Constructor

Parameters:
  • bitmap (XBitmap, optional) – Bitmap instance. If name is not already in the Bitmap Table then this property is required.

  • name (str, optional) – Specifies the name of the image. This is also the name that is used to store bitmap in LibreOffice Bitmap Table.

  • mode (ImgStyleKind, optional) – Specifies the image style, tiled, stretched etc. Default ImgStyleKind.TILED.

  • size (SizePercent, SizeMM, optional) – Size in percent (0 - 100) or size in mm units.

  • position (RectanglePoint) – Tiling position of Image.

  • pos_offset (Offset, optional) – Tiling position offset.

  • tile_offset (OffsetColumn, OffsetRow, optional) – The tiling offset.

  • auto_name (bool, optional) – Specifies if name is ensured to be unique. Defaults to False.

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

  • style_family (str, DrawStyleFamilyKind, optional) – Family Style. Defaults to graphics.

Return type:

None

class ooodev.format.draw.modify.area.Pattern(*, bitmap=None, name='', tile=True, stretch=False, auto_name=False, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Bases: FillStyleBaseMulti

Draw Style Fill Pattern

New in version 0.17.9.

__init__(*, bitmap=None, name='', tile=True, stretch=False, auto_name=False, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Constructor

Parameters:
  • bitmap (XBitmap, optional) – Bitmap instance. If name is not already in the Bitmap Table then this property is required.

  • name (str, optional) – Specifies the name of the pattern. This is also the name that is used to store bitmap in LibreOffice Bitmap Table.

  • tile (bool, optional) – Specified if bitmap is tiled. Defaults to True.

  • stretch (bool, optional) – Specifies if bitmap is stretched. Defaults to False.

  • auto_name (bool, optional) – Specifies if name is ensured to be unique. Defaults to False.

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

  • style_family (str, DrawStyleFamilyKind, optional) – Family Style. Defaults to graphics.

Return type:

None

classmethod from_preset(preset, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Gets an instance from a preset

Parameters:
Returns:

Instance from preset.

Return type:

Pattern

classmethod from_style(doc, style_name='standard', style_family=DrawStyleFamilyKind.GRAPHICS)[source]

Gets instance from Document.

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

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

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

Returns:

Pattern instance from document properties.

Return type:

Pattern

property prop_inner: Pattern

Gets Inner instance

Return type:

Pattern

property prop_style_name: str

Gets/Sets property Style Name

Return type:

str