LibreOffice Module slideshow (master) 1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
slideshow::internal::DrawShape Class Reference

This class is the representation of a draw document's XShape, and implements the Shape, AnimatableShape, and AttributableShape interfaces. More...

#include <drawshape.hxx>

Inheritance diagram for slideshow::internal::DrawShape:
[legend]
Collaboration diagram for slideshow::internal::DrawShape:
[legend]

Public Member Functions

virtual css::uno::Reference< css::drawing::XShape > getXShape () const override
 Get the associated XShape of this shape. More...
 
virtual ~DrawShape () override
 
virtual void addViewLayer (const ViewLayerSharedPtr &rNewLayer, bool bRedrawLayer) override
 Add a new view layer. More...
 
virtual bool removeViewLayer (const ViewLayerSharedPtr &rNewLayer) override
 Withdraw the shape from a view layer. More...
 
virtual void clearAllViewLayers () override
 Withdraw all view layers at once. More...
 
virtual ShapeAttributeLayerSharedPtr createAttributeLayer () override
 Create a new shape attribute layer. More...
 
virtual bool revokeAttributeLayer (const ShapeAttributeLayerSharedPtr &rLayer) override
 Revoke a previously generated attribute layer. More...
 
virtual ShapeAttributeLayerSharedPtr getTopmostAttributeLayer () const override
 Get the topmost shape attribute layer (if any). More...
 
virtual void setVisibility (bool bVisible) override
 Change default shape visibility. More...
 
virtual ::basegfx::B2DRectangle getBounds () const override
 Get the current shape position and size. More...
 
virtual ::basegfx::B2DRectangle getDomBounds () const override
 Get the DOM position and size of the shape. More...
 
virtual ::basegfx::B2DRectangle getUpdateArea () const override
 Get the current shape update area. More...
 
virtual bool isVisible () const override
 Query whether the shape is visible at all. More...
 
virtual double getPriority () const override
 Get the shape priority. More...
 
virtual void enterAnimationMode () override
 Notify the Shape that an animation starts now. More...
 
virtual void leaveAnimationMode () override
 Notify the Shape that it is no longer animated. More...
 
virtual bool isBackgroundDetached () const override
 Query whether the Shape is currently detached from the background. More...
 
virtual bool update () const override
 Update the shape. More...
 
virtual bool render () const override
 Render the shape. More...
 
virtual bool isContentChanged () const override
 Query whether shape content changed. More...
 
virtual const DocTreeNodeSuppliergetTreeNodeSupplier () const override
 Retrieve interface for DocTreeNode creation. More...
 
virtual DocTreeNodeSuppliergetTreeNodeSupplier () override
 
virtual DocTreeNode getSubsetNode () const override
 Query the subset this shape displays. More...
 
virtual AttributableShapeSharedPtr getSubset (const DocTreeNode &rTreeNode) const override
 Query a subset Shape, if already existent at this object. More...
 
virtual bool createSubset (AttributableShapeSharedPtr &o_rSubset, const DocTreeNode &rTreeNode) override
 Create a subset Shape. More...
 
virtual bool revokeSubset (const AttributableShapeSharedPtr &rShape) override
 Revoke a previously generated shape subset. More...
 
virtual sal_Int32 getNumberOfTreeNodes (DocTreeNode::NodeType eNodeType) const override
 Query number of tree nodes of the given type this shape contains. More...
 
virtual DocTreeNode getTreeNode (sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType) const override
 Create DocTreeNode from shape. More...
 
virtual sal_Int32 getNumberOfSubsetTreeNodes (const DocTreeNode &rParentNode, DocTreeNode::NodeType eNodeType) const override
 Query number of tree nodes of the given type this subset contains. More...
 
virtual DocTreeNode getSubsetTreeNode (const DocTreeNode &rParentNode, sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType) const override
 Create DocTreeNode from shape subset. More...
 
virtual HyperlinkRegions getHyperlinkRegions () const override
 Request hyperlink-sensitive areas. More...
 
virtual double getHyperlinkPriority () const override
 Retrieve priority of link area. More...
 
void setIntrinsicAnimationFrame (::std::size_t nCurrFrame)
 Display next frame of an intrinsic animation. More...
 
GDIMetaFileSharedPtr const & forceScrollTextMetaFile ()
 forces the drawshape to load and return a specially crafted metafile, usable to display drawing layer text animations. More...
 
virtual ShapeAttributeLayerSharedPtr createAttributeLayer ()=0
 Create a new shape attribute layer. More...
 
virtual bool revokeAttributeLayer (const ShapeAttributeLayerSharedPtr &rLayer)=0
 Revoke a previously generated attribute layer. More...
 
virtual ShapeAttributeLayerSharedPtr getTopmostAttributeLayer () const =0
 Get the topmost shape attribute layer (if any). More...
 
virtual void setVisibility (bool bVisible)=0
 Change default shape visibility. More...
 
virtual const DocTreeNodeSuppliergetTreeNodeSupplier () const =0
 Retrieve interface for DocTreeNode creation. More...
 
virtual DocTreeNodeSuppliergetTreeNodeSupplier ()=0
 
virtual DocTreeNode getSubsetNode () const =0
 Query the subset this shape displays. More...
 
virtual AttributableShapeSharedPtr getSubset (const DocTreeNode &rTreeNode) const =0
 Query a subset Shape, if already existent at this object. More...
 
virtual bool createSubset (AttributableShapeSharedPtr &o_rSubset, const DocTreeNode &rTreeNode)=0
 Create a subset Shape. More...
 
virtual bool revokeSubset (const AttributableShapeSharedPtr &rShape)=0
 Revoke a previously generated shape subset. More...
 
virtual void enterAnimationMode ()=0
 Notify the Shape that an animation starts now. More...
 
virtual void leaveAnimationMode ()=0
 Notify the Shape that it is no longer animated. More...
 
- Public Member Functions inherited from slideshow::internal::Shape
 Shape ()
 
virtual ~Shape ()
 
 Shape (const Shape &)=delete
 
Shapeoperator= (const Shape &)=delete
 
virtual css::uno::Reference< css::drawing::XShape > getXShape () const =0
 Get the associated XShape of this shape. More...
 
virtual void addViewLayer (const ViewLayerSharedPtr &rNewLayer, bool bRedrawLayer)=0
 Add a new view layer. More...
 
virtual bool removeViewLayer (const ViewLayerSharedPtr &rNewLayer)=0
 Withdraw the shape from a view layer. More...
 
virtual void clearAllViewLayers ()=0
 Withdraw all view layers at once. More...
 
virtual bool update () const =0
 Update the shape. More...
 
virtual bool render () const =0
 Render the shape. More...
 
virtual bool isContentChanged () const =0
 Query whether shape content changed. More...
 
virtual ::basegfx::B2DRectangle getBounds () const =0
 Get the current shape position and size. More...
 
virtual ::basegfx::B2DRectangle getDomBounds () const =0
 Get the DOM position and size of the shape. More...
 
virtual ::basegfx::B2DRectangle getUpdateArea () const =0
 Get the current shape update area. More...
 
virtual bool isVisible () const =0
 Query whether the shape is visible at all. More...
 
virtual double getPriority () const =0
 Get the shape priority. More...
 
virtual bool isBackgroundDetached () const =0
 Query whether the Shape is currently detached from the background. More...
 
virtual bool isForeground () const
 Check whether the shape belongs to the foreground. More...
 
virtual void setIsForeground (const bool bIsForeground)
 Set the flag that holds whether the shape is in the foreground or not. More...
 
virtual sal_Int32 getNumberOfTreeNodes (DocTreeNode::NodeType eNodeType) const =0
 Query number of tree nodes of the given type this shape contains. More...
 
virtual DocTreeNode getTreeNode (sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType) const =0
 Create DocTreeNode from shape. More...
 
virtual sal_Int32 getNumberOfSubsetTreeNodes (const DocTreeNode &rParentNode, DocTreeNode::NodeType eNodeType) const =0
 Query number of tree nodes of the given type this subset contains. More...
 
virtual DocTreeNode getSubsetTreeNode (const DocTreeNode &rParentNode, sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType) const =0
 Create DocTreeNode from shape subset. More...
 
virtual HyperlinkRegions getHyperlinkRegions () const =0
 Request hyperlink-sensitive areas. More...
 
virtual double getHyperlinkPriority () const =0
 Retrieve priority of link area. More...
 

Static Public Member Functions

static DrawShapeSharedPtr create (const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::drawing::XDrawPage > &xContainingPage, double nPrio, bool bForeignSource, const SlideShowContext &rContext)
 Create a shape for the given XShape. More...
 
static DrawShapeSharedPtr create (const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::drawing::XDrawPage > &xContainingPage, double nPrio, const Graphic &rGraphic, const SlideShowContext &rContext)
 Create a shape for the given XShape and graphic content. More...
 

Private Types

typedef ::std::vector< ViewShapeSharedPtrViewShapeVector
 the list of active view shapes (one for each registered view layer) More...
 
typedef ::std::pair< sal_Int32, sal_Int32 > HyperlinkIndexPair
 hyperlink support More...
 
typedef ::std::vector< HyperlinkIndexPairHyperlinkIndexPairVector
 

Private Member Functions

 DrawShape (const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::drawing::XDrawPage > &xContainingPage, double nPrio, bool bForeignSource, const SlideShowContext &rContext)
 Create a shape for the given XShape. More...
 
 DrawShape (const css::uno::Reference< css::drawing::XShape > &xShape, css::uno::Reference< css::drawing::XDrawPage > xContainingPage, double nPrio, const Graphic &rGraphic, const SlideShowContext &rContext)
 Create a shape for the given XShape and graphic content. More...
 
 DrawShape (const DrawShape &, const DocTreeNode &rTreeNode, double nPrio)
 Private copy constructor. More...
 
UpdateFlags getUpdateFlags () const
 
bool implRender (UpdateFlags nUpdateFlags) const
 
void updateStateIds () const
 
ViewShape::RenderArgs getViewRenderArgs () const
 
::basegfx::B2DRectangle getActualUnitShapeBounds () const
 
bool hasIntrinsicAnimation () const
 
bool hasHyperlinks () const
 
void prepareHyperlinkIndices () const
 

Private Attributes

css::uno::Reference< css::drawing::XShape > mxShape
 The associated XShape. More...
 
css::uno::Reference< css::drawing::XDrawPage > mxPage
 
VectorOfMtfAnimationFrames maAnimationFrames
 A vector of metafiles actually representing the Shape. More...
 
::std::size_t mnCurrFrame
 
GDIMetaFileSharedPtr mpCurrMtf
 Metafile of currently active frame (static for shapes w/o intrinsic animation) More...
 
int mnCurrMtfLoadFlags
 loadflags of current meta file More...
 
mutable ::std::optional< basegfx::B2DRectanglemaCurrentShapeUnitBounds
 Contains the current shape bounds, in unit rect space. More...
 
const double mnPriority
 
::basegfx::B2DRectangle maBounds
 
ShapeAttributeLayerSharedPtr mpAttributeLayer
 
std::weak_ptr< ActivitympIntrinsicAnimationActivity
 
State::StateId mnAttributeTransformationState
 
State::StateId mnAttributeClipState
 
State::StateId mnAttributeAlphaState
 
State::StateId mnAttributePositionState
 
State::StateId mnAttributeContentState
 
State::StateId mnAttributeVisibilityState
 
ViewShapeVector maViewShapes
 
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
 
HyperlinkIndexPairVector maHyperlinkIndices
 
HyperlinkRegions maHyperlinkRegions
 
DrawShapeSubsetting maSubsetting
 Delegated subset handling. More...
 
int mnIsAnimatedCount
 Whether this shape is currently in animation mode (value != 0) More...
 
sal_uInt32 mnAnimationLoopCount
 Number of times the bitmap animation shall loop. More...
 
bool mbIsVisible
 Whether shape is visible (without attribute layers) More...
 
bool mbForceUpdate
 Whether redraw is necessary, regardless of state ids. More...
 
bool mbAttributeLayerRevoked
 Whether attribute layer was revoked (making a redraw necessary) More...
 
bool mbDrawingLayerAnim
 whether a drawing layer animation has to be performed More...
 
bool mbContainsPageField
 tdf#150402 whether mpCurrMtf contains any Text with a PageField ("FIELD_SEQ_BEGIN;PageField") More...
 

Additional Inherited Members

- Public Types inherited from slideshow::internal::HyperlinkArea
typedef std::pair< ::basegfx::B2DRange, OUString > HyperlinkRegion
 
typedef std::vector< HyperlinkRegionHyperlinkRegions
 
- Protected Member Functions inherited from slideshow::internal::DocTreeNodeSupplier
 ~DocTreeNodeSupplier ()
 
- Protected Member Functions inherited from slideshow::internal::HyperlinkArea
 ~HyperlinkArea ()
 

Detailed Description

This class is the representation of a draw document's XShape, and implements the Shape, AnimatableShape, and AttributableShape interfaces.

Attention: \n this class is to be treated 'final', i.e. one
should not derive from it.

Definition at line 53 of file drawshape.hxx.

Member Typedef Documentation

◆ HyperlinkIndexPair

typedef ::std::pair<sal_Int32 , sal_Int32 > slideshow::internal::DrawShape::HyperlinkIndexPair
private

hyperlink support

Definition at line 326 of file drawshape.hxx.

◆ HyperlinkIndexPairVector

Definition at line 327 of file drawshape.hxx.

◆ ViewShapeVector

the list of active view shapes (one for each registered view layer)

Definition at line 319 of file drawshape.hxx.

Constructor & Destructor Documentation

◆ ~DrawShape()

slideshow::internal::DrawShape::~DrawShape ( )
overridevirtual

Definition at line 595 of file drawshape.cxx.

References DBG_UNHANDLED_EXCEPTION, and mpIntrinsicAnimationActivity.

◆ DrawShape() [1/3]

slideshow::internal::DrawShape::DrawShape ( const css::uno::Reference< css::drawing::XShape > &  xShape,
const css::uno::Reference< css::drawing::XDrawPage > &  xContainingPage,
double  nPrio,
bool  bForeignSource,
const SlideShowContext rContext 
)
private

Create a shape for the given XShape.

Parameters
xShapeThe XShape to represent.
xContainingPageThe page that contains this shape. Needed for proper import (currently, the UnoGraphicExporter needs this information).
nPrioExternally-determined shape priority (used e.g. for paint ordering). This number must be unique!
bForeignSourceWhen true, the source of the shape metafile might be a foreign application. The metafile is checked against unsupported content, and, if necessary, returned as a pre-rendered bitmap.

Referenced by createSubset().

◆ DrawShape() [2/3]

slideshow::internal::DrawShape::DrawShape ( const css::uno::Reference< css::drawing::XShape > &  xShape,
css::uno::Reference< css::drawing::XDrawPage >  xContainingPage,
double  nPrio,
const Graphic rGraphic,
const SlideShowContext rContext 
)
private

Create a shape for the given XShape and graphic content.

Parameters
xShapeThe XShape to represent.
xContainingPageThe page that contains this shape. Needed for proper import (currently, the UnoGraphicExporter needs this information).
nPrioExternally-determined shape priority (used e.g. for paint ordering). This number must be unique!
rGraphicGraphic to display in the shape's bound rect. If this Graphic contains animatable content, the created DrawShape will register itself for intrinsic animation events.

◆ DrawShape() [3/3]

slideshow::internal::DrawShape::DrawShape ( const DrawShape rSrc,
const DocTreeNode rTreeNode,
double  nPrio 
)
private

Private copy constructor.

Used to create subsetted shapes

Definition at line 470 of file drawshape.cxx.

References ENSURE_OR_THROW, mpCurrMtf, mxComponentContext, and mxShape.

Member Function Documentation

◆ addViewLayer()

void slideshow::internal::DrawShape::addViewLayer ( const ViewLayerSharedPtr rNewLayer,
bool  bRedrawLayer 
)
overridevirtual

Add a new view layer.

This method adds a new view layer, this shape shall show itself on.

Parameters
rNewLayerNew layer to show on
bRedrawLayerRedraw shape on given layer

Implements slideshow::internal::Shape.

Definition at line 616 of file drawshape.cxx.

References Force, getViewRenderArgs(), i, isVisible(), maViewShapes, mnIsAnimatedCount, and mpCurrMtf.

◆ clearAllViewLayers()

void slideshow::internal::DrawShape::clearAllViewLayers ( )
overridevirtual

Withdraw all view layers at once.

This method will be faster than repeated removeViewLayer() calls.

Implements slideshow::internal::Shape.

Definition at line 680 of file drawshape.cxx.

References maViewShapes.

◆ create() [1/2]

static DrawShapeSharedPtr slideshow::internal::DrawShape::create ( const css::uno::Reference< css::drawing::XShape > &  xShape,
const css::uno::Reference< css::drawing::XDrawPage > &  xContainingPage,
double  nPrio,
bool  bForeignSource,
const SlideShowContext rContext 
)
static

Create a shape for the given XShape.

Parameters
xShapeThe XShape to represent.
xContainingPageThe page that contains this shape. Needed for proper import (currently, the UnoGraphicExporter needs this information).
nPrioExternally-determined shape priority (used e.g. for paint ordering). This number must be unique!
bForeignSourceWhen true, the source of the shape metafile might be a foreign application. The metafile is checked against unsupported content, and, if necessary, returned as a pre-rendered bitmap.

◆ create() [2/2]

static DrawShapeSharedPtr slideshow::internal::DrawShape::create ( const css::uno::Reference< css::drawing::XShape > &  xShape,
const css::uno::Reference< css::drawing::XDrawPage > &  xContainingPage,
double  nPrio,
const Graphic rGraphic,
const SlideShowContext rContext 
)
static

Create a shape for the given XShape and graphic content.

Parameters
xShapeThe XShape to represent.
xContainingPageThe page that contains this shape. Needed for proper import (currently, the UnoGraphicExporter needs this information).
nPrioExternally-determined shape priority (used e.g. for paint ordering). This number must be unique!
rGraphicGraphic to display in the shape's bound rect. If this Graphic contains animatable content, the created DrawShape will register itself for intrinsic animation events.

◆ createAttributeLayer()

ShapeAttributeLayerSharedPtr slideshow::internal::DrawShape::createAttributeLayer ( )
overridevirtual

Create a new shape attribute layer.

This method creates a new layer for shape attributes, which lies atop of all previous attribute layers. That is most typically used when a new SMIL animation starts (which according to the spec always lies atop of all previous animations). Thus, subsequent calls to this method generate a sandwich of attribute layers, which in total define the shape's attributes.

Please note that the attribute layers do not contain the underlying XShape's attributes as default. Instead, attributes not explicitly set by animations remain in invalid state, allowing the shape's paint method to determine whether they have to override the underlying graphical shape representation. XShape attributes must be passed explicitly to animations which need them (e.g. 'by' animations).

Returns
the new layer

Implements slideshow::internal::AttributableShape.

Definition at line 1042 of file drawshape.cxx.

References mpAttributeLayer, and updateStateIds().

◆ createSubset()

bool slideshow::internal::DrawShape::createSubset ( AttributableShapeSharedPtr o_rSubset,
const DocTreeNode rTreeNode 
)
overridevirtual

Create a subset Shape.

This method creates a clone of this Shape, which renders only the selected subset of itself. Multiple createSubset() calls for the same DocTreeNode will all share the same subset shape.

The original shape (i.e. the one this method is called on) will cease to display the selected subset part. That is, together the shapes will display the original content, but the content of all subset shapes and their original shape will always be mutually disjunct.

After deregistering the subset shape a matching number of times via revokeSubset(), the original shape will resume displaying the subsetted part.

Attention: \n To maintain view integrity, this method
should only be called from the LayerManager
Parameters
o_rSubsetThe requested Shape
rTreeNodeA DocTreeNode instance queried from this Shape, which specifies the subset of the Shape to render
Returns
true, if the shape was newly created, and false, if an already existing subset is returned.

Implements slideshow::internal::AttributableShape.

Definition at line 1112 of file drawshape.cxx.

References slideshow::internal::DrawShapeSubsetting::addSubsetShape(), DrawShape(), slideshow::internal::DocTreeNode::getStartIndex(), slideshow::internal::DrawShapeSubsetting::getSubsetShape(), maCurrentShapeUnitBounds, maSubsetting, mnPriority, and SAL_MAX_INT16.

◆ enterAnimationMode()

void slideshow::internal::DrawShape::enterAnimationMode ( )
overridevirtual

Notify the Shape that an animation starts now.

This method enters animation mode on all registered views.

Attention: \n This method is supposed to be called only
from the LayerManager, since it might involve shifting shapes between different layers (and removing this shape from the background layer in the first place)

Implements slideshow::internal::AnimatableShape.

Definition at line 1006 of file drawshape.cxx.

References maViewShapes, and mnIsAnimatedCount.

◆ forceScrollTextMetaFile()

GDIMetaFileSharedPtr const & slideshow::internal::DrawShape::forceScrollTextMetaFile ( )

◆ getActualUnitShapeBounds()

basegfx::B2DRectangle slideshow::internal::DrawShape::getActualUnitShapeBounds ( ) const
private

◆ getBounds()

basegfx::B2DRectangle slideshow::internal::DrawShape::getBounds ( ) const
overridevirtual

Get the current shape position and size.

This method yields the currently effective shape bounds (which might change over time, for animated shapes). Please note that possibly shape rotations from its original document state must not be taken into account here: if you need the screen bounding box, use getUpdateArea() instead. Note further that shape rotations, which are already contained in the shape as displayed in the original document are included herein (we currently take the shape as-is from the document, assuming a rotation angle of 0).

Implements slideshow::internal::Shape.

Definition at line 714 of file drawshape.cxx.

References slideshow::internal::getShapePosSize(), maBounds, and mpAttributeLayer.

Referenced by getHyperlinkRegions(), getUpdateArea(), and getViewRenderArgs().

◆ getDomBounds()

basegfx::B2DRectangle slideshow::internal::DrawShape::getDomBounds ( ) const
overridevirtual

Get the DOM position and size of the shape.

This method yields the underlying DOM shape bounds, i.e. the original shape bounds from the document model. This value is always unaffected by any animation activity. Note that shape rotations, which are already contained in the shape as displayed in the original document are already included herein (we currently take the shape as-is from the document, assuming a rotation angle of 0).

Implements slideshow::internal::Shape.

Definition at line 723 of file drawshape.cxx.

References maBounds.

◆ getHyperlinkPriority()

double slideshow::internal::DrawShape::getHyperlinkPriority ( ) const
overridevirtual

Retrieve priority of link area.

Returns
the priority of the link area. Link areas with higher priority will receive hyperlink clicks in favor of areas with less priority, if they cover the same place on screen.

Implements slideshow::internal::HyperlinkArea.

Definition at line 997 of file drawshape.cxx.

References getPriority().

◆ getHyperlinkRegions()

HyperlinkArea::HyperlinkRegions slideshow::internal::DrawShape::getHyperlinkRegions ( ) const
overridevirtual

◆ getNumberOfSubsetTreeNodes()

sal_Int32 slideshow::internal::DrawShape::getNumberOfSubsetTreeNodes ( const DocTreeNode rParentNode,
DocTreeNode::NodeType  eNodeType 
) const
overridevirtual

Query number of tree nodes of the given type this subset contains.

The value returned by this method minus one is the maximum value permissible at the getSubsetTreeNode() method, for the given node type.

Parameters
rParentNodeThe parent node, below which the number of tree nodes of the given type shall be counted.
eNodeTypeNode type to count.
Exceptions
ShapeLoadFailedException,iftree node structure cannot be determined.

Implements slideshow::internal::DocTreeNodeSupplier.

Definition at line 1215 of file drawshape.cxx.

◆ getNumberOfTreeNodes()

sal_Int32 slideshow::internal::DrawShape::getNumberOfTreeNodes ( DocTreeNode::NodeType  eNodeType) const
overridevirtual

Query number of tree nodes of the given type this shape contains.

The value returned by this method minus one is the maximum value permissible at the getTreeNode() method, for the given node type.

Exceptions
ShapeLoadFailedException,iftree node structure cannot be determined.

Implements slideshow::internal::DocTreeNodeSupplier.

Definition at line 1199 of file drawshape.cxx.

◆ getPriority()

double slideshow::internal::DrawShape::getPriority ( ) const
overridevirtual

Get the shape priority.

The shape priority defines the relative order of the shapes on the slide.

Returns
the priority. Will be in the [0,+infty) range.

Implements slideshow::internal::Shape.

Definition at line 819 of file drawshape.cxx.

References mnPriority.

Referenced by getHyperlinkPriority().

◆ getSubset()

AttributableShapeSharedPtr slideshow::internal::DrawShape::getSubset ( const DocTreeNode rTreeNode) const
overridevirtual

Query a subset Shape, if already existent at this object.

This method returns a clone of this Shape, which renders only the selected subset of itself, but only if such a subset has been explicitly created before.

Parameters
rTreeNodeA DocTreeNode instance queried from this Shape, which specifies the subset of the Shape to render.
Returns
a NULL Shape pointer, if no subset exists for the given DocTreeNode.

Implements slideshow::internal::AttributableShape.

Definition at line 1106 of file drawshape.cxx.

References slideshow::internal::DrawShapeSubsetting::getSubsetShape(), and maSubsetting.

◆ getSubsetNode()

DocTreeNode slideshow::internal::DrawShape::getSubsetNode ( ) const
overridevirtual

Query the subset this shape displays.

This method returns a tree node denoting the subset displayed by this shape. If this shape is not a subset shape, an empty tree node should be returned. If this shape is a subset, and itself has subsetted children, this method might return more than the shape is actually displaying (because a single DocTreeNode is not able to model holes in the range).

Implements slideshow::internal::AttributableShape.

Definition at line 1100 of file drawshape.cxx.

References slideshow::internal::DrawShapeSubsetting::getSubsetNode(), and maSubsetting.

◆ getSubsetTreeNode()

DocTreeNode slideshow::internal::DrawShape::getSubsetTreeNode ( const DocTreeNode rParentNode,
sal_Int32  nNodeIndex,
DocTreeNode::NodeType  eNodeType 
) const
overridevirtual

Create DocTreeNode from shape subset.

This method creates a DocTreeNode from a shape, a parent tree node, a given node type and a running index into the shape's DocTreeNodes of the given type.

Parameters
rParentNodeParent node, below which the tree node with the given type shall be selected.
nNodeIndexStarting with 0, every DocTreeNode of the shape that has type eNodeType is indexed. The DocTreeNode whose index equals nNodeIndex will be returned.
eNodeTypeType of the node to return
Returns
the DocTreeNode found, or the empty DocTreeNode, if nothing was found.
Exceptions
ShapeLoadFailedException,iftree node structure cannot be determined.

Implements slideshow::internal::DocTreeNodeSupplier.

Definition at line 1221 of file drawshape.cxx.

◆ getTopmostAttributeLayer()

ShapeAttributeLayerSharedPtr slideshow::internal::DrawShape::getTopmostAttributeLayer ( ) const
overridevirtual

Get the topmost shape attribute layer (if any).

This method returns the topmost layer for shape attributes, i.e. the one which ultimately determines the shape's look.

Please note that the attribute layers do not contain the underlying XShape's attributes as default. Instead, attributes not explicitly set by animations remain in invalid state, allowing the shape's paint method to determine whether they have to override the underlying graphical shape representation. XShape attributes must be passed explicitly to animations which need them (e.g. 'by' animations).

Returns
the topmost layer

Implements slideshow::internal::AttributableShape.

Definition at line 1076 of file drawshape.cxx.

References mpAttributeLayer.

◆ getTreeNode()

DocTreeNode slideshow::internal::DrawShape::getTreeNode ( sal_Int32  nNodeIndex,
DocTreeNode::NodeType  eNodeType 
) const
overridevirtual

Create DocTreeNode from shape.

This method creates a DocTreeNode from a shape, a given node type and a running index into the shape's DocTreeNodes of the given type.

Parameters
nNodeIndexStarting with 0, every DocTreeNode of the shape that has type eNodeType is indexed. The DocTreeNode whose index equals nNodeIndex will be returned.
eNodeTypeType of the node to return
Returns
the DocTreeNode found, or the empty DocTreeNode, if nothing was found.
Exceptions
ShapeLoadFailedException,iftree node structure cannot be determined.

Implements slideshow::internal::DocTreeNodeSupplier.

Definition at line 1204 of file drawshape.cxx.

◆ getTreeNodeSupplier() [1/2]

const DocTreeNodeSupplier & slideshow::internal::DrawShape::getTreeNodeSupplier ( ) const
overridevirtual

Retrieve interface for DocTreeNode creation.

This method provides the caller with a reference to the DocTreeNodeSupplier interface, which can be used to request specific tree nodes for this shape.

Implements slideshow::internal::AttributableShape.

Definition at line 1090 of file drawshape.cxx.

◆ getTreeNodeSupplier() [2/2]

DocTreeNodeSupplier & slideshow::internal::DrawShape::getTreeNodeSupplier ( )
overridevirtual

Implements slideshow::internal::AttributableShape.

Definition at line 1095 of file drawshape.cxx.

◆ getUpdateArea()

basegfx::B2DRectangle slideshow::internal::DrawShape::getUpdateArea ( ) const
overridevirtual

◆ getUpdateFlags()

UpdateFlags slideshow::internal::DrawShape::getUpdateFlags ( ) const
private

◆ getViewRenderArgs()

ViewShape::RenderArgs slideshow::internal::DrawShape::getViewRenderArgs ( ) const
private

◆ getXShape()

uno::Reference< drawing::XShape > slideshow::internal::DrawShape::getXShape ( ) const
overridevirtual

Get the associated XShape of this shape.

Returns
the associated XShape. If this method returns an empty reference, this object might be one of the special-purpose shapes of a slide, which have no direct corresponding XShape (the background comes to mind here).

Implements slideshow::internal::Shape.

Definition at line 611 of file drawshape.cxx.

References mxShape.

◆ hasHyperlinks()

bool slideshow::internal::DrawShape::hasHyperlinks ( ) const
private

Definition at line 912 of file drawshape.cxx.

References maHyperlinkRegions.

◆ hasIntrinsicAnimation()

bool slideshow::internal::DrawShape::hasIntrinsicAnimation ( ) const
private

Definition at line 829 of file drawshape.cxx.

References maAnimationFrames, and mbDrawingLayerAnim.

◆ implRender()

bool slideshow::internal::DrawShape::implRender ( UpdateFlags  nUpdateFlags) const
private

◆ isBackgroundDetached()

bool slideshow::internal::DrawShape::isBackgroundDetached ( ) const
overridevirtual

Query whether the Shape is currently detached from the background.

This method checks whether the Shape is currently detached from the slide background, i.e. whether shape updates affect the underlying slide background or not. A shape that returns true here must not alter slide content in any way when called render() or update() (this is normally achieved by making this shape a sprite).

Implements slideshow::internal::Shape.

Definition at line 824 of file drawshape.cxx.

References mnIsAnimatedCount.

◆ isContentChanged()

bool slideshow::internal::DrawShape::isContentChanged ( ) const
overridevirtual

Query whether shape content changed.

This method returns true, if shape content changed since the last rendering (i.e. the shape needs an update to reflect that changed content on the views).

Implements slideshow::internal::Shape.

Definition at line 707 of file drawshape.cxx.

References getUpdateFlags(), mbForceUpdate, and NONE.

◆ isVisible()

bool slideshow::internal::DrawShape::isVisible ( ) const
overridevirtual

Query whether the shape is visible at all.

Returns
true, if this shape is visible, false otherwise.

Implements slideshow::internal::Shape.

Definition at line 795 of file drawshape.cxx.

References mbIsVisible, and mpAttributeLayer.

Referenced by addViewLayer(), getHyperlinkRegions(), implRender(), and revokeSubset().

◆ leaveAnimationMode()

void slideshow::internal::DrawShape::leaveAnimationMode ( )
overridevirtual

Notify the Shape that it is no longer animated.

This methods requests the Shape to end animation mode on all registered views, if called more or equal the times enterAnimationMode() was called. That is, the Shape only leaves animation mode, if all requested enterAnimationMode() call sites have issued their matching leaveAnimationMode().

Attention: \n This method is supposed to be called only
from the LayerManager, since it might involve shifting shapes between different layers (and adding this shape to the background layer again)

Implements slideshow::internal::AnimatableShape.

Definition at line 1022 of file drawshape.cxx.

References maViewShapes, and mnIsAnimatedCount.

◆ prepareHyperlinkIndices()

void slideshow::internal::DrawShape::prepareHyperlinkIndices ( ) const
private

◆ removeViewLayer()

bool slideshow::internal::DrawShape::removeViewLayer ( const ViewLayerSharedPtr rNewLayer)
overridevirtual

Withdraw the shape from a view layer.

This method removes the shape from the given view layer.

Returns
true, if the shape was successfully removed

Implements slideshow::internal::Shape.

Definition at line 651 of file drawshape.cxx.

References maViewShapes.

◆ render()

bool slideshow::internal::DrawShape::render ( ) const
overridevirtual

Render the shape.

This method renders the shape on all registered view layers, regardless of whether shape content has changed or not.

Returns
whether the rendering finished successfully.

Implements slideshow::internal::Shape.

Definition at line 697 of file drawshape.cxx.

References Force, getUpdateFlags(), and implRender().

Referenced by update().

◆ revokeAttributeLayer()

bool slideshow::internal::DrawShape::revokeAttributeLayer ( const ShapeAttributeLayerSharedPtr rLayer)
overridevirtual

Revoke a previously generated attribute layer.

This method revokes a previously generated attribute layer, and removes the effect of that layer from this shape. The layer need not be the current toplevel layer, it can also be revoked from in between.

Parameters
rLayerLayer to revoke. Must have been generated by createAttributeLayer() at the same Shape.
Returns
true, if layer was successfully removed, false otherwise (e.g. if the given layer was not generated for this shape).

Implements slideshow::internal::AttributableShape.

Definition at line 1053 of file drawshape.cxx.

References mbAttributeLayerRevoked, and mpAttributeLayer.

◆ revokeSubset()

bool slideshow::internal::DrawShape::revokeSubset ( const AttributableShapeSharedPtr rShape)
overridevirtual

Revoke a previously generated shape subset.

After revoking a subset shape, the corresponding subset part will become visible again on the original shape.

Attention: \n To maintain view integrity, this method
should only be called from the LayerManager
Parameters
rShapeThe subset to revoke
Returns
true, if the last client called revokeSubset().

Implements slideshow::internal::AttributableShape.

Definition at line 1154 of file drawshape.cxx.

References isVisible(), maCurrentShapeUnitBounds, maSubsetting, mbForceUpdate, mbIsVisible, mpAttributeLayer, and slideshow::internal::DrawShapeSubsetting::revokeSubsetShape().

◆ setIntrinsicAnimationFrame()

void slideshow::internal::DrawShape::setIntrinsicAnimationFrame ( ::std::size_t  nCurrFrame)

Display next frame of an intrinsic animation.

Used by IntrinsicAnimationActivity, to show the next animation frame.

Definition at line 834 of file drawshape.cxx.

References ENSURE_OR_RETURN_VOID, maAnimationFrames, mbForceUpdate, mnCurrFrame, and mpCurrMtf.

◆ setVisibility()

void slideshow::internal::DrawShape::setVisibility ( bool  bVisible)
overridevirtual

Change default shape visibility.

This method hides or unhides a shape. Note that every attribute layer generated for this shape is able to override the setting given here, until it is revoked.

Parameters
bVisibleWhen true, shape will be visible, when false, invisible (modulo attribute layer overrides).

Implements slideshow::internal::AttributableShape.

Definition at line 1081 of file drawshape.cxx.

References bVisible, mbForceUpdate, and mbIsVisible.

◆ update()

bool slideshow::internal::DrawShape::update ( ) const
overridevirtual

Update the shape.

This method updates the Shape on all registered view layers, but only if shape content has actually changed.

Returns
whether the update finished successfully.

Implements slideshow::internal::Shape.

Definition at line 685 of file drawshape.cxx.

References getUpdateFlags(), implRender(), mbForceUpdate, and render().

◆ updateStateIds()

void slideshow::internal::DrawShape::updateStateIds ( ) const
private

Member Data Documentation

◆ maAnimationFrames

VectorOfMtfAnimationFrames slideshow::internal::DrawShape::maAnimationFrames
mutableprivate

A vector of metafiles actually representing the Shape.

If this shape is not animated, only a single entry is available.

Definition at line 283 of file drawshape.hxx.

Referenced by hasIntrinsicAnimation(), and setIntrinsicAnimationFrame().

◆ maBounds

::basegfx::B2DRectangle slideshow::internal::DrawShape::maBounds
private

◆ maCurrentShapeUnitBounds

mutable ::std::optional<basegfx::B2DRectangle> slideshow::internal::DrawShape::maCurrentShapeUnitBounds
private

Contains the current shape bounds, in unit rect space.

Definition at line 293 of file drawshape.hxx.

Referenced by createSubset(), getActualUnitShapeBounds(), and revokeSubset().

◆ maHyperlinkIndices

HyperlinkIndexPairVector slideshow::internal::DrawShape::maHyperlinkIndices
mutableprivate

Definition at line 328 of file drawshape.hxx.

Referenced by getHyperlinkRegions(), and prepareHyperlinkIndices().

◆ maHyperlinkRegions

HyperlinkRegions slideshow::internal::DrawShape::maHyperlinkRegions
mutableprivate

Definition at line 329 of file drawshape.hxx.

Referenced by getHyperlinkRegions(), hasHyperlinks(), and prepareHyperlinkIndices().

◆ maSubsetting

DrawShapeSubsetting slideshow::internal::DrawShape::maSubsetting
mutableprivate

◆ maViewShapes

ViewShapeVector slideshow::internal::DrawShape::maViewShapes
private

◆ mbAttributeLayerRevoked

bool slideshow::internal::DrawShape::mbAttributeLayerRevoked
mutableprivate

Whether attribute layer was revoked (making a redraw necessary)

Definition at line 347 of file drawshape.hxx.

Referenced by getUpdateFlags(), implRender(), and revokeAttributeLayer().

◆ mbContainsPageField

bool slideshow::internal::DrawShape::mbContainsPageField
mutableprivate

tdf#150402 whether mpCurrMtf contains any Text with a PageField ("FIELD_SEQ_BEGIN;PageField")

Definition at line 353 of file drawshape.hxx.

Referenced by prepareHyperlinkIndices().

◆ mbDrawingLayerAnim

bool slideshow::internal::DrawShape::mbDrawingLayerAnim
private

whether a drawing layer animation has to be performed

Definition at line 350 of file drawshape.hxx.

Referenced by hasIntrinsicAnimation().

◆ mbForceUpdate

bool slideshow::internal::DrawShape::mbForceUpdate
mutableprivate

Whether redraw is necessary, regardless of state ids.

Definition at line 344 of file drawshape.hxx.

Referenced by implRender(), isContentChanged(), revokeSubset(), setIntrinsicAnimationFrame(), setVisibility(), and update().

◆ mbIsVisible

bool slideshow::internal::DrawShape::mbIsVisible
private

Whether shape is visible (without attribute layers)

Definition at line 341 of file drawshape.hxx.

Referenced by isVisible(), revokeSubset(), and setVisibility().

◆ mnAnimationLoopCount

sal_uInt32 slideshow::internal::DrawShape::mnAnimationLoopCount
private

Number of times the bitmap animation shall loop.

Definition at line 338 of file drawshape.hxx.

◆ mnAttributeAlphaState

State::StateId slideshow::internal::DrawShape::mnAttributeAlphaState
mutableprivate

Definition at line 313 of file drawshape.hxx.

Referenced by getUpdateFlags(), and updateStateIds().

◆ mnAttributeClipState

State::StateId slideshow::internal::DrawShape::mnAttributeClipState
mutableprivate

Definition at line 312 of file drawshape.hxx.

Referenced by getUpdateFlags(), and updateStateIds().

◆ mnAttributeContentState

State::StateId slideshow::internal::DrawShape::mnAttributeContentState
mutableprivate

Definition at line 315 of file drawshape.hxx.

Referenced by getUpdateFlags(), and updateStateIds().

◆ mnAttributePositionState

State::StateId slideshow::internal::DrawShape::mnAttributePositionState
mutableprivate

Definition at line 314 of file drawshape.hxx.

Referenced by getUpdateFlags(), and updateStateIds().

◆ mnAttributeTransformationState

State::StateId slideshow::internal::DrawShape::mnAttributeTransformationState
mutableprivate

Definition at line 311 of file drawshape.hxx.

Referenced by getUpdateFlags(), and updateStateIds().

◆ mnAttributeVisibilityState

State::StateId slideshow::internal::DrawShape::mnAttributeVisibilityState
mutableprivate

Definition at line 316 of file drawshape.hxx.

Referenced by getUpdateFlags(), and updateStateIds().

◆ mnCurrFrame

::std::size_t slideshow::internal::DrawShape::mnCurrFrame
private

Definition at line 284 of file drawshape.hxx.

Referenced by setIntrinsicAnimationFrame().

◆ mnCurrMtfLoadFlags

int slideshow::internal::DrawShape::mnCurrMtfLoadFlags
mutableprivate

loadflags of current meta file

Definition at line 290 of file drawshape.hxx.

Referenced by forceScrollTextMetaFile().

◆ mnIsAnimatedCount

int slideshow::internal::DrawShape::mnIsAnimatedCount
private

Whether this shape is currently in animation mode (value != 0)

Definition at line 335 of file drawshape.hxx.

Referenced by addViewLayer(), enterAnimationMode(), isBackgroundDetached(), and leaveAnimationMode().

◆ mnPriority

const double slideshow::internal::DrawShape::mnPriority
private

Definition at line 296 of file drawshape.hxx.

Referenced by createSubset(), getPriority(), and getViewRenderArgs().

◆ mpAttributeLayer

ShapeAttributeLayerSharedPtr slideshow::internal::DrawShape::mpAttributeLayer
private

◆ mpCurrMtf

GDIMetaFileSharedPtr slideshow::internal::DrawShape::mpCurrMtf
mutableprivate

Metafile of currently active frame (static for shapes w/o intrinsic animation)

Definition at line 287 of file drawshape.hxx.

Referenced by addViewLayer(), DrawShape(), forceScrollTextMetaFile(), getActualUnitShapeBounds(), getHyperlinkRegions(), prepareHyperlinkIndices(), and setIntrinsicAnimationFrame().

◆ mpIntrinsicAnimationActivity

std::weak_ptr<Activity> slideshow::internal::DrawShape::mpIntrinsicAnimationActivity
private

Definition at line 307 of file drawshape.hxx.

Referenced by ~DrawShape().

◆ mxComponentContext

css::uno::Reference< css::uno::XComponentContext> slideshow::internal::DrawShape::mxComponentContext
private

Definition at line 322 of file drawshape.hxx.

Referenced by forceScrollTextMetaFile().

◆ mxPage

css::uno::Reference< css::drawing::XDrawPage > slideshow::internal::DrawShape::mxPage
private

Definition at line 276 of file drawshape.hxx.

Referenced by forceScrollTextMetaFile().

◆ mxShape

css::uno::Reference< css::drawing::XShape > slideshow::internal::DrawShape::mxShape
private

The associated XShape.

Definition at line 275 of file drawshape.hxx.

Referenced by DrawShape(), forceScrollTextMetaFile(), and getXShape().


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