LibreOffice Module slideshow (master) 1
|
Subset RAII wrapper for shapes. More...
#include <shapesubset.hxx>
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 DocTreeNode & | getSubset () const |
Query subset this object represents. More... | |
Private Attributes | |
AttributableShapeSharedPtr | mpOriginalShape |
AttributableShapeSharedPtr | mpSubsetShape |
DocTreeNode | maTreeNode |
SubsettableShapeManagerSharedPtr | mpShapeManager |
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.
slideshow::internal::ShapeSubset::ShapeSubset | ( | AttributableShapeSharedPtr | xOriginalShape, |
const DocTreeNode & | rTreeNode, | ||
SubsettableShapeManagerSharedPtr | xSubsetManager | ||
) |
Create a subset directly from a Shape.
rOriginalShape | Original shape to subset |
rTreeNode | Subset this object should represent |
rShapeManager | Manager object, where subsets are registered/unregistered |
Definition at line 31 of file shapesubset.cxx.
References ENSURE_OR_THROW, and mpShapeManager.
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)
rOriginalSubset | Original subset, which to subset again. |
rTreeNode | Subset 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.
slideshow::internal::ShapeSubset::ShapeSubset | ( | AttributableShapeSharedPtr | xOriginalShape, |
SubsettableShapeManagerSharedPtr | xShapeManager | ||
) |
Create full set for the given shape.
rOriginalShape | Original 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.
slideshow::internal::ShapeSubset::~ShapeSubset | ( | ) |
Definition at line 71 of file shapesubset.cxx.
References disableSubsetShape(), and TOOLS_WARN_EXCEPTION.
|
default |
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().
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.
const DocTreeNode & slideshow::internal::ShapeSubset::getSubset | ( | ) | const |
Query subset this object represents.
Definition at line 115 of file shapesubset.cxx.
References maTreeNode.
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.
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.
|
delete |
|
private |
Definition at line 137 of file shapesubset.hxx.
Referenced by enableSubsetShape(), getSubset(), and isFullSet().
|
private |
Definition at line 135 of file shapesubset.hxx.
Referenced by disableSubsetShape(), enableSubsetShape(), and getSubsetShape().
|
private |
Definition at line 138 of file shapesubset.hxx.
Referenced by disableSubsetShape(), enableSubsetShape(), and ShapeSubset().
|
private |
Definition at line 136 of file shapesubset.hxx.
Referenced by disableSubsetShape(), enableSubsetShape(), and getSubsetShape().