25#include <oox/token/namespaces.hxx>
26#include <oox/token/tokens.hxx>
38 :
public ContextHandler2
41 CxnListContext( ContextHandler2Helper
const & rParent,
43 : ContextHandler2( rParent )
49 onCreateContext( sal_Int32 aElementToken,
50 const AttributeList& rAttribs )
override
52 switch( aElementToken )
54 case DGM_TOKEN( cxn ):
60 rConnection.
msModelId = rAttribs.getStringDefaulted( XML_modelId );
61 rConnection.
msSourceId = rAttribs.getStringDefaulted( XML_srcId );
62 rConnection.
msDestId = rAttribs.getStringDefaulted( XML_destId );
63 rConnection.
msPresId = rAttribs.getStringDefaulted( XML_presId );
64 rConnection.
msSibTransId = rAttribs.getStringDefaulted( XML_sibTransId );
65 rConnection.
msParTransId = rAttribs.getStringDefaulted( XML_parTransId );
66 rConnection.
mnSourceOrder = rAttribs.getInteger( XML_srcOrd, 0 );
67 rConnection.
mnDestOrder = rAttribs.getInteger( XML_destOrd, 0 );
83class PresLayoutVarsContext
84 :
public ContextHandler2
87 PresLayoutVarsContext( ContextHandler2Helper
const & rParent,
89 ContextHandler2( rParent ),
94 onCreateContext( sal_Int32 aElementToken,
95 const AttributeList& rAttribs )
override
97 switch( aElementToken )
100 case DGM_TOKEN( animLvl ):
101 case DGM_TOKEN( animOne ):
103 case DGM_TOKEN( bulletEnabled ):
104 mrPoint.mbBulletEnabled = rAttribs.getBool( XML_val, false );
106 case DGM_TOKEN( chMax ):
107 mrPoint.mnMaxChildren = rAttribs.getInteger( XML_val, -1 );
109 case DGM_TOKEN( chPref ):
110 mrPoint.mnPreferredChildren = rAttribs.getInteger( XML_val, -1 );
112 case DGM_TOKEN( dir ):
115 case DGM_TOKEN( hierBranch ):
118 const std::optional< sal_Int32 > aOptVal(rAttribs.getToken( XML_val ));
119 if(aOptVal.has_value())
123 case DGM_TOKEN( orgChart ):
124 mrPoint.mbOrgChartEnabled = rAttribs.getBool( XML_val, false );
126 case DGM_TOKEN( resizeHandles ):
141class PropertiesContext
142 :
public ContextHandler2
145 PropertiesContext( ContextHandler2Helper
const & rParent,
147 const AttributeList& rAttribs ) :
148 ContextHandler2( rParent ),
184 onCreateContext( sal_Int32 aElementToken,
185 const AttributeList& )
override
187 switch( aElementToken )
189 case DGM_TOKEN( presLayoutVars ):
190 return new PresLayoutVarsContext( *this,
mrPoint );
191 case DGM_TOKEN( style ):
206 :
public ContextHandler2
209 PtContext( ContextHandler2Helper
const& rParent,
210 const AttributeList& rAttribs,
212 DiagramData& rDiagramData):
213 ContextHandler2( rParent ),
220 const sal_Int32
nType = rAttribs.getToken( XML_type, XML_node );
229 onCreateContext( sal_Int32 aElementToken,
230 const AttributeList& rAttribs )
override
232 switch( aElementToken )
234 case DGM_TOKEN( extLst ):
236 case DGM_TOKEN( prSet ):
237 return new PropertiesContext( *this,
mrPoint, rAttribs );
238 case DGM_TOKEN( spPr ):
241 return new ShapePropertiesContext( *
this, *pShape );
246 TextBodyPtr xTextBody = std::make_shared<TextBody>();
247 pShape->setTextBody( xTextBody );
248 return new TextBodyContext( *
this, *xTextBody );
263 :
public ContextHandler2
266 PtListContext( ContextHandler2Helper
const & rParent,
svx::diagram::Points& rPoints, DiagramData& rDiagramData) :
267 ContextHandler2( rParent ),
272 onCreateContext( sal_Int32 aElementToken,
273 const AttributeList& rAttribs )
override
275 switch( aElementToken )
277 case DGM_TOKEN( pt ):
295class BackgroundFormattingContext
296 :
public ContextHandler2
299 BackgroundFormattingContext( ContextHandler2Helper
const & rParent,
OoxDiagramDataPtr const& pModel )
300 : ContextHandler2( rParent )
303 assert( pModel &&
"the data model MUST NOT be NULL" );
307 onCreateContext( sal_Int32 aElementToken,
308 const AttributeList& rAttribs )
override
310 switch( aElementToken )
312 case A_TOKEN( blipFill ):
313 case A_TOKEN( gradFill ):
314 case A_TOKEN( grpFill ):
315 case A_TOKEN( noFill ):
316 case A_TOKEN( pattFill ):
317 case A_TOKEN( solidFill ):
319 return FillPropertiesContext::createFillContext(*this, aElementToken, rAttribs, *
mpDataModel->getBackgroundShapeFillProperties(), nullptr);
320 case A_TOKEN( effectDag ):
321 case A_TOKEN( effectLst ):
341 assert( pDataModel &&
"Data Model must not be NULL" );
356 case DGM_TOKEN( cxnLst ):
358 return new CxnListContext( *
this,
mpDataModel->getConnections() );
359 case DGM_TOKEN( ptLst ):
362 case DGM_TOKEN( bg ):
364 return new BackgroundFormattingContext( *
this,
mpDataModel );
365 case DGM_TOKEN( whole ):
369 case DGM_TOKEN( extLst ):
372 case DSP_TOKEN( dataModelExt ):
Provides access to attribute values of an element.
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
OoxDiagramDataPtr mpDataModel
virtual ~DataModelContext() override
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
DataModelContext(::oox::core::ContextHandler2Helper const &rParent, const OoxDiagramDataPtr &pDataModelPtr)
OoxDiagramDataPtr mpDataModel
svx::diagram::Connections & mrConnection
svx::diagram::Point & mrPoint
DiagramData & mrDiagramData
svx::diagram::Points & mrPoints
sal_Int32 getToken(const Context &rContext, const char *pToken)
::rtl::Reference< ContextHandler > ContextHandlerRef
std::shared_ptr< DiagramData > OoxDiagramDataPtr
std::shared_ptr< TextBody > TextBodyPtr
std::vector< Connection > Connections
std::vector< Point > Points
OUString msPlaceholderText
sal_Int32 mnWidthOverride
bool mbCustomHorizontalFlip
sal_Int32 mnPercentageNeighbourHeight
bool mbCustomVerticalFlip
std::optional< sal_Int32 > moHierarchyBranch
sal_Int32 mnPercentageNeighbourWidth
sal_Int32 mnLayoutStyleIndex
sal_Int32 mnLayoutStyleCount
OUString msPresentationLayoutStyleLabel
OUString msPresentationAssociationId
OUString msPresentationLayoutName
OUString msLayoutCategoryId
sal_Int32 mnPercentageOwnHeight
OUString msColorTransformCategoryId
sal_Int32 mnIncludeAngleScale
OUString msColorTransformTypeId
OUString msQuickStyleCategoryId
sal_Int32 mnHeightOverride
OUString msQuickStyleTypeId
sal_Int32 mnPercentageOwnWidth