Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / oox / source / drawingml / diagram / diagram.hxx
blob576c4007e29f0ef69e53b1b3c99a9cf013da87ac
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
23 #include <map>
24 #include <memory>
26 #include <rtl/ustring.hxx>
28 #include "datamodel.hxx"
29 #include <oox/drawingml/shape.hxx>
31 namespace com { namespace sun { namespace star {
32 namespace xml { namespace dom { class XDocument; } }
33 } } }
35 namespace oox { namespace drawingml {
37 class Diagram;
38 class LayoutNode;
39 typedef std::shared_ptr< LayoutNode > LayoutNodePtr;
40 class LayoutAtom;
41 typedef std::shared_ptr<LayoutAtom> LayoutAtomPtr;
43 typedef std::map< OUString, css::uno::Reference<css::xml::dom::XDocument> > DiagramDomMap;
45 typedef std::map<OUString, LayoutAtomPtr> LayoutAtomMap;
46 typedef std::map<const dgm::Point*, ShapePtr> PresPointShapeMap;
48 class DiagramLayout
50 public:
51 DiagramLayout(const Diagram& rDgm) : mrDgm(rDgm) {}
52 void setDefStyle( const OUString & sDefStyle )
53 { msDefStyle = sDefStyle; }
54 void setMinVer( const OUString & sMinVer )
55 { msMinVer = sMinVer; }
56 void setUniqueId( const OUString & sUniqueId )
57 { msUniqueId = sUniqueId; }
58 void setTitle( const OUString & sTitle )
59 { msTitle = sTitle; }
60 void setDesc( const OUString & sDesc )
61 { msDesc = sDesc; }
62 const Diagram& getDiagram() const
63 { return mrDgm; }
64 LayoutNodePtr & getNode()
65 { return mpNode; }
66 const LayoutNodePtr & getNode() const
67 { return mpNode; }
68 DiagramDataPtr & getSampData()
69 { return mpSampData; }
70 const DiagramDataPtr & getSampData() const
71 { return mpSampData; }
72 DiagramDataPtr & getStyleData()
73 { return mpStyleData; }
74 const DiagramDataPtr & getStyleData() const
75 { return mpStyleData; }
76 LayoutAtomMap & getLayoutAtomMap()
77 { return maLayoutAtomMap; }
78 PresPointShapeMap & getPresPointShapeMap()
79 { return maPresPointShapeMap; }
81 private:
82 const Diagram& mrDgm;
83 OUString msDefStyle;
84 OUString msMinVer;
85 OUString msUniqueId;
87 OUString msTitle;
88 OUString msDesc;
89 LayoutNodePtr mpNode;
90 DiagramDataPtr mpSampData;
91 DiagramDataPtr mpStyleData;
92 // TODO
93 // catLst
94 // clrData
96 LayoutAtomMap maLayoutAtomMap;
97 PresPointShapeMap maPresPointShapeMap;
100 typedef std::shared_ptr< DiagramLayout > DiagramLayoutPtr;
102 struct DiagramStyle
104 ShapeStyleRef maFillStyle;
105 ShapeStyleRef maLineStyle;
106 ShapeStyleRef maEffectStyle;
107 ShapeStyleRef maTextStyle;
110 typedef std::map<OUString,DiagramStyle> DiagramQStyleMap;
112 struct DiagramColor
114 oox::drawingml::Color maFillColor;
115 oox::drawingml::Color maLineColor;
116 oox::drawingml::Color maEffectColor;
117 oox::drawingml::Color maTextFillColor;
118 oox::drawingml::Color maTextLineColor;
119 oox::drawingml::Color maTextEffectColor;
122 typedef std::map<OUString,DiagramColor> DiagramColorMap;
124 class Diagram
126 public:
127 void setData( const DiagramDataPtr & pData )
128 { mpData = pData; }
129 const DiagramDataPtr& getData() const
130 { return mpData; }
131 void setLayout( const DiagramLayoutPtr & pLayout )
132 { mpLayout = pLayout; }
133 const DiagramLayoutPtr& getLayout() const
134 { return mpLayout; }
136 DiagramQStyleMap& getStyles() { return maStyles; }
137 const DiagramQStyleMap& getStyles() const { return maStyles; }
138 DiagramColorMap& getColors() { return maColors; }
139 const DiagramColorMap& getColors() const { return maColors; }
140 DiagramDomMap & getDomMap() { return maMainDomMap; }
141 css::uno::Sequence< css::uno::Sequence< css::uno::Any > > & getDataRelsMap() { return maDataRelsMap; }
142 void addTo( const ShapePtr & pShape );
144 css::uno::Sequence<css::beans::PropertyValue> getDomsAsPropertyValues() const;
145 private:
146 DiagramDataPtr mpData;
147 DiagramLayoutPtr mpLayout;
148 DiagramQStyleMap maStyles;
149 DiagramColorMap maColors;
150 DiagramDomMap maMainDomMap;
151 css::uno::Sequence< css::uno::Sequence< css::uno::Any > > maDataRelsMap;
154 typedef std::shared_ptr< Diagram > DiagramPtr;
158 #endif
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */