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
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"
33 #include <oox/token/tokens.hxx>
35 namespace com
{ namespace sun
{ namespace star
{
36 namespace xml
{ namespace dom
{ class XDocument
; } }
39 namespace oox
{ namespace drawingml
{
59 OUString msParTransId
;
61 OUString msSibTransId
;
62 sal_Int32 mnSourceOrder
;
63 sal_Int32 mnDestOrder
;
67 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
;
155 typedef std::map
< OUString
, css::uno::Reference
<css::xml::dom::XDocument
> > DiagramDomMap
;
156 typedef css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> > DiagramRelsMap
;
161 ::std::vector
<OUString
> maExtDrawings
;
162 typedef std::map
< OUString
, dgm::Point
* > PointNameMap
;
163 typedef std::map
< OUString
,
164 std::vector
<dgm::Point
*> > PointsNameMap
;
165 typedef std::map
< OUString
, const dgm::Connection
* > ConnectionNameMap
;
166 typedef std::map
< OUString
,
167 std::vector
<std::pair
<OUString
,sal_Int32
> > > StringMap
;
170 FillPropertiesPtr
& getFillProperties()
171 { return mpFillProperties
; }
172 dgm::Connections
& getConnections()
173 { return maConnections
; }
174 dgm::Points
& getPoints()
176 ConnectionNameMap
& getConnectionNameMap()
177 { return maConnectionNameMap
; }
178 StringMap
& getPresOfNameMap()
179 { return maPresOfNameMap
; }
180 PointNameMap
& getPointNameMap()
181 { return maPointNameMap
; }
182 PointsNameMap
& getPointsPresNameMap()
183 { return maPointsPresNameMap
; }
184 ::std::vector
<OUString
> &getExtDrawings()
185 { return maExtDrawings
; }
188 FillPropertiesPtr mpFillProperties
;
189 dgm::Connections maConnections
;
190 dgm::Points maPoints
;
191 PointNameMap maPointNameMap
;
192 PointsNameMap maPointsPresNameMap
;
193 ConnectionNameMap maConnectionNameMap
;
194 StringMap maPresOfNameMap
;
197 typedef boost::shared_ptr
< DiagramData
> DiagramDataPtr
;
202 void setDefStyle( const OUString
& sDefStyle
)
203 { msDefStyle
= sDefStyle
; }
204 void setMinVer( const OUString
& sMinVer
)
205 { msMinVer
= sMinVer
; }
206 void setUniqueId( const OUString
& sUniqueId
)
207 { msUniqueId
= sUniqueId
; }
208 const OUString
& getUniqueId()
209 { return msUniqueId
; }
210 void setTitle( const OUString
& sTitle
)
211 { msTitle
= sTitle
; }
212 void setDesc( const OUString
& sDesc
)
215 LayoutNodePtr
& getNode()
217 const LayoutNodePtr
& getNode() const
219 DiagramDataPtr
& getSampData()
220 { return mpSampData
; }
221 const DiagramDataPtr
& getSampData() const
222 { return mpSampData
; }
223 DiagramDataPtr
& getStyleData()
224 { return mpStyleData
; }
225 const DiagramDataPtr
& getStyleData() const
226 { return mpStyleData
; }
235 LayoutNodePtr mpNode
;
236 DiagramDataPtr mpSampData
;
237 DiagramDataPtr mpStyleData
;
243 typedef boost::shared_ptr
< DiagramLayout
> DiagramLayoutPtr
;
247 ShapeStyleRef maFillStyle
;
248 ShapeStyleRef maLineStyle
;
249 ShapeStyleRef maEffectStyle
;
250 ShapeStyleRef maTextStyle
;
253 typedef std::map
<OUString
,DiagramStyle
> DiagramQStyleMap
;
257 oox::drawingml::Color maFillColor
;
258 oox::drawingml::Color maLineColor
;
259 oox::drawingml::Color maEffectColor
;
260 oox::drawingml::Color maTextFillColor
;
261 oox::drawingml::Color maTextLineColor
;
262 oox::drawingml::Color maTextEffectColor
;
265 typedef std::map
<OUString
,DiagramColor
> DiagramColorMap
;
270 void setData( const DiagramDataPtr
& );
271 DiagramDataPtr
getData() const
275 void setLayout( const DiagramLayoutPtr
& );
276 DiagramLayoutPtr
getLayout() const
281 DiagramQStyleMap
& getStyles() { return maStyles
; }
282 const DiagramQStyleMap
& getStyles() const { return maStyles
; }
283 DiagramColorMap
& getColors() { return maColors
; }
284 const DiagramColorMap
& getColors() const { return maColors
; }
285 DiagramDomMap
& getDomMap() { return maMainDomMap
; }
286 DiagramRelsMap
& getDataRelsMap() { return maDataRelsMap
; }
287 void addTo( const ShapePtr
& pShape
);
289 css::uno::Sequence
<css::beans::PropertyValue
> getDomsAsPropertyValues() const;
292 DiagramDataPtr mpData
;
293 DiagramLayoutPtr mpLayout
;
294 DiagramQStyleMap maStyles
;
295 DiagramColorMap maColors
;
296 std::map
< OUString
, ShapePtr
> maShapeMap
;
297 DiagramDomMap maMainDomMap
;
298 DiagramRelsMap maDataRelsMap
;
301 typedef boost::shared_ptr
< Diagram
> DiagramPtr
;
307 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */