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 OOX_DRAWINGML_DIAGRAM_DIAGRAM_HXX
21 #define OOX_DRAWINGML_DIAGRAM_DIAGRAM_HXX
26 #include <boost/shared_ptr.hpp>
27 #include <boost/enable_shared_from_this.hpp>
29 #include <rtl/ustring.hxx>
31 #include "oox/drawingml/shape.hxx"
32 #include "oox/drawingml/fillproperties.hxx"
34 namespace com
{ namespace sun
{ namespace star
{
35 namespace xml
{ namespace dom
{ class XDocument
; } }
38 namespace oox
{ namespace drawingml
{
58 OUString msParTransId
;
60 OUString msSibTransId
;
61 sal_Int32 mnSourceOrder
;
62 sal_Int32 mnDestOrder
;
66 typedef std::vector
< Connection
> Connections
;
76 mnPreferredChildren(-1),
77 mnDirection(XML_norm
),
78 mnHierarchyBranch(XML_std
),
79 mnResizeHandles(XML_rel
),
81 mnPercentageNeighbourWidth(-1),
82 mnPercentageNeighbourHeight(-1),
83 mnPercentageOwnWidth(-1),
84 mnPercentageOwnHeight(-1),
85 mnIncludeAngleScale(-1),
91 mnLayoutStyleCount(-1),
92 mnLayoutStyleIndex(-1),
94 mbOrgChartEnabled(false),
95 mbBulletEnabled(false),
96 mbCoherent3DOffset(false),
97 mbCustomHorizontalFlip(false),
98 mbCustomVerticalFlip(false),
100 mbIsPlaceholder(false)
108 OUString msColorTransformCategoryId
;
109 OUString msColorTransformTypeId
;
110 OUString msLayoutCategoryId
;
111 OUString msLayoutTypeId
;
112 OUString msPlaceholderText
;
113 OUString msPresentationAssociationId
;
114 OUString msPresentationLayoutName
;
115 OUString msPresentationLayoutStyleLabel
;
116 OUString msQuickStyleCategoryId
;
117 OUString msQuickStyleTypeId
;
120 sal_Int32 mnMaxChildren
;
121 sal_Int32 mnPreferredChildren
;
122 sal_Int32 mnDirection
;
123 sal_Int32 mnHierarchyBranch
;
124 sal_Int32 mnResizeHandles
;
125 sal_Int32 mnCustomAngle
;
126 sal_Int32 mnPercentageNeighbourWidth
;
127 sal_Int32 mnPercentageNeighbourHeight
;
128 sal_Int32 mnPercentageOwnWidth
;
129 sal_Int32 mnPercentageOwnHeight
;
130 sal_Int32 mnIncludeAngleScale
;
131 sal_Int32 mnRadiusScale
;
132 sal_Int32 mnWidthScale
;
133 sal_Int32 mnHeightScale
;
134 sal_Int32 mnWidthOverride
;
135 sal_Int32 mnHeightOverride
;
136 sal_Int32 mnLayoutStyleCount
;
137 sal_Int32 mnLayoutStyleIndex
;
139 bool mbOrgChartEnabled
;
140 bool mbBulletEnabled
;
141 bool mbCoherent3DOffset
;
142 bool mbCustomHorizontalFlip
;
143 bool mbCustomVerticalFlip
;
145 bool mbIsPlaceholder
;
148 typedef std::vector
< Point
> Points
;
153 typedef boost::shared_ptr
< LayoutNode
> LayoutNodePtr
;
160 ::std::vector
<OUString
> maExtDrawings
;
161 typedef std::map
< OUString
, dgm::Point
* > PointNameMap
;
162 typedef std::map
< OUString
,
163 std::vector
<dgm::Point
*> > PointsNameMap
;
164 typedef std::map
< OUString
, const dgm::Connection
* > ConnectionNameMap
;
165 typedef std::map
< OUString
,
166 std::vector
<std::pair
<OUString
,sal_Int32
> > > StringMap
;
169 FillPropertiesPtr
& getFillProperties()
170 { return mpFillProperties
; }
171 dgm::Connections
& getConnections()
172 { return maConnections
; }
173 dgm::Points
& getPoints()
175 ConnectionNameMap
& getConnectionNameMap()
176 { return maConnectionNameMap
; }
177 StringMap
& getPresOfNameMap()
178 { return maPresOfNameMap
; }
179 PointNameMap
& getPointNameMap()
180 { return maPointNameMap
; }
181 PointsNameMap
& getPointsPresNameMap()
182 { return maPointsPresNameMap
; }
183 ::std::vector
<OUString
> &getExtDrawings()
184 { return maExtDrawings
; }
187 FillPropertiesPtr mpFillProperties
;
188 dgm::Connections maConnections
;
189 dgm::Points maPoints
;
190 PointNameMap maPointNameMap
;
191 PointsNameMap maPointsPresNameMap
;
192 ConnectionNameMap maConnectionNameMap
;
193 StringMap maPresOfNameMap
;
196 typedef boost::shared_ptr
< DiagramData
> DiagramDataPtr
;
205 void setDefStyle( const OUString
& sDefStyle
)
206 { msDefStyle
= sDefStyle
; }
207 void setMinVer( const OUString
& sMinVer
)
208 { msMinVer
= sMinVer
; }
209 void setUniqueId( const OUString
& sUniqueId
)
210 { msUniqueId
= sUniqueId
; }
211 const OUString
& getUniqueId()
212 { return msUniqueId
; }
213 void setTitle( const OUString
& sTitle
)
214 { msTitle
= sTitle
; }
215 void setDesc( const OUString
& sDesc
)
218 LayoutNodePtr
& getNode()
220 const LayoutNodePtr
& getNode() const
222 DiagramDataPtr
& getSampData()
223 { return mpSampData
; }
224 const DiagramDataPtr
& getSampData() const
225 { return mpSampData
; }
226 DiagramDataPtr
& getStyleData()
227 { return mpStyleData
; }
228 const DiagramDataPtr
& getStyleData() const
229 { return mpStyleData
; }
238 LayoutNodePtr mpNode
;
239 DiagramDataPtr mpSampData
;
240 DiagramDataPtr mpStyleData
;
246 typedef boost::shared_ptr
< DiagramLayout
> DiagramLayoutPtr
;
248 ///////////////////////
252 ShapeStyleRef maFillStyle
;
253 ShapeStyleRef maLineStyle
;
254 ShapeStyleRef maEffectStyle
;
255 ShapeStyleRef maTextStyle
;
258 typedef std::map
<OUString
,DiagramStyle
> DiagramQStyleMap
;
262 oox::drawingml::Color maFillColor
;
263 oox::drawingml::Color maLineColor
;
264 oox::drawingml::Color maEffectColor
;
265 oox::drawingml::Color maTextFillColor
;
266 oox::drawingml::Color maTextLineColor
;
267 oox::drawingml::Color maTextEffectColor
;
270 typedef std::map
<OUString
,DiagramColor
> DiagramColorMap
;
272 ///////////////////////
277 void setData( const DiagramDataPtr
& );
278 DiagramDataPtr
getData() const
282 void setLayout( const DiagramLayoutPtr
& );
283 DiagramLayoutPtr
getLayout() const
288 DiagramQStyleMap
& getStyles() { return maStyles
; }
289 const DiagramQStyleMap
& getStyles() const { return maStyles
; }
290 DiagramColorMap
& getColors() { return maColors
; }
291 const DiagramColorMap
& getColors() const { return maColors
; }
293 void addTo( const ShapePtr
& pShape
);
296 DiagramDataPtr mpData
;
297 DiagramLayoutPtr mpLayout
;
298 DiagramQStyleMap maStyles
;
299 DiagramColorMap maColors
;
300 std::map
< OUString
, ShapePtr
> maShapeMap
;
304 typedef boost::shared_ptr
< Diagram
> DiagramPtr
;
310 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */