1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAM_HXX
21 #define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAM_HXX
27 #include <rtl/ustring.hxx>
29 #include "oox/drawingml/shape.hxx"
30 #include "drawingml/fillproperties.hxx"
31 #include <oox/token/tokens.hxx>
33 namespace com
{ namespace sun
{ namespace star
{
34 namespace xml
{ namespace dom
{ class XDocument
; } }
37 namespace oox
{ namespace drawingml
{
57 OUString msParTransId
;
59 OUString msSibTransId
;
60 sal_Int32 mnSourceOrder
;
61 sal_Int32 mnDestOrder
;
65 typedef std::vector
< Connection
> Connections
;
74 mnPreferredChildren(-1),
75 mnDirection(XML_norm
),
76 mnHierarchyBranch(XML_std
),
77 mnResizeHandles(XML_rel
),
79 mnPercentageNeighbourWidth(-1),
80 mnPercentageNeighbourHeight(-1),
81 mnPercentageOwnWidth(-1),
82 mnPercentageOwnHeight(-1),
83 mnIncludeAngleScale(-1),
89 mnLayoutStyleCount(-1),
90 mnLayoutStyleIndex(-1),
92 mbOrgChartEnabled(false),
93 mbBulletEnabled(false),
94 mbCoherent3DOffset(false),
95 mbCustomHorizontalFlip(false),
96 mbCustomVerticalFlip(false),
98 mbIsPlaceholder(false)
106 OUString msColorTransformCategoryId
;
107 OUString msColorTransformTypeId
;
108 OUString msLayoutCategoryId
;
109 OUString msLayoutTypeId
;
110 OUString msPlaceholderText
;
111 OUString msPresentationAssociationId
;
112 OUString msPresentationLayoutName
;
113 OUString msPresentationLayoutStyleLabel
;
114 OUString msQuickStyleCategoryId
;
115 OUString msQuickStyleTypeId
;
118 sal_Int32 mnMaxChildren
;
119 sal_Int32 mnPreferredChildren
;
120 sal_Int32 mnDirection
;
121 sal_Int32 mnHierarchyBranch
;
122 sal_Int32 mnResizeHandles
;
123 sal_Int32 mnCustomAngle
;
124 sal_Int32 mnPercentageNeighbourWidth
;
125 sal_Int32 mnPercentageNeighbourHeight
;
126 sal_Int32 mnPercentageOwnWidth
;
127 sal_Int32 mnPercentageOwnHeight
;
128 sal_Int32 mnIncludeAngleScale
;
129 sal_Int32 mnRadiusScale
;
130 sal_Int32 mnWidthScale
;
131 sal_Int32 mnHeightScale
;
132 sal_Int32 mnWidthOverride
;
133 sal_Int32 mnHeightOverride
;
134 sal_Int32 mnLayoutStyleCount
;
135 sal_Int32 mnLayoutStyleIndex
;
137 bool mbOrgChartEnabled
;
138 bool mbBulletEnabled
;
139 bool mbCoherent3DOffset
;
140 bool mbCustomHorizontalFlip
;
141 bool mbCustomVerticalFlip
;
143 bool mbIsPlaceholder
;
146 typedef std::vector
< Point
> Points
;
151 typedef std::shared_ptr
< LayoutNode
> LayoutNodePtr
;
153 typedef std::map
< OUString
, css::uno::Reference
<css::xml::dom::XDocument
> > DiagramDomMap
;
158 ::std::vector
<OUString
> maExtDrawings
;
159 typedef std::map
< OUString
, dgm::Point
* > PointNameMap
;
160 typedef std::map
< OUString
,
161 std::vector
<dgm::Point
*> > PointsNameMap
;
162 typedef std::map
< OUString
, const dgm::Connection
* > ConnectionNameMap
;
163 typedef std::map
< OUString
,
164 std::vector
<std::pair
<OUString
,sal_Int32
> > > StringMap
;
167 FillPropertiesPtr
& getFillProperties()
168 { return mpFillProperties
; }
169 dgm::Connections
& getConnections()
170 { return maConnections
; }
171 dgm::Points
& getPoints()
173 ConnectionNameMap
& getConnectionNameMap()
174 { return maConnectionNameMap
; }
175 StringMap
& getPresOfNameMap()
176 { return maPresOfNameMap
; }
177 PointNameMap
& getPointNameMap()
178 { return maPointNameMap
; }
179 PointsNameMap
& getPointsPresNameMap()
180 { return maPointsPresNameMap
; }
181 ::std::vector
<OUString
> &getExtDrawings()
182 { return maExtDrawings
; }
185 FillPropertiesPtr mpFillProperties
;
186 dgm::Connections maConnections
;
187 dgm::Points maPoints
;
188 PointNameMap maPointNameMap
;
189 PointsNameMap maPointsPresNameMap
;
190 ConnectionNameMap maConnectionNameMap
;
191 StringMap maPresOfNameMap
;
194 typedef std::shared_ptr
< DiagramData
> DiagramDataPtr
;
199 void setDefStyle( const OUString
& sDefStyle
)
200 { msDefStyle
= sDefStyle
; }
201 void setMinVer( const OUString
& sMinVer
)
202 { msMinVer
= sMinVer
; }
203 void setUniqueId( const OUString
& sUniqueId
)
204 { msUniqueId
= sUniqueId
; }
205 void setTitle( const OUString
& sTitle
)
206 { msTitle
= sTitle
; }
207 void setDesc( const OUString
& sDesc
)
209 LayoutNodePtr
& getNode()
211 const LayoutNodePtr
& getNode() const
213 DiagramDataPtr
& getSampData()
214 { return mpSampData
; }
215 const DiagramDataPtr
& getSampData() const
216 { return mpSampData
; }
217 DiagramDataPtr
& getStyleData()
218 { return mpStyleData
; }
219 const DiagramDataPtr
& getStyleData() const
220 { return mpStyleData
; }
229 LayoutNodePtr mpNode
;
230 DiagramDataPtr mpSampData
;
231 DiagramDataPtr mpStyleData
;
237 typedef std::shared_ptr
< DiagramLayout
> DiagramLayoutPtr
;
241 ShapeStyleRef maFillStyle
;
242 ShapeStyleRef maLineStyle
;
243 ShapeStyleRef maEffectStyle
;
244 ShapeStyleRef maTextStyle
;
247 typedef std::map
<OUString
,DiagramStyle
> DiagramQStyleMap
;
251 oox::drawingml::Color maFillColor
;
252 oox::drawingml::Color maLineColor
;
253 oox::drawingml::Color maEffectColor
;
254 oox::drawingml::Color maTextFillColor
;
255 oox::drawingml::Color maTextLineColor
;
256 oox::drawingml::Color maTextEffectColor
;
259 typedef std::map
<OUString
,DiagramColor
> DiagramColorMap
;
264 void setData( const DiagramDataPtr
& );
265 const DiagramDataPtr
& getData() const
269 void setLayout( const DiagramLayoutPtr
& );
271 DiagramQStyleMap
& getStyles() { return maStyles
; }
272 const DiagramQStyleMap
& getStyles() const { return maStyles
; }
273 DiagramColorMap
& getColors() { return maColors
; }
274 const DiagramColorMap
& getColors() const { return maColors
; }
275 DiagramDomMap
& getDomMap() { return maMainDomMap
; }
276 css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> > & getDataRelsMap() { return maDataRelsMap
; }
277 void addTo( const ShapePtr
& pShape
);
279 css::uno::Sequence
<css::beans::PropertyValue
> getDomsAsPropertyValues() const;
282 DiagramDataPtr mpData
;
283 DiagramLayoutPtr mpLayout
;
284 DiagramQStyleMap maStyles
;
285 DiagramColorMap maColors
;
286 DiagramDomMap maMainDomMap
;
287 css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> > maDataRelsMap
;
290 typedef std::shared_ptr
< Diagram
> DiagramPtr
;
296 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */