LibreOffice Module oox (master) 1
Public Member Functions | Private Types | Private Attributes | List of all members
oox::vml::Drawing Class Reference

Represents the collection of VML shapes for a complete draw page. More...

#include <vmldrawing.hxx>

Collaboration diagram for oox::vml::Drawing:
[legend]

Public Member Functions

 Drawing (::oox::core::XmlFilterBase &rFilter, const css::uno::Reference< css::drawing::XDrawPage > &rxDrawPage, DrawingType eType)
 
virtual ~Drawing ()
 
::oox::core::XmlFilterBasegetFilter () const
 Returns the filter object that imports/exports this VML drawing. More...
 
DrawingType getType () const
 Returns the application type containing the drawing. More...
 
ShapeContainergetShapes ()
 Returns read/write access to the container of shapes and templates. More...
 
const ShapeContainergetShapes () const
 Returns read access to the container of shapes and templates. More...
 
::oox::ole::EmbeddedFormgetControlForm () const
 Returns the form object used to process ActiveX form controls. More...
 
void registerBlockId (sal_Int32 nBlockId)
 Registers a block of shape identifiers reserved by this drawing. More...
 
void registerOleObject (const OleObjectInfo &rOleObject)
 Registers the passed embedded OLE object. More...
 
void registerControl (const ControlInfo &rControl)
 Registers the passed embedded form control. More...
 
void finalizeFragmentImport ()
 Final processing after import of the fragment. More...
 
void convertAndInsert () const
 Creates and inserts all UNO shapes into the draw page. More...
 
sal_Int32 getLocalShapeIndex (std::u16string_view rShapeId) const
 Returns the local shape index from the passed global shape identifier. More...
 
const OleObjectInfogetOleObjectInfo (const OUString &rShapeId) const
 Returns the registered info structure for an OLE object, if extant. More...
 
const ControlInfogetControlInfo (const OUString &rShapeId) const
 Returns the registered info structure for a form control, if extant. More...
 
css::uno::Reference< css::drawing::XShape > createAndInsertXShape (const OUString &rService, const css::uno::Reference< css::drawing::XShapes > &rxShapes, const css::awt::Rectangle &rShapeRect) const
 Creates a new UNO shape object, inserts it into the passed UNO shape container, and sets the shape position and size. More...
 
css::uno::Reference< css::drawing::XShape > createAndInsertXControlShape (const ::oox::ole::EmbeddedControl &rControl, const css::uno::Reference< css::drawing::XShapes > &rxShapes, const css::awt::Rectangle &rShapeRect, sal_Int32 &rnCtrlIndex) const
 Creates a new UNO shape object for a form control, inserts the control model into the form, and the shape into the passed UNO shape container. More...
 
virtual bool isShapeSupported (const ShapeBase &rShape) const
 Derived classes may disable conversion of specific shapes. More...
 
virtual OUString getShapeBaseName (const ShapeBase &rShape) const
 Derived classes may return additional base names for automatic shape name creation. More...
 
virtual bool convertClientAnchor (css::awt::Rectangle &orShapeRect, const OUString &rShapeAnchor) const
 Derived classes may calculate the shape rectangle from a non-standard anchor information string. More...
 
virtual css::uno::Reference< css::drawing::XShape > createAndInsertClientXShape (const ShapeBase &rShape, const css::uno::Reference< css::drawing::XShapes > &rxShapes, const css::awt::Rectangle &rShapeRect) const
 Derived classes create a UNO shape according to the passed shape model. More...
 
virtual void notifyXShapeInserted (const css::uno::Reference< css::drawing::XShape > &rxShape, const css::awt::Rectangle &rShapeRect, const ShapeBase &rShape, bool bGroupChild)
 Derived classes may want to know that a UNO shape has been inserted. More...
 

Private Types

typedef ::std::vector< sal_Int32 > BlockIdVector
 
typedef ::std::map< OUString, OleObjectInfoOleObjectInfoMap
 
typedef ::std::map< OUString, ControlInfoControlInfoMap
 

Private Attributes

::oox::core::XmlFilterBasemrFilter
 Filter object that imports/exports the VML drawing. More...
 
css::uno::Reference< css::drawing::XDrawPage > mxDrawPage
 UNO draw page used to insert the shapes. More...
 
std::unique_ptr<::oox::ole::EmbeddedFormmxCtrlForm
 The control form used to process embedded controls. More...
 
BlockIdVector maBlockIds
 Block identifiers used by this drawing. More...
 
std::unique_ptr< ShapeContainermxShapes
 All shapes and shape templates. More...
 
OleObjectInfoMap maOleObjects
 Info about all embedded OLE objects, mapped by shape id. More...
 
ControlInfoMap maControls
 Info about all embedded form controls, mapped by control name. More...
 
const DrawingType meType
 Application type containing the drawing. More...
 

Detailed Description

Represents the collection of VML shapes for a complete draw page.

Definition at line 93 of file vmldrawing.hxx.

Member Typedef Documentation

◆ BlockIdVector

typedef ::std::vector< sal_Int32 > oox::vml::Drawing::BlockIdVector
private

Definition at line 186 of file vmldrawing.hxx.

◆ ControlInfoMap

Definition at line 188 of file vmldrawing.hxx.

◆ OleObjectInfoMap

Definition at line 187 of file vmldrawing.hxx.

Constructor & Destructor Documentation

◆ Drawing()

oox::vml::Drawing::Drawing ( ::oox::core::XmlFilterBase rFilter,
const css::uno::Reference< css::drawing::XDrawPage > &  rxDrawPage,
DrawingType  eType 
)
explicit

Definition at line 95 of file vmldrawing.cxx.

References eType, mxDrawPage, and mxDrawPage.

◆ ~Drawing()

oox::vml::Drawing::~Drawing ( )
virtual

Definition at line 104 of file vmldrawing.cxx.

Member Function Documentation

◆ convertAndInsert()

void oox::vml::Drawing::convertAndInsert ( ) const

Creates and inserts all UNO shapes into the draw page.

The virtual function notifyXShapeInserted() will be called for each new shape.

Definition at line 148 of file vmldrawing.cxx.

References DBG_UNHANDLED_EXCEPTION, namespaces::i, mxDrawPage, mxShapes, and sName.

Referenced by createAndInsertXControlShape().

◆ convertClientAnchor()

bool oox::vml::Drawing::convertClientAnchor ( css::awt::Rectangle &  orShapeRect,
const OUString &  rShapeAnchor 
) const
virtual

Derived classes may calculate the shape rectangle from a non-standard anchor information string.

Definition at line 328 of file vmldrawing.cxx.

Referenced by oox::vml::ShapeBase::calcShapeRectangle().

◆ createAndInsertClientXShape()

Reference< XShape > oox::vml::Drawing::createAndInsertClientXShape ( const ShapeBase rShape,
const css::uno::Reference< css::drawing::XShapes > &  rxShapes,
const css::awt::Rectangle &  rShapeRect 
) const
virtual

Derived classes create a UNO shape according to the passed shape model.

Called for shape models that specify being under host control.

Definition at line 333 of file vmldrawing.cxx.

Referenced by oox::vml::ComplexShape::implConvertAndInsert().

◆ createAndInsertXControlShape()

Reference< XShape > oox::vml::Drawing::createAndInsertXControlShape ( const ::oox::ole::EmbeddedControl rControl,
const css::uno::Reference< css::drawing::XShapes > &  rxShapes,
const css::awt::Rectangle &  rShapeRect,
sal_Int32 &  rnCtrlIndex 
) const

Creates a new UNO shape object for a form control, inserts the control model into the form, and the shape into the passed UNO shape container.

Definition at line 296 of file vmldrawing.cxx.

References convertAndInsert(), createAndInsertXShape(), Exception, getControlForm(), and TOOLS_WARN_EXCEPTION.

Referenced by oox::vml::ComplexShape::implConvertAndInsert().

◆ createAndInsertXShape()

Reference< XShape > oox::vml::Drawing::createAndInsertXShape ( const OUString &  rService,
const css::uno::Reference< css::drawing::XShapes > &  rxShapes,
const css::awt::Rectangle &  rShapeRect 
) const

◆ finalizeFragmentImport()

void oox::vml::Drawing::finalizeFragmentImport ( )

Final processing after import of the fragment.

Definition at line 143 of file vmldrawing.cxx.

References mxShapes.

◆ getControlForm()

oox::ole::EmbeddedForm & oox::vml::Drawing::getControlForm ( ) const

Returns the form object used to process ActiveX form controls.

Definition at line 108 of file vmldrawing.cxx.

References oox::core::FilterBase::getGraphicHelper(), oox::core::FilterBase::getModel(), mrFilter, mxCtrlForm, and mxDrawPage.

Referenced by createAndInsertXControlShape().

◆ getControlInfo()

const ControlInfo * oox::vml::Drawing::getControlInfo ( const OUString &  rShapeId) const

Returns the registered info structure for a form control, if extant.

Definition at line 255 of file vmldrawing.cxx.

References oox::ContainerHelper::getMapElement(), and maControls.

Referenced by oox::vml::ComplexShape::implConvertAndInsert().

◆ getFilter()

::oox::core::XmlFilterBase & oox::vml::Drawing::getFilter ( ) const
inline

◆ getLocalShapeIndex()

sal_Int32 oox::vml::Drawing::getLocalShapeIndex ( std::u16string_view  rShapeId) const

Returns the local shape index from the passed global shape identifier.

Definition at line 209 of file vmldrawing.cxx.

References maBlockIds, and nIndex.

Referenced by oox::vml::ShapeBase::getShapeName().

◆ getOleObjectInfo()

const OleObjectInfo * oox::vml::Drawing::getOleObjectInfo ( const OUString &  rShapeId) const

Returns the registered info structure for an OLE object, if extant.

Definition at line 250 of file vmldrawing.cxx.

References oox::ContainerHelper::getMapElement(), and maOleObjects.

Referenced by oox::vml::ComplexShape::implConvertAndInsert().

◆ getShapeBaseName()

OUString oox::vml::Drawing::getShapeBaseName ( const ShapeBase rShape) const
virtual

Derived classes may return additional base names for automatic shape name creation.

Definition at line 323 of file vmldrawing.cxx.

Referenced by oox::vml::ShapeBase::getShapeName().

◆ getShapes() [1/2]

ShapeContainer & oox::vml::Drawing::getShapes ( )
inline

Returns read/write access to the container of shapes and templates.

Definition at line 108 of file vmldrawing.hxx.

Referenced by oox::vml::ShapeBase::finalizeFragmentImport().

◆ getShapes() [2/2]

const ShapeContainer & oox::vml::Drawing::getShapes ( ) const
inline

Returns read access to the container of shapes and templates.

Definition at line 110 of file vmldrawing.hxx.

◆ getType()

DrawingType oox::vml::Drawing::getType ( ) const
inline

Returns the application type containing the drawing.

Definition at line 106 of file vmldrawing.hxx.

References meType.

Referenced by oox::vml::ShapeContainer::takeLastShape().

◆ isShapeSupported()

bool oox::vml::Drawing::isShapeSupported ( const ShapeBase rShape) const
virtual

Derived classes may disable conversion of specific shapes.

Definition at line 318 of file vmldrawing.cxx.

Referenced by oox::vml::ShapeBase::convertAndInsert().

◆ notifyXShapeInserted()

void oox::vml::Drawing::notifyXShapeInserted ( const css::uno::Reference< css::drawing::XShape > &  rxShape,
const css::awt::Rectangle &  rShapeRect,
const ShapeBase rShape,
bool  bGroupChild 
)
virtual

Derived classes may want to know that a UNO shape has been inserted.

Will be called from the convertAndInsert() implementation.

Parameters
bGroupChildTrue = inserted into a group shape, false = inserted directly into this drawing.

Definition at line 339 of file vmldrawing.cxx.

Referenced by oox::vml::ShapeBase::convertAndInsert().

◆ registerBlockId()

void oox::vml::Drawing::registerBlockId ( sal_Int32  nBlockId)

Registers a block of shape identifiers reserved by this drawing.

Block size is 1024, shape identifiers are one-based (block 1 => 1025-2048).

Definition at line 116 of file vmldrawing.cxx.

References maBlockIds.

Referenced by oox::vml::ShapeLayoutContext::onCreateContext().

◆ registerControl()

void oox::vml::Drawing::registerControl ( const ControlInfo rControl)

Registers the passed embedded form control.

The related shape will then load the control properties from the specified fragment.

Definition at line 135 of file vmldrawing.cxx.

References maControls, oox::vml::ControlInfo::maName, and oox::vml::ControlInfo::maShapeId.

Referenced by oox::vml::ControlShapeContext::ControlShapeContext().

◆ registerOleObject()

void oox::vml::Drawing::registerOleObject ( const OleObjectInfo rOleObject)

Registers the passed embedded OLE object.

The related shape will then load the OLE object data from the specified fragment.

Definition at line 128 of file vmldrawing.cxx.

References maOleObjects, and oox::vml::OleObjectInfo::maShapeId.

Member Data Documentation

◆ maBlockIds

BlockIdVector oox::vml::Drawing::maBlockIds
mutableprivate

Block identifiers used by this drawing.

Definition at line 194 of file vmldrawing.hxx.

Referenced by getLocalShapeIndex(), and registerBlockId().

◆ maControls

ControlInfoMap oox::vml::Drawing::maControls
private

Info about all embedded form controls, mapped by control name.

Definition at line 197 of file vmldrawing.hxx.

Referenced by getControlInfo(), and registerControl().

◆ maOleObjects

OleObjectInfoMap oox::vml::Drawing::maOleObjects
private

Info about all embedded OLE objects, mapped by shape id.

Definition at line 196 of file vmldrawing.hxx.

Referenced by getOleObjectInfo(), and registerOleObject().

◆ meType

const DrawingType oox::vml::Drawing::meType
private

Application type containing the drawing.

Definition at line 198 of file vmldrawing.hxx.

◆ mrFilter

::oox::core::XmlFilterBase& oox::vml::Drawing::mrFilter
private

Filter object that imports/exports the VML drawing.

Definition at line 190 of file vmldrawing.hxx.

Referenced by createAndInsertXShape(), and getControlForm().

◆ mxCtrlForm

std::unique_ptr<::oox::ole::EmbeddedForm> oox::vml::Drawing::mxCtrlForm
mutableprivate

The control form used to process embedded controls.

Definition at line 193 of file vmldrawing.hxx.

Referenced by getControlForm().

◆ mxDrawPage

css::uno::Reference< css::drawing::XDrawPage > oox::vml::Drawing::mxDrawPage
private

UNO draw page used to insert the shapes.

Definition at line 192 of file vmldrawing.hxx.

Referenced by convertAndInsert(), Drawing(), and getControlForm().

◆ mxShapes

std::unique_ptr<ShapeContainer> oox::vml::Drawing::mxShapes
private

All shapes and shape templates.

Definition at line 195 of file vmldrawing.hxx.

Referenced by convertAndInsert(), and finalizeFragmentImport().


The documentation for this class was generated from the following files: