LibreOffice Module sc (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Attributes | List of all members
ScVbaObjectContainer Class Referenceabstract

Container for a specific type of drawing object in a spreadsheet. More...

Inheritance diagram for ScVbaObjectContainer:
[legend]
Collaboration diagram for ScVbaObjectContainer:
[legend]

Public Member Functions

 ScVbaObjectContainer (uno::Reference< XHelperInterface > xParent, uno::Reference< uno::XComponentContext > xContext, const uno::Reference< frame::XModel > &rxModel, const uno::Reference< sheet::XSpreadsheet > &rxSheet, const uno::Type &rVbaType)
 
const uno::Reference< XHelperInterface > & getParent () const
 Returns the VBA helper interface of the VBA collection object. More...
 
const uno::Reference< uno::XComponentContext > & getContext () const
 Returns the component context of the VBA collection object. More...
 
const uno::TypegetVbaType () const
 Returns the VBA type information of the objects in this container. More...
 
void collectShapes ()
 Collects all shapes supported by this instance and inserts them into the internal shape vector. More...
 
uno::Reference< drawing::XShape > createShape (const awt::Point &rPos, const awt::Size &rSize)
 Creates and returns a new UNO shape. More...
 
sal_Int32 insertShape (const uno::Reference< drawing::XShape > &rxShape)
 Inserts the passed shape into the draw page and into this container, and returns its index in the draw page. More...
 
::rtl::Reference< ScVbaSheetObjectBasecreateVbaObject (const uno::Reference< drawing::XShape > &rxShape)
 Creates and returns a new VBA implementation object for the passed shape. More...
 
uno::Any createCollectionObject (const uno::Any &rSource)
 Creates and returns a new VBA implementation object for the passed shape in an Any. More...
 
uno::Any getItemByStringIndex (const OUString &rIndex)
 Returns the VBA implementation object with the specified name. More...
 
virtual sal_Int32 SAL_CALL getCount () override
 
virtual uno::Any SAL_CALL getByIndex (sal_Int32 nIndex) override
 
virtual uno::Type SAL_CALL getElementType () override
 
virtual sal_Bool SAL_CALL hasElements () override
 

Protected Member Functions

virtual bool implPickShape (const uno::Reference< drawing::XShape > &rxShape) const =0
 Derived classes return true, if the passed shape is supported by the instance. More...
 
virtual rtl::Reference< ScVbaSheetObjectBaseimplCreateVbaObject (const uno::Reference< drawing::XShape > &rxShape)=0
 Derived classes create and return a new VBA implementation object for the passed shape. More...
 
virtual OUString implGetShapeServiceName () const =0
 Derived classes return the service name of the UNO shape. More...
 
virtual OUString implGetShapeName (const uno::Reference< drawing::XShape > &rxShape) const
 Returns the shape name via 'Name' property of the UNO shape. More...
 
virtual void implOnShapeCreated (const uno::Reference< drawing::XShape > &rxShape)
 Is called when a new UNO shape has been created but not yet inserted into the drawing page. More...
 

Protected Attributes

uno::Reference< XHelperInterface > mxParent
 
uno::Reference< uno::XComponentContext > mxContext
 
uno::Reference< frame::XModel > mxModel
 
uno::Reference< lang::XMultiServiceFactory > mxFactory
 
uno::Reference< drawing::XShapes > mxShapes
 

Private Types

typedef ::std::vector< uno::Reference< drawing::XShape > > ShapeVector
 

Private Attributes

const uno::Type maVbaType
 
ShapeVector maShapes
 

Detailed Description

Container for a specific type of drawing object in a spreadsheet.

Derived classes provide all required functionality specific to the type of shapes covered by the container.

Definition at line 78 of file vbasheetobjects.cxx.

Member Typedef Documentation

◆ ShapeVector

typedef ::std::vector< uno::Reference< drawing::XShape > > ScVbaObjectContainer::ShapeVector
private

Definition at line 166 of file vbasheetobjects.cxx.

Constructor & Destructor Documentation

◆ ScVbaObjectContainer()

ScVbaObjectContainer::ScVbaObjectContainer ( uno::Reference< XHelperInterface >  xParent,
uno::Reference< uno::XComponentContext >  xContext,
const uno::Reference< frame::XModel > &  rxModel,
const uno::Reference< sheet::XSpreadsheet > &  rxSheet,
const uno::Type rVbaType 
)
explicit
Exceptions
uno::RuntimeException

Definition at line 171 of file vbasheetobjects.cxx.

References mxContext, mxFactory, mxModel, mxParent, and mxShapes.

Member Function Documentation

◆ collectShapes()

void ScVbaObjectContainer::collectShapes ( )

Collects all shapes supported by this instance and inserts them into the internal shape vector.

Exceptions
uno::RuntimeException

Definition at line 187 of file vbasheetobjects.cxx.

References implPickShape(), maShapes, mxShapes, nCount, and nIndex.

◆ createCollectionObject()

uno::Any ScVbaObjectContainer::createCollectionObject ( const uno::Any rSource)

Creates and returns a new VBA implementation object for the passed shape in an Any.

Exceptions
uno::RuntimeException

Definition at line 220 of file vbasheetobjects.cxx.

References implCreateVbaObject().

Referenced by getItemByStringIndex().

◆ createShape()

uno::Reference< drawing::XShape > ScVbaObjectContainer::createShape ( const awt::Point &  rPos,
const awt::Size &  rSize 
)

Creates and returns a new UNO shape.

Exceptions
uno::RuntimeException

Definition at line 198 of file vbasheetobjects.cxx.

References implGetShapeServiceName(), implOnShapeCreated(), and mxFactory.

◆ createVbaObject()

rtl::Reference< ScVbaSheetObjectBase > ScVbaObjectContainer::createVbaObject ( const uno::Reference< drawing::XShape > &  rxShape)

Creates and returns a new VBA implementation object for the passed shape.

Exceptions
uno::RuntimeException

Definition at line 214 of file vbasheetobjects.cxx.

References implCreateVbaObject().

◆ getByIndex()

uno::Any SAL_CALL ScVbaObjectContainer::getByIndex ( sal_Int32  nIndex)
overridevirtual

Definition at line 243 of file vbasheetobjects.cxx.

References getCount(), maShapes, and nIndex.

◆ getContext()

const uno::Reference< uno::XComponentContext > & ScVbaObjectContainer::getContext ( ) const
inline

Returns the component context of the VBA collection object.

Definition at line 92 of file vbasheetobjects.cxx.

References mxContext.

◆ getCount()

sal_Int32 SAL_CALL ScVbaObjectContainer::getCount ( )
overridevirtual

Definition at line 238 of file vbasheetobjects.cxx.

References maShapes.

Referenced by getByIndex().

◆ getElementType()

uno::Type SAL_CALL ScVbaObjectContainer::getElementType ( )
overridevirtual

Definition at line 252 of file vbasheetobjects.cxx.

References cppu::UnoType< typename T >::get().

◆ getItemByStringIndex()

uno::Any ScVbaObjectContainer::getItemByStringIndex ( const OUString &  rIndex)

Returns the VBA implementation object with the specified name.

Exceptions
uno::RuntimeException

Definition at line 227 of file vbasheetobjects.cxx.

References createCollectionObject(), and maShapes.

◆ getParent()

const uno::Reference< XHelperInterface > & ScVbaObjectContainer::getParent ( ) const
inline

Returns the VBA helper interface of the VBA collection object.

Definition at line 90 of file vbasheetobjects.cxx.

References mxParent.

◆ getVbaType()

const uno::Type & ScVbaObjectContainer::getVbaType ( ) const
inline

Returns the VBA type information of the objects in this container.

Definition at line 94 of file vbasheetobjects.cxx.

References maVbaType.

◆ hasElements()

sal_Bool SAL_CALL ScVbaObjectContainer::hasElements ( )
overridevirtual

Definition at line 257 of file vbasheetobjects.cxx.

References maShapes.

◆ implCreateVbaObject()

virtual rtl::Reference< ScVbaSheetObjectBase > ScVbaObjectContainer::implCreateVbaObject ( const uno::Reference< drawing::XShape > &  rxShape)
protectedpure virtual

Derived classes create and return a new VBA implementation object for the passed shape.

Exceptions
uno::RuntimeException

Referenced by createCollectionObject(), and createVbaObject().

◆ implGetShapeName()

OUString ScVbaObjectContainer::implGetShapeName ( const uno::Reference< drawing::XShape > &  rxShape) const
protectedvirtual

Returns the shape name via 'Name' property of the UNO shape.

May be overwritten.

Exceptions
uno::RuntimeException

Definition at line 264 of file vbasheetobjects.cxx.

◆ implGetShapeServiceName()

virtual OUString ScVbaObjectContainer::implGetShapeServiceName ( ) const
protectedpure virtual

Derived classes return the service name of the UNO shape.

Referenced by createShape().

◆ implOnShapeCreated()

void ScVbaObjectContainer::implOnShapeCreated ( const uno::Reference< drawing::XShape > &  rxShape)
protectedvirtual

Is called when a new UNO shape has been created but not yet inserted into the drawing page.

Exceptions
uno::RuntimeException

Definition at line 270 of file vbasheetobjects.cxx.

Referenced by createShape().

◆ implPickShape()

virtual bool ScVbaObjectContainer::implPickShape ( const uno::Reference< drawing::XShape > &  rxShape) const
protectedpure virtual

Derived classes return true, if the passed shape is supported by the instance.

Referenced by collectShapes().

◆ insertShape()

sal_Int32 ScVbaObjectContainer::insertShape ( const uno::Reference< drawing::XShape > &  rxShape)

Inserts the passed shape into the draw page and into this container, and returns its index in the draw page.

Exceptions
uno::RuntimeException

Definition at line 207 of file vbasheetobjects.cxx.

References maShapes, and mxShapes.

Member Data Documentation

◆ maShapes

ShapeVector ScVbaObjectContainer::maShapes
private

◆ maVbaType

const uno::Type ScVbaObjectContainer::maVbaType
private

Definition at line 167 of file vbasheetobjects.cxx.

Referenced by getVbaType().

◆ mxContext

uno::Reference< uno::XComponentContext > ScVbaObjectContainer::mxContext
protected

Definition at line 160 of file vbasheetobjects.cxx.

Referenced by getContext().

◆ mxFactory

uno::Reference< lang::XMultiServiceFactory > ScVbaObjectContainer::mxFactory
protected

Definition at line 162 of file vbasheetobjects.cxx.

Referenced by createShape().

◆ mxModel

uno::Reference< frame::XModel > ScVbaObjectContainer::mxModel
protected

Definition at line 161 of file vbasheetobjects.cxx.

◆ mxParent

uno::Reference< XHelperInterface > ScVbaObjectContainer::mxParent
protected

Definition at line 159 of file vbasheetobjects.cxx.

Referenced by getParent().

◆ mxShapes

uno::Reference< drawing::XShapes > ScVbaObjectContainer::mxShapes
protected

Definition at line 163 of file vbasheetobjects.cxx.

Referenced by collectShapes(), insertShape(), and ScVbaObjectContainer().


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