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

#include <svgnode.hxx>

Inheritance diagram for svgio::svgreader::SvgNode:
[legend]
Collaboration diagram for svgio::svgreader::SvgNode:
[legend]

Public Member Functions

 SvgNode (SVGToken aType, SvgDocument &rDocument, SvgNode *pParent)
 
virtual ~SvgNode () override
 
 SvgNode (const SvgNode &)=delete
 
SvgNodeoperator= (const SvgNode &)=delete
 
void accept (Visitor &rVisitor)
 
void readLocalCssStyle (std::u16string_view aContent)
 scan helper to read and interpret a local CssStyle to mpLocalCssStyle More...
 
void parseAttributes (const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs)
 style helpers More...
 
virtual const SvgStyleAttributesgetSvgStyleAttributes () const
 
virtual void parseAttribute (const OUString &rTokenName, SVGToken aSVGToken, const OUString &aContent)
 
virtual void decomposeSvgNode (drawinglayer::primitive2d::Primitive2DContainer &rTarget, bool bReferenced) const
 
virtual bool supportsParentStyle () const
 #i125258# tell if this node is allowed to have a parent style (e.g. defs do not) More...
 
SVGToken getType () const
 basic data read access More...
 
const SvgDocumentgetDocument () const
 
const SvgNodegetParent () const
 
const std::vector< std::unique_ptr< SvgNode > > & getChildren () const
 
virtual basegfx::B2DRange getCurrentViewPort () const override
 InfoProvider support for %, em and ex values. More...
 
virtual double getCurrentFontSizeInherited () const override
 return font size of node inherited from parents More...
 
virtual double getCurrentXHeightInherited () const override
 return xheight of node inherited from parents More...
 
double getCurrentFontSize () const
 
double getCurrentXHeight () const
 
std::optional< OUString > const & getId () const
 Id access. More...
 
void setId (OUString const &)
 
std::optional< OUString > const & getClass () const
 Class access. More...
 
void setClass (OUString const &)
 
XmlSpace getXmlSpace () const
 XmlSpace access. More...
 
void setXmlSpace (XmlSpace eXmlSpace)
 
Display getDisplay () const
 Display access #i121656#. More...
 
void setDisplay (Display eDisplay)
 
void setAlternativeParent (const SvgNode *pAlternativeParent=nullptr)
 alternative parent More...
 
bool hasLocalCssStyle ()
 Check if there is a local css style. More...
 
- Public Member Functions inherited from svgio::svgreader::InfoProvider
virtual ~InfoProvider ()
 
virtual basegfx::B2DRange getCurrentViewPort () const =0
 
virtual double getCurrentFontSizeInherited () const =0
 return font size of node inherited from parents More...
 
virtual double getCurrentXHeightInherited () const =0
 return xheight of node inherited from parents More...
 

Protected Member Functions

const SvgStyleAttributescheckForCssStyle (const SvgStyleAttributes &rOriginal) const
 helper to evtl. link to css style More...
 
void fillCssStyleVector (const SvgStyleAttributes &rOriginal)
 helper for filling the CssStyle vector once dependent on mbCssStyleVectorBuilt More...
 
void addCssStyle (const SvgDocument &rDocument, const OUString &aConcatenated)
 
void fillCssStyleVectorUsingHierarchyAndSelectors (const SvgNode &rCurrent, const OUString &aConcatenated)
 
void fillCssStyleVectorUsingParent (const SvgNode &rCurrent)
 

Private Attributes

SVGToken maType
 basic data, Type, document we belong to and parent (if not root) More...
 
SvgDocumentmrDocument
 
const SvgNodempParent
 
const SvgNodempAlternativeParent
 
std::vector< std::unique_ptr< SvgNode > > maChildren
 sub hierarchy More...
 
std::optional< OUString > mpId
 Id svan value. More...
 
std::optional< OUString > mpClass
 Class svan value. More...
 
XmlSpace maXmlSpace
 XmlSpace value. More...
 
Display maDisplay
 Display value #i121656#. More...
 
::std::vector< const SvgStyleAttributes * > maCssStyleVector
 
std::unique_ptr< SvgStyleAttributesmpLocalCssStyle
 possible local CssStyle, e.g. style="fill:red; stroke:red;" More...
 
bool mbDecomposing
 
bool mbCssStyleVectorBuilt: 1
 

Detailed Description

Definition at line 80 of file svgnode.hxx.

Constructor & Destructor Documentation

◆ SvgNode() [1/2]

svgio::svgreader::SvgNode::SvgNode ( SVGToken  aType,
SvgDocument rDocument,
SvgNode pParent 
)

◆ ~SvgNode()

svgio::svgreader::SvgNode::~SvgNode ( )
overridevirtual

Definition at line 408 of file svgnode.cxx.

◆ SvgNode() [2/2]

svgio::svgreader::SvgNode::SvgNode ( const SvgNode )
delete

Member Function Documentation

◆ accept()

void svgio::svgreader::SvgNode::accept ( Visitor rVisitor)

Definition at line 795 of file svgnode.cxx.

References svgio::svgreader::Visitor::visit().

◆ addCssStyle()

void svgio::svgreader::SvgNode::addCssStyle ( const SvgDocument rDocument,
const OUString &  aConcatenated 
)
protected

◆ checkForCssStyle()

const SvgStyleAttributes * svgio::svgreader::SvgNode::checkForCssStyle ( const SvgStyleAttributes rOriginal) const
protected

◆ decomposeSvgNode()

void svgio::svgreader::SvgNode::decomposeSvgNode ( drawinglayer::primitive2d::Primitive2DContainer rTarget,
bool  bReferenced 
) const
virtual

Reimplemented in svgio::svgreader::SvgANode, svgio::svgreader::SvgCircleNode, svgio::svgreader::SvgClipPathNode, svgio::svgreader::SvgEllipseNode, svgio::svgreader::SvgGNode, svgio::svgreader::SvgImageNode, svgio::svgreader::SvgLineNode, svgio::svgreader::SvgMaskNode, svgio::svgreader::SvgPathNode, svgio::svgreader::SvgPolyNode, svgio::svgreader::SvgRectNode, svgio::svgreader::SvgSvgNode, svgio::svgreader::SvgTextNode, and svgio::svgreader::SvgUseNode.

Definition at line 584 of file svgnode.cxx.

References a, aURL, svgio::svgreader::ClipPathNode, decomposeSvgNode(), svgio::svgreader::Defs, svgio::svgreader::SvgDocument::getAbsolutePath(), getChildren(), svgio::svgreader::SvgStyleAttributes::getDesc(), getDisplay(), getDocument(), getSvgStyleAttributes(), svgio::svgreader::SvgStyleAttributes::getTitle(), getType(), svgio::svgreader::SvgStyleAttributes::getVisibility(), INetURLObject::LAST_SEGMENT, svgio::svgreader::Marker, svgio::svgreader::Mask, mbDecomposing, nCount, svgio::svgreader::None, svgio::svgreader::Pattern, rTarget, svgio::svgreader::Svg, svgio::svgreader::Symbol, svgio::svgreader::visible, and INetURLObject::WithCharset.

Referenced by decomposeSvgNode(), svgio::svgreader::SvgANode::decomposeSvgNode(), svgio::svgreader::SvgClipPathNode::decomposeSvgNode(), svgio::svgreader::SvgGNode::decomposeSvgNode(), svgio::svgreader::SvgImageNode::decomposeSvgNode(), svgio::svgreader::SvgMaskNode::decomposeSvgNode(), svgio::svgreader::SvgSvgNode::decomposeSvgNode(), svgio::svgreader::SvgUseNode::decomposeSvgNode(), svgio::svgreader::SvgMarkerNode::getMarkerPrimitives(), and svgio::svgreader::SvgPatternNode::getPatternPrimitives().

◆ fillCssStyleVector()

void svgio::svgreader::SvgNode::fillCssStyleVector ( const SvgStyleAttributes rOriginal)
protected

◆ fillCssStyleVectorUsingHierarchyAndSelectors()

void svgio::svgreader::SvgNode::fillCssStyleVectorUsingHierarchyAndSelectors ( const SvgNode rCurrent,
const OUString &  aConcatenated 
)
protected

◆ fillCssStyleVectorUsingParent()

void svgio::svgreader::SvgNode::fillCssStyleVectorUsingParent ( const SvgNode rCurrent)
protected

◆ getChildren()

const std::vector< std::unique_ptr< SvgNode > > & svgio::svgreader::SvgNode::getChildren ( ) const
inline

◆ getClass()

std::optional< OUString > const & svgio::svgreader::SvgNode::getClass ( ) const
inline

◆ getCurrentFontSize()

double svgio::svgreader::SvgNode::getCurrentFontSize ( ) const

◆ getCurrentFontSizeInherited()

double svgio::svgreader::SvgNode::getCurrentFontSizeInherited ( ) const
overridevirtual

return font size of node inherited from parents

Implements svgio::svgreader::InfoProvider.

Definition at line 714 of file svgnode.cxx.

References getCurrentFontSize(), and getParent().

Referenced by getCurrentFontSize(), and svgio::svgreader::SvgTspanNode::getCurrentFontSize().

◆ getCurrentViewPort()

basegfx::B2DRange svgio::svgreader::SvgNode::getCurrentViewPort ( ) const
overridevirtual

◆ getCurrentXHeight()

double svgio::svgreader::SvgNode::getCurrentXHeight ( ) const

◆ getCurrentXHeightInherited()

double svgio::svgreader::SvgNode::getCurrentXHeightInherited ( ) const
overridevirtual

return xheight of node inherited from parents

Implements svgio::svgreader::InfoProvider.

Definition at line 734 of file svgnode.cxx.

References getCurrentXHeight(), and getParent().

Referenced by getCurrentXHeight().

◆ getDisplay()

Display svgio::svgreader::SvgNode::getDisplay ( ) const
inline

◆ getDocument()

const SvgDocument & svgio::svgreader::SvgNode::getDocument ( ) const
inline

◆ getId()

std::optional< OUString > const & svgio::svgreader::SvgNode::getId ( ) const
inline

Id access.

Definition at line 170 of file svgnode.hxx.

References mpId.

Referenced by fillCssStyleVectorUsingHierarchyAndSelectors(), and fillCssStyleVectorUsingParent().

◆ getParent()

const SvgNode * svgio::svgreader::SvgNode::getParent ( ) const
inline

◆ getSvgStyleAttributes()

const SvgStyleAttributes * svgio::svgreader::SvgNode::getSvgStyleAttributes ( ) const
virtual

◆ getType()

SVGToken svgio::svgreader::SvgNode::getType ( ) const
inline

◆ getXmlSpace()

XmlSpace svgio::svgreader::SvgNode::getXmlSpace ( ) const

◆ hasLocalCssStyle()

bool svgio::svgreader::SvgNode::hasLocalCssStyle ( )
inline

◆ operator=()

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

◆ parseAttribute()

void svgio::svgreader::SvgNode::parseAttribute ( const OUString &  rTokenName,
SVGToken  aSVGToken,
const OUString &  aContent 
)
virtual

Reimplemented in svgio::svgreader::SvgANode, svgio::svgreader::SvgCircleNode, svgio::svgreader::SvgClipPathNode, svgio::svgreader::SvgEllipseNode, svgio::svgreader::SvgFeColorMatrixNode, svgio::svgreader::SvgFeDropShadowNode, svgio::svgreader::SvgFeFloodNode, svgio::svgreader::SvgFeGaussianBlurNode, svgio::svgreader::SvgFeImageNode, svgio::svgreader::SvgFeOffsetNode, svgio::svgreader::SvgGNode, svgio::svgreader::SvgGradientNode, svgio::svgreader::SvgGradientStopNode, svgio::svgreader::SvgImageNode, svgio::svgreader::SvgLineNode, svgio::svgreader::SvgMarkerNode, svgio::svgreader::SvgMaskNode, svgio::svgreader::SvgPathNode, svgio::svgreader::SvgPatternNode, svgio::svgreader::SvgPolyNode, svgio::svgreader::SvgRectNode, svgio::svgreader::SvgStyleNode, svgio::svgreader::SvgSvgNode, svgio::svgreader::SvgSymbolNode, svgio::svgreader::SvgTextNode, svgio::svgreader::SvgTextPathNode, svgio::svgreader::SvgTrefNode, svgio::svgreader::SvgTspanNode, and svgio::svgreader::SvgUseNode.

Definition at line 534 of file svgnode.cxx.

References svgio::svgreader::Class, svgio::svgreader::Default, svgio::svgreader::Display, o3tl::equalsIgnoreAsciiCase(), svgio::svgreader::getDisplayFromContent(), svgio::svgreader::Id, svgio::svgreader::Preserve, setClass(), setDisplay(), setId(), setXmlSpace(), o3tl::trim(), u, and svgio::svgreader::XmlSpace.

Referenced by svgio::svgreader::SvgDocHdl::endElement(), svgio::svgreader::SvgANode::parseAttribute(), svgio::svgreader::SvgCircleNode::parseAttribute(), svgio::svgreader::SvgClipPathNode::parseAttribute(), svgio::svgreader::SvgEllipseNode::parseAttribute(), svgio::svgreader::SvgGNode::parseAttribute(), svgio::svgreader::SvgGradientNode::parseAttribute(), svgio::svgreader::SvgGradientStopNode::parseAttribute(), svgio::svgreader::SvgImageNode::parseAttribute(), svgio::svgreader::SvgLineNode::parseAttribute(), svgio::svgreader::SvgMarkerNode::parseAttribute(), svgio::svgreader::SvgMaskNode::parseAttribute(), svgio::svgreader::SvgPathNode::parseAttribute(), svgio::svgreader::SvgPatternNode::parseAttribute(), svgio::svgreader::SvgPolyNode::parseAttribute(), svgio::svgreader::SvgRectNode::parseAttribute(), svgio::svgreader::SvgStyleNode::parseAttribute(), svgio::svgreader::SvgSvgNode::parseAttribute(), svgio::svgreader::SvgSymbolNode::parseAttribute(), svgio::svgreader::SvgTextNode::parseAttribute(), svgio::svgreader::SvgTextPathNode::parseAttribute(), svgio::svgreader::SvgTrefNode::parseAttribute(), svgio::svgreader::SvgTspanNode::parseAttribute(), svgio::svgreader::SvgUseNode::parseAttribute(), and parseAttributes().

◆ parseAttributes()

void svgio::svgreader::SvgNode::parseAttributes ( const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttribs)

style helpers

Definition at line 436 of file svgnode.cxx.

References a, nAttributes, parseAttribute(), and svgio::svgreader::StrToSVGToken().

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

◆ readLocalCssStyle()

void svgio::svgreader::SvgNode::readLocalCssStyle ( std::u16string_view  aContent)

◆ setAlternativeParent()

void svgio::svgreader::SvgNode::setAlternativeParent ( const SvgNode pAlternativeParent = nullptr)
inline

◆ setClass()

void svgio::svgreader::SvgNode::setClass ( OUString const &  rClass)

◆ setDisplay()

void svgio::svgreader::SvgNode::setDisplay ( Display  eDisplay)
inline

Definition at line 183 of file svgnode.hxx.

References maDisplay.

Referenced by parseAttribute(), and svgio::svgreader::SvgStyleAttributes::parseStyleAttribute().

◆ setId()

void svgio::svgreader::SvgNode::setId ( OUString const &  rId)

◆ setXmlSpace()

void svgio::svgreader::SvgNode::setXmlSpace ( XmlSpace  eXmlSpace)
inline

Definition at line 179 of file svgnode.hxx.

References maXmlSpace.

Referenced by parseAttribute().

◆ supportsParentStyle()

bool svgio::svgreader::SvgNode::supportsParentStyle ( ) const
virtual

#i125258# tell if this node is allowed to have a parent style (e.g. defs do not)

#i125258#

Reimplemented in svgio::svgreader::SvgStyleNode.

Definition at line 32 of file svgnode.cxx.

Referenced by svgio::svgreader::SvgStyleAttributes::getParentStyle(), and svgio::svgreader::SvgStyleNode::supportsParentStyle().

Member Data Documentation

◆ maChildren

std::vector< std::unique_ptr<SvgNode> > svgio::svgreader::SvgNode::maChildren
private

sub hierarchy

Definition at line 90 of file svgnode.hxx.

Referenced by getChildren(), and SvgNode().

◆ maCssStyleVector

::std::vector< const SvgStyleAttributes* > svgio::svgreader::SvgNode::maCssStyleVector
private

Definition at line 107 of file svgnode.hxx.

Referenced by addCssStyle(), checkForCssStyle(), and fillCssStyleVector().

◆ maDisplay

Display svgio::svgreader::SvgNode::maDisplay
private

Display value #i121656#.

Definition at line 102 of file svgnode.hxx.

Referenced by getDisplay(), and setDisplay().

◆ maType

SVGToken svgio::svgreader::SvgNode::maType
private

basic data, Type, document we belong to and parent (if not root)

Definition at line 84 of file svgnode.hxx.

Referenced by getType().

◆ maXmlSpace

XmlSpace svgio::svgreader::SvgNode::maXmlSpace
private

XmlSpace value.

Definition at line 99 of file svgnode.hxx.

Referenced by getXmlSpace(), and setXmlSpace().

◆ mbCssStyleVectorBuilt

bool svgio::svgreader::SvgNode::mbCssStyleVectorBuilt
private

Definition at line 115 of file svgnode.hxx.

Referenced by checkForCssStyle(), and fillCssStyleVector().

◆ mbDecomposing

bool svgio::svgreader::SvgNode::mbDecomposing
mutableprivate

Definition at line 112 of file svgnode.hxx.

Referenced by decomposeSvgNode().

◆ mpAlternativeParent

const SvgNode* svgio::svgreader::SvgNode::mpAlternativeParent
private

Definition at line 87 of file svgnode.hxx.

Referenced by getParent(), and setAlternativeParent().

◆ mpClass

std::optional<OUString> svgio::svgreader::SvgNode::mpClass
private

Class svan value.

Definition at line 96 of file svgnode.hxx.

Referenced by getClass(), and setClass().

◆ mpId

std::optional<OUString> svgio::svgreader::SvgNode::mpId
private

Id svan value.

Definition at line 93 of file svgnode.hxx.

Referenced by getId(), and setId().

◆ mpLocalCssStyle

std::unique_ptr<SvgStyleAttributes> svgio::svgreader::SvgNode::mpLocalCssStyle
private

possible local CssStyle, e.g. style="fill:red; stroke:red;"

Definition at line 110 of file svgnode.hxx.

Referenced by fillCssStyleVector(), hasLocalCssStyle(), and readLocalCssStyle().

◆ mpParent

const SvgNode* svgio::svgreader::SvgNode::mpParent
private

Definition at line 86 of file svgnode.hxx.

Referenced by getParent().

◆ mrDocument

SvgDocument& svgio::svgreader::SvgNode::mrDocument
private

Definition at line 85 of file svgnode.hxx.

Referenced by getDocument(), setClass(), setId(), and SvgNode().


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