Class ShapeFactoryPartial

class ooodev.draw.shapes.partial.shape_factory_partial.ShapeFactoryPartial(owner, lo_inst=None)[source]

Partial class for ShapeFactory.

__init__(owner, lo_inst=None)[source]

Constructor

Parameters:
  • owner (_T) – Owner object.

  • lo_inst (LoInst | None, optional) – Lo Instance. Defaults to None.

Return type:

None

is_know_shape(shape)[source]

Checks if a shape is known by this factory.

Parameters:

shape (XShape) – UNO object of a shape.

Returns:

True if shape is known; Otherwise, False.

Return type:

bool

shape_factory(shape)[source]

Gets a ShapeBase object from a XShape object.

Parameters:

shape (XShape) – UNO object of a shape.

Raises:

ValueError – If shape does not have ShapeType property.

Returns:

Object the inherits from ShapeBase such as RectangleShape or EllipseShape. If ShapeType of shape is not a match then DrawShape[_T] is returned.

Return type:

ShapeBase[_T]