Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / xmloff / source / chart / SchXMLPlotAreaContext.hxx
blob2380e3b56ece6360b5d83d90fc2f33e742263cc4
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 .
19 #ifndef INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLPLOTAREACONTEXT_HXX
20 #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLPLOTAREACONTEXT_HXX
22 #include "SchXMLImport.hxx"
23 #include "SchXMLChartContext.hxx"
24 #include <xmloff/xmlictxt.hxx>
25 #include <xmloff/shapeimport.hxx>
26 #include <com/sun/star/chart/ChartDataRowSource.hpp>
28 #include "transporttypes.hxx"
30 class SvXMLImport;
32 namespace com { namespace sun { namespace star {
33 namespace chart {
34 class XDiagram;
35 class X3DDisplay;
36 class XStatisticDisplay;
38 namespace chart2 {
39 class XChartDocument;
41 namespace xml { namespace sax {
42 class XAttributeList;
43 }}}}}
45 class SchXML3DSceneAttributesHelper : public SdXML3DSceneAttributesHelper
47 public:
48 explicit SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
49 virtual ~SchXML3DSceneAttributesHelper();
51 void getCameraDefaultFromDiagram( const css::uno::Reference< css::chart::XDiagram >& xDiagram );
54 class SchXMLPositionAttributesHelper
56 public:
57 explicit SchXMLPositionAttributesHelper( SvXMLImport& rImporter );
58 ~SchXMLPositionAttributesHelper();
60 void readPositioningAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue );
61 void readAutomaticPositioningProperties( XMLPropStyleContext* pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
63 bool hasPosSize() const;
64 bool isAutomatic() const;
65 css::awt::Rectangle getRectangle() const { return css::awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height );}
67 private:
68 bool hasSize() const;
69 bool hasPosition() const;
71 SvXMLImport& m_rImport;
73 css::awt::Point m_aPosition;
74 css::awt::Size m_aSize;
76 bool m_bHasSizeWidth;
77 bool m_bHasSizeHeight;
78 bool m_bHasPositionX;
79 bool m_bHasPositionY;
80 bool m_bAutoSize;
81 bool m_bAutoPosition;
84 class SchXMLPlotAreaContext : public SvXMLImportContext
86 public:
87 SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
88 SvXMLImport& rImport, const OUString& rLocalName,
89 const OUString& rXLinkHRefAttributeToIndicateDataProvider,
90 OUString& rCategoriesAddress,
91 OUString& rChartAddress,
92 bool& bHasRangeAtPlotArea,
93 bool & rAllRangeAddressesAvailable,
94 bool & rColHasLabels,
95 bool & rRowHasLabels,
96 css::chart::ChartDataRowSource & rDataRowSource,
97 SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
98 const OUString& aChartTypeServiceName,
99 tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
100 const css::awt::Size & rChartSize );
101 virtual ~SchXMLPlotAreaContext();
103 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
104 virtual SvXMLImportContext* CreateChildContext(
105 sal_uInt16 nPrefix,
106 const OUString& rLocalName,
107 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
108 virtual void EndElement() override;
110 private:
111 SchXMLImportHelper& mrImportHelper;
112 css::uno::Reference< css::chart::XDiagram > mxDiagram;
113 css::uno::Reference< css::chart2::XChartDocument > mxNewDoc;
114 ::std::vector< SchXMLAxis > maAxes;
115 OUString& mrCategoriesAddress;
116 SeriesDefaultsAndStyles& mrSeriesDefaultsAndStyles;
117 sal_Int32 mnNumOfLinesProp;
118 bool mbStockHasVolume;
119 sal_Int32 mnSeries;
120 GlobalSeriesImportInfo m_aGlobalSeriesImportInfo;
122 SchXML3DSceneAttributesHelper maSceneImportHelper;
123 SchXMLPositionAttributesHelper m_aOuterPositioning;//including axes and axes titles
124 SchXMLPositionAttributesHelper m_aInnerPositioning;//excluding axes and axes titles
125 bool mbPercentStacked;
126 bool m_bAxisPositionAttributeImported;
127 OUString msAutoStyleName;
128 const OUString& m_rXLinkHRefAttributeToIndicateDataProvider;
129 OUString& mrChartAddress;
130 bool& m_rbHasRangeAtPlotArea;
131 bool & mrColHasLabels;
132 bool & mrRowHasLabels;
133 css::chart::ChartDataRowSource & mrDataRowSource;
134 OUString maChartTypeServiceName;
136 tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
138 bool mbGlobalChartTypeUsedBySeries;
139 css::awt::Size maChartSize;
142 class SchXMLDataPointContext : public SvXMLImportContext
144 private:
145 ::std::list< DataRowPointStyle >& mrStyleList;
146 css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
147 sal_Int32& mrIndex;
148 bool mbSymbolSizeForSeriesIsMissingInFile;
150 public:
151 SchXMLDataPointContext( SvXMLImport& rImport, const OUString& rLocalName,
152 ::std::list< DataRowPointStyle >& rStyleList,
153 const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
154 sal_Int32& rIndex,
155 bool bSymbolSizeForSeriesIsMissingInFile );
156 virtual ~SchXMLDataPointContext();
158 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
161 class SchXMLCoordinateRegionContext : public SvXMLImportContext
163 public:
164 SchXMLCoordinateRegionContext(
165 SvXMLImport& rImport
166 , sal_uInt16 nPrefix
167 , const OUString& rLocalName
168 , SchXMLPositionAttributesHelper& rPositioning );
169 virtual ~SchXMLCoordinateRegionContext();
170 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
172 private:
173 SchXMLPositionAttributesHelper& m_rPositioning;
176 class SchXMLWallFloorContext : public SvXMLImportContext
178 public:
179 enum ContextType
181 CONTEXT_TYPE_WALL,
182 CONTEXT_TYPE_FLOOR
185 private:
186 SchXMLImportHelper& mrImportHelper;
187 css::uno::Reference< css::chart::X3DDisplay > mxWallFloorSupplier;
188 ContextType meContextType;
190 public:
191 SchXMLWallFloorContext( SchXMLImportHelper& rImportHelper,
192 SvXMLImport& rImport,
193 sal_uInt16 nPrefix,
194 const OUString& rLocalName,
195 css::uno::Reference< css::chart::XDiagram >& xDiagram,
196 ContextType eContextType );
197 virtual ~SchXMLWallFloorContext();
198 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
201 class SchXMLStockContext : public SvXMLImportContext
203 public:
204 enum ContextType
206 CONTEXT_TYPE_GAIN,
207 CONTEXT_TYPE_LOSS,
208 CONTEXT_TYPE_RANGE
211 private:
212 SchXMLImportHelper& mrImportHelper;
213 css::uno::Reference< css::chart::XStatisticDisplay > mxStockPropProvider;
214 ContextType meContextType;
216 public:
217 SchXMLStockContext( SchXMLImportHelper& rImportHelper,
218 SvXMLImport& rImport,
219 sal_uInt16 nPrefix,
220 const OUString& rLocalName,
221 css::uno::Reference< css::chart::XDiagram >& xDiagram,
222 ContextType eContextType );
223 virtual ~SchXMLStockContext();
224 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
227 class SchXMLStatisticsObjectContext : public SvXMLImportContext
229 public:
230 enum ContextType
232 CONTEXT_TYPE_MEAN_VALUE_LINE,
233 CONTEXT_TYPE_ERROR_INDICATOR
236 SchXMLStatisticsObjectContext(
237 SchXMLImportHelper& rImportHelper,
238 SvXMLImport& rImport,
239 sal_uInt16 nPrefix,
240 const OUString& rLocalName,
241 const OUString &rSeriesStyleName,
242 ::std::list< DataRowPointStyle >& rStyleList,
243 const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
244 ContextType eContextType,
245 tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
247 virtual ~SchXMLStatisticsObjectContext();
249 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
250 virtual SvXMLImportContext* CreateChildContext(
251 sal_uInt16 nPrefix,
252 const OUString& rLocalName,
253 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
255 private:
256 SchXMLImportHelper & mrImportHelper;
257 ::std::list< DataRowPointStyle > & mrStyleList;
258 css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
259 ContextType meContextType;
260 OUString maSeriesStyleName;
261 tSchXMLLSequencesPerIndex& mrLSequencesPerIndex;
264 #endif // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLPLOTAREACONTEXT_HXX
266 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */