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 "datamodel.hxx"
30 #include <oox/drawingml/shape.hxx>
32 namespace com::sun::star
{
33 namespace xml::dom
{ class XDocument
; }
36 namespace oox::drawingml
{
40 typedef std::shared_ptr
< LayoutNode
> LayoutNodePtr
;
42 typedef std::shared_ptr
< LayoutAtom
> LayoutAtomPtr
;
43 typedef std::map
< OUString
, css::uno::Reference
<css::xml::dom::XDocument
> > DiagramDomMap
;
44 typedef std::map
< OUString
, LayoutAtomPtr
> LayoutAtomMap
;
45 typedef std::map
< const svx::diagram::Point
*, ShapePtr
> PresPointShapeMap
;
50 DiagramLayout(Diagram
& rDgm
)
54 void setDefStyle( const OUString
& sDefStyle
)
55 { msDefStyle
= sDefStyle
; }
56 void setMinVer( const OUString
& sMinVer
)
57 { msMinVer
= sMinVer
; }
58 void setUniqueId( const OUString
& sUniqueId
)
59 { msUniqueId
= sUniqueId
; }
60 void setTitle( const OUString
& sTitle
)
62 void setDesc( const OUString
& sDesc
)
64 Diagram
& getDiagram() { return mrDgm
; }
65 LayoutNodePtr
& getNode()
67 const LayoutNodePtr
& getNode() const
69 OoxDiagramDataPtr
& getSampData()
70 { return mpSampData
; }
71 const OoxDiagramDataPtr
& getSampData() const
72 { return mpSampData
; }
73 OoxDiagramDataPtr
& getStyleData()
74 { return mpStyleData
; }
75 const OoxDiagramDataPtr
& getStyleData() const
76 { return mpStyleData
; }
77 LayoutAtomMap
& getLayoutAtomMap()
78 { return maLayoutAtomMap
; }
79 PresPointShapeMap
& getPresPointShapeMap()
80 { return maPresPointShapeMap
; }
91 OoxDiagramDataPtr mpSampData
;
92 OoxDiagramDataPtr mpStyleData
;
97 LayoutAtomMap maLayoutAtomMap
;
98 PresPointShapeMap maPresPointShapeMap
;
101 typedef std::shared_ptr
< DiagramLayout
> DiagramLayoutPtr
;
105 ShapeStyleRef maFillStyle
;
106 ShapeStyleRef maLineStyle
;
107 ShapeStyleRef maEffectStyle
;
108 ShapeStyleRef maTextStyle
;
111 typedef std::map
<OUString
,DiagramStyle
> DiagramQStyleMap
;
115 std::vector
<oox::drawingml::Color
> maFillColors
;
116 std::vector
<oox::drawingml::Color
> maLineColors
;
117 std::vector
<oox::drawingml::Color
> maEffectColors
;
118 std::vector
<oox::drawingml::Color
> maTextFillColors
;
119 std::vector
<oox::drawingml::Color
> maTextLineColors
;
120 std::vector
<oox::drawingml::Color
> maTextEffectColors
;
122 static const oox::drawingml::Color
&
123 getColorByIndex(const std::vector
<oox::drawingml::Color
>& rColors
, sal_Int32 nIndex
);
126 typedef std::map
<OUString
,DiagramColor
> DiagramColorMap
;
132 void setData( OoxDiagramDataPtr
& pData
)
134 const OoxDiagramDataPtr
& getData() const
136 void setLayout( const DiagramLayoutPtr
& pLayout
)
137 { mpLayout
= pLayout
; }
138 const DiagramLayoutPtr
& getLayout() const
141 DiagramQStyleMap
& getStyles() { return maStyles
; }
142 const DiagramQStyleMap
& getStyles() const { return maStyles
; }
143 DiagramColorMap
& getColors() { return maColors
; }
144 const DiagramColorMap
& getColors() const { return maColors
; }
145 DiagramDomMap
& getDomMap() { return maMainDomMap
; }
146 css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> > & getDataRelsMap() { return maDataRelsMap
; }
147 void addTo( const ShapePtr
& pShape
, bool bCreate
);
149 css::uno::Sequence
<css::beans::PropertyValue
> getDomsAsPropertyValues() const;
150 oox::core::NamedShapePairs
& getDiagramFontHeights() { return maDiagramFontHeights
; }
151 void syncDiagramFontHeights();
154 // This contains groups of shapes: automatic font size is the same in each group.
155 oox::core::NamedShapePairs maDiagramFontHeights
;
157 OoxDiagramDataPtr mpData
;
158 DiagramLayoutPtr mpLayout
;
159 DiagramQStyleMap maStyles
;
160 DiagramColorMap maColors
;
161 DiagramDomMap maMainDomMap
;
162 css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> > maDataRelsMap
;
165 typedef std::shared_ptr
< Diagram
> DiagramPtr
;
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */