Class ShapeClassFactory
- class ooodev.draw.shapes.shape_class_factory.ShapeClassFactory(*, owner, component, class_name='', lo_inst=None, base_class=<class 'ooodev.draw.shapes.draw_shape.DrawShape'>)[source]
Bases:
OfficeDocumentPropPartial” Generates a class instance of a shape.
If a shape supports a service, a partial class is created for that service. The partial class is a subclass of the DrawShape class.
The Service to partial class mapping is as follows:
com.sun.star.drawing.LineProperties->ooodev.adapter.drawing.line_properties_partial.LinePropertiesPartialcom.sun.star.drawing.FillProperties->ooodev.adapter.drawing.fill_properties_partial.FillPropertiesPartialcom.sun.star.drawing.ShadowProperties->ooodev.adapter.drawing.shadow_properties_partial.ShadowPropertiesPartialcom.sun.star.drawing.RotationDescriptor->ooodev.adapter.drawing.rotation_descriptor_properties_partial.RotationDescriptorPropertiesPartialcom.sun.star.drawing.TextProperties->ooodev.adapter.drawing.text_properties_partial.TextPropertiesPartialcom.sun.star.document.LinkTarget->ooodev.adapter.document.link_target_properties_partial.LinkTargetPropertiesPartial
If the shape supports the
com.sun.star.drawing.GroupShapeservice, the following partial classes are implemented:ooodev.adapter.drawing.shape_group_partial.ShapeGroupPartialooodev.adapter.drawing.shapes_partial.ShapesPartialooodev.adapter.drawing.rotation_descriptor_properties_partial.RotationDescriptorPropertiesPartialooodev.adapter.document.link_target_properties_partial.LinkTargetPropertiesPartial
If the shape supports the
XGluePointsSupplierinterface, the following partial class is also implemented:ooodev.adapter.drawing.glue_points_supplier_partial.GluePointsSupplierPartial
If the shape document is of type
DocType.IMPRESS(Impress document) and the shape supports thecom.sun.star.presentation.Shapeservice, the following partial class is also implemented:ooodev.adapter.presentation.shape_properties_partial.ShapePropertiesPartial
- Parameters:
owner (Any) –
component (Any) –
class_name (str) –
lo_inst (LoInst | None) –
base_class (Type[Any]) –
- __init__(*, owner, component, class_name='', lo_inst=None, base_class=<class 'ooodev.draw.shapes.draw_shape.DrawShape'>)[source]
Constructor
- Parameters:
owner (Any) – Owner of the shape
component (Any) – UNO component that represents the shape
class_name (str, optional) – Class Name. Default to the name of the
base_class.lo_inst (LoInst | None, optional) – Load Office instance. Defaults to None.
base_class (Type[Any], optional) – Base Class Parent that the shape inherits from. Defaults to DrawShape.
- Raises:
ValueError – _description_
- Return type:
None
- get_class(**kwargs)[source]
Gets the class instance of the shape.
The returned class instance is a subclass of DrawShape and the other partial classes that are supported by the shape.
- Returns:
Shape class instance
- Return type:
Any
- property office_doc: OfficeDocumentT
Office Document.
- Return type: