20#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMLAYOUTATOMS_HXX
21#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMLAYOUTATOMS_HXX
26#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
42 void loadFromXAttr(
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes );
57 void loadFromXAttr(
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes );
129 pParent->addChild(pChild);
130 pChild->setParent(pParent);
134 void dump(
int level = 0);
151 void parseConstraint(std::vector<Constraint>& rConstraints,
bool bRequireForName)
const;
165 void parseRule(std::vector<Rule>& rRules)
const;
187 const std::vector<Constraint>& rConstraints,
188 const std::vector<Rule>& rRules );
211 const std::vector<Constraint>& rConstraints);
231 const std::vector<Constraint>& rConstraints);
256 explicit ForEachAtom(
LayoutNode& rLayoutNode,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes);
278 explicit ConditionAtom(
LayoutNode& rLayoutNode,
bool isElse,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes);
283 static bool compareResult(sal_Int32 nOperator, sal_Int32 nFirst, sal_Int32 nSecond);
308 typedef std::map<sal_Int32, OUString>
VarMap;
338 sal_Int32 nCurrIdx )
const;
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
double getAspectRatio() const
void setType(sal_Int32 nToken)
void layoutShape(const ShapePtr &rShape, const std::vector< Constraint > &rConstraints, const std::vector< Rule > &rRules)
AlgAtom(LayoutNode &rLayoutNode)
const ParamMap & getMap() const
void setAspectRatio(double fAspectRatio)
std::map< sal_Int32, sal_Int32 > ParamMap
sal_Int32 getVerticalShapesCount(const ShapePtr &rShape)
void addParam(sal_Int32 nType, sal_Int32 nVal)
double mfAspectRatio
Aspect ratio is not integer, so not part of maMap.
sal_Int32 getConnectorType()
Determines the connector shape type for conn algorithm.
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
ChooseAtom(LayoutNode &rLayoutNode)
Specifies the size and position for all child layout nodes.
static void applyConstraintToLayout(const Constraint &rConstraint, LayoutPropertyMap &rProperties)
Apply rConstraint to the rProperties shared layout state.
static bool inferFromLayoutProperty(const LayoutProperty &rMap, sal_Int32 nRefType, sal_Int32 &rValue)
Decides if a certain reference type (e.g.
static void layoutShapeChildren(AlgAtom &rAlg, const ShapePtr &rShape, const std::vector< Constraint > &rConstraints)
bool getDecision(const svx::diagram::Point *pPresPoint) const
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
sal_Int32 getNodeCount(const svx::diagram::Point *pPresPoint) const
static bool compareResult(sal_Int32 nOperator, sal_Int32 nFirst, sal_Int32 nSecond)
ConditionAtom(LayoutNode &rLayoutNode, bool isElse, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
Constraint & getConstraint()
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
ConstraintAtom(LayoutNode &rLayoutNode)
void parseConstraint(std::vector< Constraint > &rConstraints, bool bRequireForName) const
const OUString & getRef() const
LayoutAtomPtr getRefAtom()
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
void setRef(const OUString &rsRef)
ForEachAtom(LayoutNode &rLayoutNode, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
IteratorAttr & iterator()
abstract Atom for the layout
void setName(const OUString &sName)
std::vector< LayoutAtomPtr > mpChildNodes
std::weak_ptr< LayoutAtom > mpParent
LayoutAtom(LayoutNode &rLayoutNode)
const std::vector< LayoutAtomPtr > & getChildren() const
LayoutNode & getLayoutNode()
LayoutAtomPtr getParent() const
static void connect(const LayoutAtomPtr &pParent, const LayoutAtomPtr &pChild)
LayoutNode & mrLayoutNode
const OUString & getName() const
virtual void accept(LayoutAtomVisitor &)=0
visitor acceptance
void addChild(const LayoutAtomPtr &pNode)
void setParent(const LayoutAtomPtr &pParent)
void setStyleLabel(const OUString &sLabel)
const LayoutNode * getParentLayoutNode() const
void setChildOrder(sal_Int32 nOrder)
void setExistingShape(const ShapePtr &pShape)
sal_Int32 getChildOrder() const
LayoutNode(Diagram &rDgm)
const std::vector< ShapePtr > & getNodeShapes() const
std::map< sal_Int32, OUString > VarMap
std::vector< ShapePtr > mpNodeShapes
void setMoveWith(const OUString &sName)
const ShapePtr & getExistingShape() const
bool setupShape(const ShapePtr &rShape, const svx::diagram::Point *pPresNode, sal_Int32 nCurrIdx) const
void addNodeShape(const ShapePtr &pShape)
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
Lays out child layout nodes along a vertical path and works with the trapezoid shape to create a pyra...
static void layoutShapeChildren(const ShapePtr &rShape)
Represents one <dgm:rule> element.
RuleAtom(LayoutNode &rLayoutNode)
void parseRule(std::vector< Rule > &rRules) const
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
const ShapePtr & getShapeTemplate() const
ShapeAtom(LayoutNode &rLayoutNode, ShapePtr pShape)
Finds optimal grid to layout children that have fixed aspect ratio.
static void layoutShapeChildren(const AlgAtom &rAlg, const ShapePtr &rShape, const std::vector< Constraint > &rConstraints)
std::shared_ptr< ShapeAtom > ShapeAtomPtr
std::shared_ptr< ConditionAtom > ConditionAtomPtr
std::shared_ptr< Shape > ShapePtr
std::shared_ptr< AlgAtom > AlgAtomPtr
std::shared_ptr< LayoutAtom > LayoutAtomPtr
std::shared_ptr< LayoutNode > LayoutNodePtr
std::map< OUString, LayoutProperty > LayoutPropertyMap
std::shared_ptr< DiagramLayout > DiagramLayoutPtr
std::map< sal_Int32, sal_Int32 > LayoutProperty
std::shared_ptr< ForEachAtom > ForEachAtomPtr
void loadFromXAttr(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
Constraints allow you to specify an ideal (or starting point) size for each shape.
std::vector< sal_Int32 > maAxis
void loadFromXAttr(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
Rules allow you to specify what to do when constraints can't be fully satisfied.