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

This class encapsulates the subsetting aspects of a DrawShape. More...

#include <drawshapesubsetting.hxx>

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

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< IndexClassificatorIndexClassificatorVector
 

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...
 
DrawShapeSubsettingoperator= (const DrawShapeSubsetting &)=delete
 Forbid copy assignment. More...
 
void reset (const ::std::shared_ptr< GDIMetaFile > &rMtf)
 Reset metafile. More...
 
const DocTreeNodegetSubsetNode () 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 VectorOfDocTreeNodesgetActiveSubsets () const
 Return a vector of currently active subsets. More...
 

Private Types

typedef ::std::set< SubsetEntryShapeSet
 

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< GDIMetaFilempMtf
 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...
 

Detailed Description

This class encapsulates the subsetting aspects of a DrawShape.

Definition at line 35 of file drawshapesubsetting.hxx.

Member Typedef Documentation

◆ IndexClassificatorVector

Definition at line 165 of file drawshapesubsetting.hxx.

◆ ShapeSet

Definition at line 201 of file drawshapesubsetting.hxx.

Member Enumeration Documentation

◆ IndexClassificator

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.

Constructor & Destructor Documentation

◆ DrawShapeSubsetting() [1/3]

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.

Parameters
rMtfMetafile to retrieve subset info from (must have been generated with verbose text comments switched on).

Definition at line 249 of file drawshapesubsetting.cxx.

◆ DrawShapeSubsetting() [2/3]

slideshow::internal::DrawShapeSubsetting::DrawShapeSubsetting ( const DocTreeNode rShapeSubset,
GDIMetaFileSharedPtr  rMtf 
)

Create new shape subset handling.

Parameters
rShapeSubsetThe subset this object represents (can be empty, then denoting 'represents a whole shape')
rMtfMetafile 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.

◆ DrawShapeSubsetting() [3/3]

slideshow::internal::DrawShapeSubsetting::DrawShapeSubsetting ( const DrawShapeSubsetting )
delete

Forbid copy construction.

Member Function Documentation

◆ addSubsetShape()

void slideshow::internal::DrawShapeSubsetting::addSubsetShape ( const AttributableShapeSharedPtr rShape)

◆ ensureInitializedNodeTree()

void slideshow::internal::DrawShapeSubsetting::ensureInitializedNodeTree ( ) const
private

◆ excludeSubset()

void slideshow::internal::DrawShapeSubsetting::excludeSubset ( sal_Int32  nExcludedStart,
sal_Int32  nExcludedEnd 
)
private

◆ getActiveSubsets()

const VectorOfDocTreeNodes & slideshow::internal::DrawShapeSubsetting::getActiveSubsets ( ) const
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().

◆ getNumberOfSubsetTreeNodes()

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

◆ getNumberOfTreeNodes()

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.

◆ getSubsetNode()

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

◆ getSubsetShape()

AttributableShapeSharedPtr slideshow::internal::DrawShapeSubsetting::getSubsetShape ( const DocTreeNode rTreeNode) const

◆ getSubsetTreeNode()

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.

◆ getTreeNode()

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.

◆ implGetNumberOfTreeNodes()

sal_Int32 slideshow::internal::DrawShapeSubsetting::implGetNumberOfTreeNodes ( const IndexClassificatorVector::const_iterator &  rBegin,
const IndexClassificatorVector::const_iterator &  rEnd,
DocTreeNode::NodeType  eNodeType 
)
staticprivate

Definition at line 658 of file drawshapesubsetting.cxx.

Referenced by getNumberOfSubsetTreeNodes(), and getNumberOfTreeNodes().

◆ implGetTreeNode()

DocTreeNode slideshow::internal::DrawShapeSubsetting::implGetTreeNode ( const IndexClassificatorVector::const_iterator &  rBegin,
const IndexClassificatorVector::const_iterator &  rEnd,
sal_Int32  nNodeIndex,
DocTreeNode::NodeType  eNodeType 
) const
private

Definition at line 745 of file drawshapesubsetting.cxx.

References maActionClassVector.

Referenced by getSubsetTreeNode(), and getTreeNode().

◆ initCurrentSubsets()

void slideshow::internal::DrawShapeSubsetting::initCurrentSubsets ( )
private

◆ operator=()

DrawShapeSubsetting & slideshow::internal::DrawShapeSubsetting::operator= ( const DrawShapeSubsetting )
delete

Forbid copy assignment.

◆ reset() [1/2]

void slideshow::internal::DrawShapeSubsetting::reset ( )
private

◆ reset() [2/2]

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!

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

◆ revokeSubsetShape()

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.

Returns
true, if the subset shape was physically removed from the list (false is returned, when nothing was removed, either because only the use count was decremented, or there was no such subset found, in the first place).

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

◆ updateSubsets()

void slideshow::internal::DrawShapeSubsetting::updateSubsets ( )
private

Member Data Documentation

◆ maActionClassVector

IndexClassificatorVector slideshow::internal::DrawShapeSubsetting::maActionClassVector
mutableprivate

◆ maCurrentSubsets

VectorOfDocTreeNodes slideshow::internal::DrawShapeSubsetting::maCurrentSubsets
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().

◆ maSubset

DocTreeNode slideshow::internal::DrawShapeSubsetting::maSubset
private

Subset of the metafile represented by this object.

Definition at line 223 of file drawshapesubsetting.hxx.

Referenced by excludeSubset(), getSubsetNode(), initCurrentSubsets(), and reset().

◆ maSubsetShapes

ShapeSet slideshow::internal::DrawShapeSubsetting::maSubsetShapes
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().

◆ mbNodeTreeInitialized

bool slideshow::internal::DrawShapeSubsetting::mbNodeTreeInitialized
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().

◆ mpMtf

::std::shared_ptr< GDIMetaFile > slideshow::internal::DrawShapeSubsetting::mpMtf
private

Metafile to retrieve subset info from.

Definition at line 220 of file drawshapesubsetting.hxx.

Referenced by DrawShapeSubsetting(), ensureInitializedNodeTree(), and reset().


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