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 (const OUString &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

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

Definition at line 186 of file vmldrawing.hxx.

typedef ::std::map< OUString, ControlInfo > oox::vml::Drawing::ControlInfoMap
private

Definition at line 188 of file vmldrawing.hxx.

Definition at line 187 of file vmldrawing.hxx.

Constructor & Destructor Documentation

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

Definition at line 94 of file vmldrawing.cxx.

References mxDrawPage, and mxDrawPage.

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

Definition at line 103 of file vmldrawing.cxx.

Member Function Documentation

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 147 of file vmldrawing.cxx.

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

Referenced by createAndInsertXControlShape().

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 327 of file vmldrawing.cxx.

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

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 332 of file vmldrawing.cxx.

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

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 295 of file vmldrawing.cxx.

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

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

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

Final processing after import of the fragment.

Definition at line 142 of file vmldrawing.cxx.

References mxShapes.

Referenced by oox::vml::DrawingFragment::finalizeImport().

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

Returns the form object used to process ActiveX form controls.

Definition at line 107 of file vmldrawing.cxx.

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

Referenced by createAndInsertXControlShape().

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

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

Definition at line 254 of file vmldrawing.cxx.

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

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

::oox::core::XmlFilterBase& oox::vml::Drawing::getFilter ( ) const
inline
sal_Int32 oox::vml::Drawing::getLocalShapeIndex ( const OUString &  rShapeId) const

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

Definition at line 208 of file vmldrawing.cxx.

References maBlockIds, and nIndex.

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

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

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

Definition at line 249 of file vmldrawing.cxx.

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

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

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 322 of file vmldrawing.cxx.

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

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(), and oox::vml::DrawingFragment::onCreateContext().

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.

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::DrawingFragment::onCreateContext(), and oox::vml::ShapeContainer::takeLastShape().

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

Derived classes may disable conversion of specific shapes.

Definition at line 317 of file vmldrawing.cxx.

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

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 338 of file vmldrawing.cxx.

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

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 115 of file vmldrawing.cxx.

References maBlockIds.

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

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 134 of file vmldrawing.cxx.

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

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

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 127 of file vmldrawing.cxx.

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

Member Data Documentation

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().

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().

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().

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

Application type containing the drawing.

Definition at line 198 of file vmldrawing.hxx.

::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().

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().

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().

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: