LibreOffice Module slideshow (master) 1
|
This class encapsulates the subsetting aspects of a DrawShape. More...
#include <drawshapesubsetting.hxx>
Classes | |
struct | SubsetEntry |
Entry for subset shape. More... | |
Public Types | |
enum | IndexClassificator { CLASS_NOOP , CLASS_SHAPE_START , CLASS_SHAPE_END , CLASS_LINE_END , CLASS_PARAGRAPH_END , CLASS_SENTENCE_END , CLASS_WORD_END , CLASS_CHARACTER_CELL_END } |
This enum classifies each action index in the metafile. More... | |
typedef ::std::vector< IndexClassificator > | IndexClassificatorVector |
Public Member Functions | |
DrawShapeSubsetting () | |
Create empty shape subset handling. More... | |
DrawShapeSubsetting (const DocTreeNode &rShapeSubset, GDIMetaFileSharedPtr rMtf) | |
Create new shape subset handling. More... | |
DrawShapeSubsetting (const DrawShapeSubsetting &)=delete | |
Forbid copy construction. More... | |
DrawShapeSubsetting & | operator= (const DrawShapeSubsetting &)=delete |
Forbid copy assignment. More... | |
void | reset (const ::std::shared_ptr< GDIMetaFile > &rMtf) |
Reset metafile. More... | |
const DocTreeNode & | getSubsetNode () const |
Return subset node for this shape. More... | |
AttributableShapeSharedPtr | getSubsetShape (const DocTreeNode &rTreeNode) const |
Get subset shape for given node, if any. More... | |
void | addSubsetShape (const AttributableShapeSharedPtr &rShape) |
Add child subset shape (or increase use count, if already existent) More... | |
bool | revokeSubsetShape (const AttributableShapeSharedPtr &rShape) |
Revoke subset shape. More... | |
sal_Int32 | getNumberOfTreeNodes (DocTreeNode::NodeType eNodeType) const |
Return overall number of nodes for given type. More... | |
DocTreeNode | getTreeNode (sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType) const |
Return tree node of given index and given type. More... | |
sal_Int32 | getNumberOfSubsetTreeNodes (const DocTreeNode &rParentNode, DocTreeNode::NodeType eNodeType) const |
Return number of nodes of given type, below parent node. More... | |
DocTreeNode | getSubsetTreeNode (const DocTreeNode &rParentNode, sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType) const |
Return tree node of given index and given type, relative to parent node. More... | |
const VectorOfDocTreeNodes & | getActiveSubsets () const |
Return a vector of currently active subsets. More... | |
Private Types | |
typedef ::std::set< SubsetEntry > | ShapeSet |
Private Member Functions | |
void | ensureInitializedNodeTree () const |
void | excludeSubset (sal_Int32 nExcludedStart, sal_Int32 nExcludedEnd) |
void | updateSubsets () |
void | initCurrentSubsets () |
void | reset () |
DocTreeNode | implGetTreeNode (const IndexClassificatorVector::const_iterator &rBegin, const IndexClassificatorVector::const_iterator &rEnd, sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType) const |
Static Private Member Functions | |
static sal_Int32 | implGetNumberOfTreeNodes (const IndexClassificatorVector::const_iterator &rBegin, const IndexClassificatorVector::const_iterator &rEnd, DocTreeNode::NodeType eNodeType) |
Private Attributes | |
IndexClassificatorVector | maActionClassVector |
::std::shared_ptr< GDIMetaFile > | mpMtf |
Metafile to retrieve subset info from. More... | |
DocTreeNode | maSubset |
Subset of the metafile represented by this object. More... | |
ShapeSet | maSubsetShapes |
the list of subset shapes spawned from this one. More... | |
VectorOfDocTreeNodes | maCurrentSubsets |
Current number of subsets to render (calculated from maSubset and mnMin/MaxSubsetActionIndex). More... | |
bool | mbNodeTreeInitialized |
Whether the shape's doc tree has been initialized successfully, or not. More... | |
This class encapsulates the subsetting aspects of a DrawShape.
Definition at line 35 of file drawshapesubsetting.hxx.
typedef ::std::vector< IndexClassificator > slideshow::internal::DrawShapeSubsetting::IndexClassificatorVector |
Definition at line 165 of file drawshapesubsetting.hxx.
|
private |
Definition at line 201 of file drawshapesubsetting.hxx.
This enum classifies each action index in the metafile.
Of interest are, of course, the places where structural shape and/or text elements end. The remainder of the action gets classified as 'noop'
Enumerator | |
---|---|
CLASS_NOOP | |
CLASS_SHAPE_START | |
CLASS_SHAPE_END | |
CLASS_LINE_END | |
CLASS_PARAGRAPH_END | |
CLASS_SENTENCE_END | |
CLASS_WORD_END | |
CLASS_CHARACTER_CELL_END |
Definition at line 152 of file drawshapesubsetting.hxx.
slideshow::internal::DrawShapeSubsetting::DrawShapeSubsetting | ( | ) |
Create empty shape subset handling.
This method creates a subset handler which contains no subset information. All methods will return default values.
rMtf | Metafile to retrieve subset info from (must have been generated with verbose text comments switched on). |
Definition at line 249 of file drawshapesubsetting.cxx.
slideshow::internal::DrawShapeSubsetting::DrawShapeSubsetting | ( | const DocTreeNode & | rShapeSubset, |
GDIMetaFileSharedPtr | rMtf | ||
) |
Create new shape subset handling.
rShapeSubset | The subset this object represents (can be empty, then denoting 'represents a whole shape') |
rMtf | Metafile to retrieve subset info from (must have been generated with verbose text comments switched on). |
Definition at line 259 of file drawshapesubsetting.cxx.
References ENSURE_OR_THROW, initCurrentSubsets(), and mpMtf.
|
delete |
Forbid copy construction.
void slideshow::internal::DrawShapeSubsetting::addSubsetShape | ( | const AttributableShapeSharedPtr & | rShape | ) |
Add child subset shape (or increase use count, if already existent)
Definition at line 326 of file drawshapesubsetting.cxx.
References excludeSubset(), slideshow::internal::DocTreeNode::getEndIndex(), slideshow::internal::DocTreeNode::getStartIndex(), maSubsetShapes, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mnEndActionIndex, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mnStartActionIndex, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mnSubsetQueriedCount, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mpShape, and SAL_INFO.
Referenced by slideshow::internal::DrawShape::createSubset().
|
private |
Definition at line 45 of file drawshapesubsetting.cxx.
References CLASS_CHARACTER_CELL_END, CLASS_LINE_END, CLASS_NOOP, CLASS_PARAGRAPH_END, CLASS_SENTENCE_END, CLASS_SHAPE_END, CLASS_SHAPE_START, CLASS_WORD_END, ENSURE_OR_THROW, MetaCommentAction::GetComment(), slideshow::internal::getNextActionOffset(), MetaAction::GetType(), MetaCommentAction::GetValue(), maActionClassVector, o3tl::make_unsigned(), mbNodeTreeInitialized, mpMtf, nIndex, and SAL_INFO.
Referenced by getNumberOfSubsetTreeNodes(), getNumberOfTreeNodes(), getSubsetTreeNode(), and getTreeNode().
|
private |
Definition at line 164 of file drawshapesubsetting.cxx.
References slideshow::internal::DocTreeNode::getEndIndex(), slideshow::internal::DocTreeNode::getStartIndex(), i, initCurrentSubsets(), slideshow::internal::DocTreeNode::isEmpty(), maActionClassVector, maCurrentSubsets, and maSubset.
Referenced by addSubsetShape(), and updateSubsets().
|
inline |
Return a vector of currently active subsets.
Needed when rendering a shape, this method provides a vector of subsets currently visible (the range as returned by getEffectiveSubset(), minus the parts that are currently hidden, because displayed by child shapes).
Definition at line 143 of file drawshapesubsetting.hxx.
References maCurrentSubsets.
Referenced by slideshow::internal::DrawShape::getActualUnitShapeBounds(), and slideshow::internal::DrawShape::getViewRenderArgs().
sal_Int32 slideshow::internal::DrawShapeSubsetting::getNumberOfSubsetTreeNodes | ( | const DocTreeNode & | rParentNode, |
DocTreeNode::NodeType | eNodeType | ||
) | const |
Return number of nodes of given type, below parent node.
Definition at line 781 of file drawshapesubsetting.cxx.
References ensureInitializedNodeTree(), slideshow::internal::DocTreeNode::getEndIndex(), slideshow::internal::DocTreeNode::getStartIndex(), implGetNumberOfTreeNodes(), and maActionClassVector.
sal_Int32 slideshow::internal::DrawShapeSubsetting::getNumberOfTreeNodes | ( | DocTreeNode::NodeType | eNodeType | ) | const |
Return overall number of nodes for given type.
Definition at line 675 of file drawshapesubsetting.cxx.
References ensureInitializedNodeTree(), implGetNumberOfTreeNodes(), and maActionClassVector.
const DocTreeNode & slideshow::internal::DrawShapeSubsetting::getSubsetNode | ( | ) | const |
Return subset node for this shape.
Definition at line 301 of file drawshapesubsetting.cxx.
References maSubset.
Referenced by slideshow::internal::DrawShape::getSubsetNode().
AttributableShapeSharedPtr slideshow::internal::DrawShapeSubsetting::getSubsetShape | ( | const DocTreeNode & | rTreeNode | ) | const |
Get subset shape for given node, if any.
Definition at line 306 of file drawshapesubsetting.cxx.
References slideshow::internal::DocTreeNode::getEndIndex(), slideshow::internal::DocTreeNode::getStartIndex(), maSubsetShapes, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mnEndActionIndex, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mnStartActionIndex, and SAL_INFO.
Referenced by slideshow::internal::DrawShape::createSubset(), and slideshow::internal::DrawShape::getSubset().
DocTreeNode slideshow::internal::DrawShapeSubsetting::getSubsetTreeNode | ( | const DocTreeNode & | rParentNode, |
sal_Int32 | nNodeIndex, | ||
DocTreeNode::NodeType | eNodeType | ||
) | const |
Return tree node of given index and given type, relative to parent node.
Definition at line 796 of file drawshapesubsetting.cxx.
References ensureInitializedNodeTree(), slideshow::internal::DocTreeNode::getEndIndex(), slideshow::internal::DocTreeNode::getStartIndex(), implGetTreeNode(), and maActionClassVector.
DocTreeNode slideshow::internal::DrawShapeSubsetting::getTreeNode | ( | sal_Int32 | nNodeIndex, |
DocTreeNode::NodeType | eNodeType | ||
) | const |
Return tree node of given index and given type.
Definition at line 770 of file drawshapesubsetting.cxx.
References ensureInitializedNodeTree(), implGetTreeNode(), and maActionClassVector.
|
staticprivate |
Definition at line 658 of file drawshapesubsetting.cxx.
Referenced by getNumberOfSubsetTreeNodes(), and getNumberOfTreeNodes().
|
private |
Definition at line 745 of file drawshapesubsetting.cxx.
References maActionClassVector.
Referenced by getSubsetTreeNode(), and getTreeNode().
|
private |
Definition at line 292 of file drawshapesubsetting.cxx.
References slideshow::internal::DocTreeNode::isEmpty(), maCurrentSubsets, and maSubset.
Referenced by DrawShapeSubsetting(), excludeSubset(), reset(), and updateSubsets().
|
delete |
Forbid copy assignment.
|
private |
Definition at line 274 of file drawshapesubsetting.cxx.
References maActionClassVector, maCurrentSubsets, maSubset, maSubsetShapes, mbNodeTreeInitialized, mpMtf, and slideshow::internal::DocTreeNode::reset().
Referenced by reset().
void slideshow::internal::DrawShapeSubsetting::reset | ( | const ::std::shared_ptr< GDIMetaFile > & | rMtf | ) |
Reset metafile.
Use this method to completely reset the ShapeSubsetting, with a new metafile. Note that any information previously set will be lost, including added subset shapes!
rMtf | Metafile to retrieve subset info from (must have been generated with verbose text comments switched on). |
Definition at line 284 of file drawshapesubsetting.cxx.
References initCurrentSubsets(), mpMtf, and reset().
Referenced by slideshow::internal::DrawShape::forceScrollTextMetaFile().
bool slideshow::internal::DrawShapeSubsetting::revokeSubsetShape | ( | const AttributableShapeSharedPtr & | rShape | ) |
Revoke subset shape.
This method revokes a subset shape, decrementing the use count for this subset by one. If the use count reaches zero (i.e. when the number of addSubsetShape() matches the number of revokeSubsetShape() calls for the same subset), the subset entry is removed from the internal list, and subsequent getSubsetShape() calls will return the empty pointer for this subset.
Definition at line 358 of file drawshapesubsetting.cxx.
References slideshow::internal::DocTreeNode::getEndIndex(), slideshow::internal::DocTreeNode::getStartIndex(), maSubsetShapes, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mnEndActionIndex, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mnStartActionIndex, slideshow::internal::DrawShapeSubsetting::SubsetEntry::mnSubsetQueriedCount, SAL_INFO, and updateSubsets().
Referenced by slideshow::internal::DrawShape::revokeSubset().
|
private |
Definition at line 234 of file drawshapesubsetting.cxx.
References excludeSubset(), initCurrentSubsets(), maCurrentSubsets, and maSubsetShapes.
Referenced by revokeSubsetShape().
|
mutableprivate |
Definition at line 217 of file drawshapesubsetting.hxx.
Referenced by ensureInitializedNodeTree(), excludeSubset(), getNumberOfSubsetTreeNodes(), getNumberOfTreeNodes(), getSubsetTreeNode(), getTreeNode(), implGetTreeNode(), and reset().
|
mutableprivate |
Current number of subsets to render (calculated from maSubset and mnMin/MaxSubsetActionIndex).
Note that this is generally not equivalent to maSubset, as it excludes all active subset children!
Definition at line 234 of file drawshapesubsetting.hxx.
Referenced by excludeSubset(), getActiveSubsets(), initCurrentSubsets(), reset(), and updateSubsets().
|
private |
Subset of the metafile represented by this object.
Definition at line 223 of file drawshapesubsetting.hxx.
Referenced by excludeSubset(), getSubsetNode(), initCurrentSubsets(), and reset().
|
private |
the list of subset shapes spawned from this one.
Definition at line 226 of file drawshapesubsetting.hxx.
Referenced by addSubsetShape(), getSubsetShape(), reset(), revokeSubsetShape(), and updateSubsets().
|
mutableprivate |
Whether the shape's doc tree has been initialized successfully, or not.
Definition at line 237 of file drawshapesubsetting.hxx.
Referenced by ensureInitializedNodeTree(), and reset().
|
private |
Metafile to retrieve subset info from.
Definition at line 220 of file drawshapesubsetting.hxx.
Referenced by DrawShapeSubsetting(), ensureInitializedNodeTree(), and reset().