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 (const uno::Reference< XHelperInterface > &rxParent, const uno::Reference< uno::XComponentContext > &rxContext, 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 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 75 of file vbasheetobjects.cxx.

Member Typedef Documentation

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

Definition at line 163 of file vbasheetobjects.cxx.

Constructor & Destructor Documentation

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

Definition at line 168 of file vbasheetobjects.cxx.

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

Member Function Documentation

void ScVbaObjectContainer::collectShapes ( )

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

Exceptions
uno::RuntimeException

Definition at line 184 of file vbasheetobjects.cxx.

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

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 217 of file vbasheetobjects.cxx.

References implCreateVbaObject().

Referenced by getItemByStringIndex().

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 195 of file vbasheetobjects.cxx.

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

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 211 of file vbasheetobjects.cxx.

References implCreateVbaObject().

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

Definition at line 240 of file vbasheetobjects.cxx.

References getCount(), and maShapes.

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

Returns the component context of the VBA collection object.

Definition at line 89 of file vbasheetobjects.cxx.

References mxContext.

sal_Int32 SAL_CALL ScVbaObjectContainer::getCount ( )
overridevirtual

Definition at line 235 of file vbasheetobjects.cxx.

References maShapes.

Referenced by getByIndex().

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

Definition at line 249 of file vbasheetobjects.cxx.

References cppu::UnoType< class >::get().

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

Returns the VBA implementation object with the specified name.

Exceptions
uno::RuntimeException

Definition at line 224 of file vbasheetobjects.cxx.

References createCollectionObject(), implGetShapeName(), and maShapes.

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

Returns the VBA helper interface of the VBA collection object.

Definition at line 87 of file vbasheetobjects.cxx.

References mxParent.

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

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

Definition at line 91 of file vbasheetobjects.cxx.

References maVbaType.

sal_Bool SAL_CALL ScVbaObjectContainer::hasElements ( )
overridevirtual

Definition at line 254 of file vbasheetobjects.cxx.

References maShapes.

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

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 261 of file vbasheetobjects.cxx.

Referenced by getItemByStringIndex().

virtual OUString ScVbaObjectContainer::implGetShapeServiceName ( ) const
protectedpure virtual

Derived classes return the service name of the UNO shape.

Referenced by createShape().

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 267 of file vbasheetobjects.cxx.

Referenced by createShape().

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

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 204 of file vbasheetobjects.cxx.

References maShapes, and mxShapes.

Member Data Documentation

ShapeVector ScVbaObjectContainer::maShapes
private
const uno::Type ScVbaObjectContainer::maVbaType
private

Definition at line 164 of file vbasheetobjects.cxx.

Referenced by getVbaType().

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

Definition at line 157 of file vbasheetobjects.cxx.

Referenced by getContext().

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

Definition at line 159 of file vbasheetobjects.cxx.

Referenced by createShape().

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

Definition at line 158 of file vbasheetobjects.cxx.

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

Definition at line 156 of file vbasheetobjects.cxx.

Referenced by getParent().

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

Definition at line 160 of file vbasheetobjects.cxx.

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


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