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

Subset RAII wrapper for shapes. More...

#include <shapesubset.hxx>

Collaboration diagram for slideshow::internal::ShapeSubset:
[legend]

Public Member Functions

 ShapeSubset (AttributableShapeSharedPtr xOriginalShape, const DocTreeNode &rTreeNode, SubsettableShapeManagerSharedPtr xSubsetManager)
 Create a subset directly from a Shape. More...
 
 ShapeSubset (const ShapeSubsetSharedPtr &rOriginalSubset, const DocTreeNode &rTreeNode)
 Create a subset from another subset. More...
 
 ShapeSubset (AttributableShapeSharedPtr xOriginalShape, SubsettableShapeManagerSharedPtr xShapeManager)
 Create full set for the given shape. More...
 
 ~ShapeSubset ()
 
 ShapeSubset (ShapeSubset const &)=default
 
void operator= (ShapeSubset const &)=delete
 
AttributableShapeSharedPtr const & getSubsetShape () const
 Get the actual subset shape. More...
 
void enableSubsetShape ()
 Enable the subset shape. More...
 
void disableSubsetShape ()
 Disable the subset shape. More...
 
bool isFullSet () const
 Query whether this subset actually is none, but contains the whole original shape's content. More...
 
const DocTreeNodegetSubset () const
 Query subset this object represents. More...
 

Private Attributes

AttributableShapeSharedPtr mpOriginalShape
 
AttributableShapeSharedPtr mpSubsetShape
 
DocTreeNode maTreeNode
 
SubsettableShapeManagerSharedPtr mpShapeManager
 

Detailed Description

Subset RAII wrapper for shapes.

This class wraps the plain Shape with a wrapper for subset functionality. Subsetting can be turned on and off. Note that the reason to have shape subsetting RAII implemented separately (i.e. not within the DrawShape) was that subsetting (and de-subsetting) needs the SubsettableShapeManager. And holding that at the DrawShape creates one heck of a circular reference.

Definition at line 45 of file shapesubset.hxx.

Constructor & Destructor Documentation

◆ ShapeSubset() [1/4]

slideshow::internal::ShapeSubset::ShapeSubset ( AttributableShapeSharedPtr  xOriginalShape,
const DocTreeNode rTreeNode,
SubsettableShapeManagerSharedPtr  xSubsetManager 
)

Create a subset directly from a Shape.

Parameters
rOriginalShapeOriginal shape to subset
rTreeNodeSubset this object should represent
rShapeManagerManager object, where subsets are registered/unregistered

Definition at line 31 of file shapesubset.cxx.

References ENSURE_OR_THROW, and mpShapeManager.

◆ ShapeSubset() [2/4]

slideshow::internal::ShapeSubset::ShapeSubset ( const ShapeSubsetSharedPtr rOriginalSubset,
const DocTreeNode rTreeNode 
)

Create a subset from another subset.

Note: if you want this subset to subtract from the passed subset reference (and not from the original, unsubsetted shape), the passed subset must be enabled (enableSubsetShape() must have been called)

Parameters
rOriginalSubsetOriginal subset, which to subset again.
rTreeNodeSubset of the original subset

Definition at line 43 of file shapesubset.cxx.

References ENSURE_OR_THROW, slideshow::internal::DocTreeNode::getEndIndex(), slideshow::internal::DocTreeNode::getStartIndex(), and mpShapeManager.

◆ ShapeSubset() [3/4]

slideshow::internal::ShapeSubset::ShapeSubset ( AttributableShapeSharedPtr  xOriginalShape,
SubsettableShapeManagerSharedPtr  xShapeManager 
)

Create full set for the given shape.

Parameters
rOriginalShapeOriginal shape, which will be represented as a whole by this object

Definition at line 60 of file shapesubset.cxx.

References ENSURE_OR_THROW, and mpShapeManager.

◆ ~ShapeSubset()

slideshow::internal::ShapeSubset::~ShapeSubset ( )

Definition at line 71 of file shapesubset.cxx.

References disableSubsetShape(), and TOOLS_WARN_EXCEPTION.

◆ ShapeSubset() [4/4]

slideshow::internal::ShapeSubset::ShapeSubset ( ShapeSubset const &  )
default

Member Function Documentation

◆ disableSubsetShape()

void slideshow::internal::ShapeSubset::disableSubsetShape ( )

Disable the subset shape.

This method revokes the subset from the original shape. That means, the original shape will again show the hidden range.

Definition at line 100 of file shapesubset.cxx.

References mpOriginalShape, mpShapeManager, and mpSubsetShape.

Referenced by ~ShapeSubset().

◆ enableSubsetShape()

void slideshow::internal::ShapeSubset::enableSubsetShape ( )

Enable the subset shape.

This method enables the subset. That means, on successful completion of this method, the original shape will cease to show the subset range, and getSubsetShape() will return a valid shape.

Definition at line 89 of file shapesubset.cxx.

References slideshow::internal::DocTreeNode::isEmpty(), maTreeNode, mpOriginalShape, mpShapeManager, and mpSubsetShape.

◆ getSubset()

const DocTreeNode & slideshow::internal::ShapeSubset::getSubset ( ) const

Query subset this object represents.

Definition at line 115 of file shapesubset.cxx.

References maTreeNode.

◆ getSubsetShape()

AttributableShapeSharedPtr const & slideshow::internal::ShapeSubset::getSubsetShape ( ) const

Get the actual subset shape.

If the subset is currently revoked, this method returns the original shape.

Definition at line 84 of file shapesubset.cxx.

References mpOriginalShape, and mpSubsetShape.

◆ isFullSet()

bool slideshow::internal::ShapeSubset::isFullSet ( ) const

Query whether this subset actually is none, but contains the whole original shape's content.

Definition at line 110 of file shapesubset.cxx.

References slideshow::internal::DocTreeNode::isEmpty(), and maTreeNode.

◆ operator=()

void slideshow::internal::ShapeSubset::operator= ( ShapeSubset const &  )
delete

Member Data Documentation

◆ maTreeNode

DocTreeNode slideshow::internal::ShapeSubset::maTreeNode
private

Definition at line 137 of file shapesubset.hxx.

Referenced by enableSubsetShape(), getSubset(), and isFullSet().

◆ mpOriginalShape

AttributableShapeSharedPtr slideshow::internal::ShapeSubset::mpOriginalShape
private

Definition at line 135 of file shapesubset.hxx.

Referenced by disableSubsetShape(), enableSubsetShape(), and getSubsetShape().

◆ mpShapeManager

SubsettableShapeManagerSharedPtr slideshow::internal::ShapeSubset::mpShapeManager
private

Definition at line 138 of file shapesubset.hxx.

Referenced by disableSubsetShape(), enableSubsetShape(), and ShapeSubset().

◆ mpSubsetShape

AttributableShapeSharedPtr slideshow::internal::ShapeSubset::mpSubsetShape
private

Definition at line 136 of file shapesubset.hxx.

Referenced by disableSubsetShape(), enableSubsetShape(), and getSubsetShape().


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