LibreOffice Module oox (master) 1
oox/source/drawingml/diagram/diagram.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAM_HXX
21#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAM_HXX
22
23#include <map>
24#include <memory>
25#include <vector>
26
27#include <rtl/ustring.hxx>
28
29#include "datamodel.hxx"
31
32namespace com::sun::star {
33 namespace xml::dom { class XDocument; }
34}
35
36namespace oox::drawingml {
37
38class Diagram;
39class LayoutNode;
40typedef std::shared_ptr< LayoutNode > LayoutNodePtr;
41class LayoutAtom;
42typedef std::shared_ptr< LayoutAtom > LayoutAtomPtr;
43typedef std::map< OUString, css::uno::Reference<css::xml::dom::XDocument> > DiagramDomMap;
44typedef std::map< OUString, LayoutAtomPtr > LayoutAtomMap;
45typedef std::map< const svx::diagram::Point*, ShapePtr > PresPointShapeMap;
46
48{
49public:
51 : mrDgm(rDgm)
52 {
53 }
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 )
61 { msTitle = sTitle; }
62 void setDesc( const OUString & sDesc )
63 { msDesc = sDesc; }
64 Diagram& getDiagram() { return mrDgm; }
66 { return mpNode; }
67 const LayoutNodePtr & getNode() const
68 { return mpNode; }
70 { return mpSampData; }
72 { return mpSampData; }
74 { return mpStyleData; }
76 { return mpStyleData; }
78 { return maLayoutAtomMap; }
80 { return maPresPointShapeMap; }
81
82private:
84 OUString msDefStyle;
85 OUString msMinVer;
86 OUString msUniqueId;
87
88 OUString msTitle;
89 OUString msDesc;
93 // TODO
94 // catLst
95 // clrData
96
99};
100
101typedef std::shared_ptr< DiagramLayout > DiagramLayoutPtr;
102
104{
109};
110
111typedef std::map<OUString,DiagramStyle> DiagramQStyleMap;
112
114{
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;
121
122 static const oox::drawingml::Color&
123 getColorByIndex(const std::vector<oox::drawingml::Color>& rColors, sal_Int32 nIndex);
124};
125
126typedef std::map<OUString,DiagramColor> DiagramColorMap;
127
129{
130public:
131 explicit Diagram();
133 { mpData = pData; }
135 { return mpData; }
136 void setLayout( const DiagramLayoutPtr & pLayout )
137 { mpLayout = pLayout; }
139 { return mpLayout; }
140
142 const DiagramQStyleMap& getStyles() const { return maStyles; }
144 const DiagramColorMap& getColors() const { return maColors; }
146 css::uno::Sequence< css::uno::Sequence< css::uno::Any > > & getDataRelsMap() { return maDataRelsMap; }
147 void addTo( const ShapePtr & pShape );
148
149 css::uno::Sequence<css::beans::PropertyValue> getDomsAsPropertyValues() const;
152
153private:
154 // This contains groups of shapes: automatic font size is the same in each group.
156
162 css::uno::Sequence< css::uno::Sequence< css::uno::Any > > maDataRelsMap;
163};
164
165typedef std::shared_ptr< Diagram > DiagramPtr;
166
167}
168
169#endif
170
171/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OoxDiagramDataPtr & getSampData() const
const OoxDiagramDataPtr & getStyleData() const
css::uno::Sequence< css::uno::Sequence< css::uno::Any > > & getDataRelsMap()
const DiagramQStyleMap & getStyles() const
css::uno::Sequence< css::uno::Sequence< css::uno::Any > > maDataRelsMap
void addTo(const ShapePtr &pShape)
Definition: diagram.cxx:108
void setLayout(const DiagramLayoutPtr &pLayout)
oox::core::NamedShapePairs & getDiagramFontHeights()
const OoxDiagramDataPtr & getData() const
css::uno::Sequence< css::beans::PropertyValue > getDomsAsPropertyValues() const
Definition: diagram.cxx:152
const DiagramLayoutPtr & getLayout() const
const DiagramColorMap & getColors() const
abstract Atom for the layout
std::unique_ptr< sal_Int32[]> pData
std::map< OUString, ShapePairs > NamedShapePairs
std::shared_ptr< Diagram > DiagramPtr
std::shared_ptr< DiagramData > OoxDiagramDataPtr
Definition: datamodel.hxx:75
std::shared_ptr< Shape > ShapePtr
std::map< OUString, LayoutAtomPtr > LayoutAtomMap
std::shared_ptr< LayoutAtom > LayoutAtomPtr
std::map< const svx::diagram::Point *, ShapePtr > PresPointShapeMap
std::shared_ptr< LayoutNode > LayoutNodePtr
std::map< OUString, DiagramColor > DiagramColorMap
std::map< OUString, DiagramStyle > DiagramQStyleMap
std::map< OUString, css::uno::Reference< css::xml::dom::XDocument > > DiagramDomMap
std::shared_ptr< DiagramLayout > DiagramLayoutPtr
std::vector< oox::drawingml::Color > maTextEffectColors
static const oox::drawingml::Color & getColorByIndex(const std::vector< oox::drawingml::Color > &rColors, sal_Int32 nIndex)
Definition: diagram.cxx:432
std::vector< oox::drawingml::Color > maTextFillColors
std::vector< oox::drawingml::Color > maTextLineColors
std::vector< oox::drawingml::Color > maFillColors
std::vector< oox::drawingml::Color > maEffectColors
std::vector< oox::drawingml::Color > maLineColors