LibreOffice Module svgio (master) 1
Public Member Functions | Private Types | Private Attributes | List of all members
svgio::svgreader::SvgDocument Class Reference

#include <svgdocument.hxx>

Public Member Functions

 SvgDocument (OUString aAbsolutePath)
 
 ~SvgDocument ()
 
 SvgDocument (const SvgDocument &)=delete
 
SvgDocumentoperator= (const SvgDocument &)=delete
 
void appendNode (std::unique_ptr< SvgNode > pNode)
 append another root node, ownership changes More...
 
void addSvgNodeToMapper (const OUString &rStr, const SvgNode &rNode)
 add/remove nodes with Id to mapper More...
 
void removeSvgNodeFromMapper (const OUString &rStr)
 
const SvgNodefindSvgNodeById (const OUString &rStr) const
 find a node by its Id More...
 
void addSvgStyleAttributesToMapper (const OUString &rStr, const SvgStyleAttributes &rSvgStyleAttributes)
 add/remove styles to mapper More...
 
bool hasGlobalCssStyleAttributes () const
 find a style by its Id More...
 
const SvgStyleAttributesfindGlobalCssStyleAttributes (const OUString &rStr) const
 
const SvgNodeVectorgetSvgNodeVector () const
 data read access More...
 
const OUString & getAbsolutePath () const
 
void addOrphanNode (SvgNode *pOrphan)
 invalid nodes that have no parent More...
 

Private Types

typedef std::unordered_map< OUString, const SvgNode * > IdTokenMapper
 hash mapper to find nodes by their id More...
 
typedef std::unordered_map< OUString, const SvgStyleAttributes * > IdStyleTokenMapper
 hash mapper to find css styles by their id More...
 

Private Attributes

SvgNodeVector maNodes
 the document hierarchy with all root nodes More...
 
SvgNodeVector maOrphanNodes
 invalid nodes that have no parent More...
 
const OUString maAbsolutePath
 the absolute path of the Svg file in progress (if available) More...
 
IdTokenMapper maIdTokenMapperList
 
IdStyleTokenMapper maIdStyleTokenMapperList
 

Detailed Description

Definition at line 31 of file svgdocument.hxx.

Member Typedef Documentation

◆ IdStyleTokenMapper

typedef std::unordered_map< OUString, const SvgStyleAttributes* > svgio::svgreader::SvgDocument::IdStyleTokenMapper
private

hash mapper to find css styles by their id

Definition at line 48 of file svgdocument.hxx.

◆ IdTokenMapper

typedef std::unordered_map< OUString, const SvgNode* > svgio::svgreader::SvgDocument::IdTokenMapper
private

hash mapper to find nodes by their id

Definition at line 44 of file svgdocument.hxx.

Constructor & Destructor Documentation

◆ SvgDocument() [1/2]

svgio::svgreader::SvgDocument::SvgDocument ( OUString  aAbsolutePath)
explicit

Definition at line 25 of file svgdocument.cxx.

◆ ~SvgDocument()

svgio::svgreader::SvgDocument::~SvgDocument ( )

Definition at line 30 of file svgdocument.cxx.

◆ SvgDocument() [2/2]

svgio::svgreader::SvgDocument::SvgDocument ( const SvgDocument )
delete

Member Function Documentation

◆ addOrphanNode()

void svgio::svgreader::SvgDocument::addOrphanNode ( SvgNode pOrphan)
inline

invalid nodes that have no parent

Definition at line 80 of file svgdocument.hxx.

References maOrphanNodes.

Referenced by svgio::svgreader::SvgNode::SvgNode().

◆ addSvgNodeToMapper()

void svgio::svgreader::SvgDocument::addSvgNodeToMapper ( const OUString &  rStr,
const SvgNode rNode 
)

add/remove nodes with Id to mapper

Definition at line 40 of file svgdocument.cxx.

References maIdTokenMapperList.

Referenced by svgio::svgreader::SvgNode::setClass(), and svgio::svgreader::SvgNode::setId().

◆ addSvgStyleAttributesToMapper()

void svgio::svgreader::SvgDocument::addSvgStyleAttributesToMapper ( const OUString &  rStr,
const SvgStyleAttributes rSvgStyleAttributes 
)

add/remove styles to mapper

Definition at line 70 of file svgdocument.cxx.

References maIdStyleTokenMapperList.

◆ appendNode()

void svgio::svgreader::SvgDocument::appendNode ( std::unique_ptr< SvgNode pNode)

append another root node, ownership changes

Definition at line 34 of file svgdocument.cxx.

References maNodes.

Referenced by svgio::svgreader::SvgDocHdl::endElement().

◆ findGlobalCssStyleAttributes()

const SvgStyleAttributes * svgio::svgreader::SvgDocument::findGlobalCssStyleAttributes ( const OUString &  rStr) const

◆ findSvgNodeById()

const SvgNode * svgio::svgreader::SvgDocument::findSvgNodeById ( const OUString &  rStr) const

◆ getAbsolutePath()

const OUString & svgio::svgreader::SvgDocument::getAbsolutePath ( ) const
inline

◆ getSvgNodeVector()

const SvgNodeVector & svgio::svgreader::SvgDocument::getSvgNodeVector ( ) const
inline

data read access

Definition at line 76 of file svgdocument.hxx.

References maNodes.

Referenced by svgio::svgreader::SvgDocHdl::~SvgDocHdl().

◆ hasGlobalCssStyleAttributes()

bool svgio::svgreader::SvgDocument::hasGlobalCssStyleAttributes ( ) const
inline

◆ operator=()

SvgDocument & svgio::svgreader::SvgDocument::operator= ( const SvgDocument )
delete

◆ removeSvgNodeFromMapper()

void svgio::svgreader::SvgDocument::removeSvgNodeFromMapper ( const OUString &  rStr)

Member Data Documentation

◆ maAbsolutePath

const OUString svgio::svgreader::SvgDocument::maAbsolutePath
private

the absolute path of the Svg file in progress (if available)

Definition at line 41 of file svgdocument.hxx.

Referenced by getAbsolutePath().

◆ maIdStyleTokenMapperList

IdStyleTokenMapper svgio::svgreader::SvgDocument::maIdStyleTokenMapperList
private

◆ maIdTokenMapperList

IdTokenMapper svgio::svgreader::SvgDocument::maIdTokenMapperList
private

Definition at line 45 of file svgdocument.hxx.

Referenced by addSvgNodeToMapper(), findSvgNodeById(), and removeSvgNodeFromMapper().

◆ maNodes

SvgNodeVector svgio::svgreader::SvgDocument::maNodes
private

the document hierarchy with all root nodes

Definition at line 35 of file svgdocument.hxx.

Referenced by appendNode(), and getSvgNodeVector().

◆ maOrphanNodes

SvgNodeVector svgio::svgreader::SvgDocument::maOrphanNodes
private

invalid nodes that have no parent

Definition at line 38 of file svgdocument.hxx.

Referenced by addOrphanNode().


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