bump product version to 4.1.6.2
[LibreOffice.git] / xmloff / source / chart / SchXMLPlotAreaContext.hxx
blobcf945c142567b296daf8764da5bc7f01503b35ed
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 _SCH_XMLPLOTAREACONTEXT_HXX_
20 #define _SCH_XMLPLOTAREACONTEXT_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 // ----------------------------------------
47 class SchXML3DSceneAttributesHelper : public SdXML3DSceneAttributesHelper
49 public:
50 SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
51 virtual ~SchXML3DSceneAttributesHelper();
53 void getCameraDefaultFromDiagram( const ::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram );
55 private:
56 SchXML3DSceneAttributesHelper();
59 // ----------------------------------------
61 class SchXMLPositonAttributesHelper
63 public:
64 SchXMLPositonAttributesHelper( SvXMLImport& rImporter );
65 ~SchXMLPositonAttributesHelper();
67 bool readPositioningAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue );
68 void readAutomaticPositioningProperties( XMLPropStyleContext* pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
70 bool hasPosSize() const;
71 bool isAutomatic() const;
72 ::com::sun::star::awt::Rectangle getRectangle() const;
75 private:
76 bool hasSize() const;
77 bool hasPosition() const;
79 SvXMLImport& m_rImport;
81 ::com::sun::star::awt::Point m_aPosition;
82 ::com::sun::star::awt::Size m_aSize;
84 bool m_bHasSizeWidth;
85 bool m_bHasSizeHeight;
86 bool m_bHasPositionX;
87 bool m_bHasPositionY;
88 sal_Bool m_bAutoSize;
89 sal_Bool m_bAutoPosition;
92 // ----------------------------------------
94 class SchXMLPlotAreaContext : public SvXMLImportContext
96 public:
97 SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
98 SvXMLImport& rImport, const OUString& rLocalName,
99 const OUString& rXLinkHRefAttributeToIndicateDataProvider,
100 OUString& rCategoriesAddress,
101 OUString& rChartAddress,
102 bool& bHasRangeAtPlotArea,
103 sal_Bool & rAllRangeAddressesAvailable,
104 sal_Bool & rColHasLabels,
105 sal_Bool & rRowHasLabels,
106 ::com::sun::star::chart::ChartDataRowSource & rDataRowSource,
107 SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
108 const OUString& aChartTypeServiceName,
109 tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
110 const ::com::sun::star::awt::Size & rChartSize );
111 virtual ~SchXMLPlotAreaContext();
113 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
114 virtual SvXMLImportContext* CreateChildContext(
115 sal_uInt16 nPrefix,
116 const OUString& rLocalName,
117 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
118 virtual void EndElement();
120 private:
121 SchXMLImportHelper& mrImportHelper;
122 ::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
123 ::com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > mxNewDoc;
124 ::std::vector< SchXMLAxis > maAxes;
125 OUString& mrCategoriesAddress;
126 SeriesDefaultsAndStyles& mrSeriesDefaultsAndStyles;
127 sal_Int32 mnNumOfLinesProp;
128 sal_Bool mbStockHasVolume;
129 sal_Int32 mnSeries;
130 GlobalSeriesImportInfo m_aGlobalSeriesImportInfo;
132 SchXML3DSceneAttributesHelper maSceneImportHelper;
133 SchXMLPositonAttributesHelper m_aOuterPositioning;//including axes and axes titles
134 SchXMLPositonAttributesHelper m_aInnerPositioning;//excluding axes and axes titles
135 bool mbPercentStacked;
136 bool m_bAxisPositionAttributeImported;
137 OUString msAutoStyleName;
138 const OUString& m_rXLinkHRefAttributeToIndicateDataProvider;
139 OUString& mrChartAddress;
140 bool& m_rbHasRangeAtPlotArea;
141 sal_Bool & mrColHasLabels;
142 sal_Bool & mrRowHasLabels;
143 ::com::sun::star::chart::ChartDataRowSource & mrDataRowSource;
144 OUString maChartTypeServiceName;
146 tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
148 bool mbGlobalChartTypeUsedBySeries;
149 ::com::sun::star::awt::Size maChartSize;
152 //----------------------------------------
154 class SchXMLDataPointContext : public SvXMLImportContext
156 private:
157 ::std::list< DataRowPointStyle >& mrStyleList;
158 ::com::sun::star::uno::Reference<
159 ::com::sun::star::chart2::XDataSeries > m_xSeries;
160 sal_Int32& mrIndex;
161 bool mbSymbolSizeForSeriesIsMissingInFile;
163 public:
164 SchXMLDataPointContext( SvXMLImport& rImport, const OUString& rLocalName,
165 ::std::list< DataRowPointStyle >& rStyleList,
166 const ::com::sun::star::uno::Reference<
167 ::com::sun::star::chart2::XDataSeries >& xSeries, sal_Int32& rIndex,
168 bool bSymbolSizeForSeriesIsMissingInFile );
169 virtual ~SchXMLDataPointContext();
171 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
174 // ----------------------------------------
176 class SchXMLCoordinateRegionContext : public SvXMLImportContext
178 public:
179 SchXMLCoordinateRegionContext(
180 SvXMLImport& rImport
181 , sal_uInt16 nPrefix
182 , const OUString& rLocalName
183 , SchXMLPositonAttributesHelper& rPositioning );
184 virtual ~SchXMLCoordinateRegionContext();
185 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
187 private:
188 SchXMLPositonAttributesHelper& m_rPositioning;
191 // ----------------------------------------
193 class SchXMLWallFloorContext : public SvXMLImportContext
195 public:
196 enum ContextType
198 CONTEXT_TYPE_WALL,
199 CONTEXT_TYPE_FLOOR
202 private:
203 SchXMLImportHelper& mrImportHelper;
204 ::com::sun::star::uno::Reference< ::com::sun::star::chart::X3DDisplay > mxWallFloorSupplier;
205 ContextType meContextType;
207 public:
208 SchXMLWallFloorContext( SchXMLImportHelper& rImportHelper,
209 SvXMLImport& rImport,
210 sal_uInt16 nPrefix,
211 const OUString& rLocalName,
212 ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
213 ContextType eContextType );
214 virtual ~SchXMLWallFloorContext();
215 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
218 // ----------------------------------------
220 class SchXMLStockContext : public SvXMLImportContext
222 public:
223 enum ContextType
225 CONTEXT_TYPE_GAIN,
226 CONTEXT_TYPE_LOSS,
227 CONTEXT_TYPE_RANGE
230 private:
231 SchXMLImportHelper& mrImportHelper;
232 ::com::sun::star::uno::Reference< ::com::sun::star::chart::XStatisticDisplay > mxStockPropProvider;
233 ContextType meContextType;
235 public:
236 SchXMLStockContext( SchXMLImportHelper& rImportHelper,
237 SvXMLImport& rImport,
238 sal_uInt16 nPrefix,
239 const OUString& rLocalName,
240 ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
241 ContextType eContextType );
242 virtual ~SchXMLStockContext();
243 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
246 // ----------------------------------------
248 class SchXMLStatisticsObjectContext : public SvXMLImportContext
250 public:
251 enum ContextType
253 CONTEXT_TYPE_MEAN_VALUE_LINE,
254 CONTEXT_TYPE_REGRESSION_CURVE,
255 CONTEXT_TYPE_ERROR_INDICATOR
258 SchXMLStatisticsObjectContext(
259 SchXMLImportHelper& rImportHelper,
260 SvXMLImport& rImport,
261 sal_uInt16 nPrefix,
262 const OUString& rLocalName,
263 const OUString &rSeriesStyleName,
264 ::std::list< DataRowPointStyle >& rStyleList,
265 const ::com::sun::star::uno::Reference<
266 ::com::sun::star::chart2::XDataSeries >& xSeries,
267 ContextType eContextType,
268 const ::com::sun::star::awt::Size & rChartSize,
269 tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
271 virtual ~SchXMLStatisticsObjectContext();
273 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
274 virtual SvXMLImportContext* CreateChildContext(
275 sal_uInt16 nPrefix,
276 const OUString& rLocalName,
277 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
279 private:
280 SchXMLImportHelper & mrImportHelper;
281 ::std::list< DataRowPointStyle > & mrStyleList;
282 ::com::sun::star::uno::Reference<
283 ::com::sun::star::chart2::XDataSeries > m_xSeries;
284 ContextType meContextType;
285 ::com::sun::star::awt::Size maChartSize;
286 OUString maSeriesStyleName;
287 tSchXMLLSequencesPerIndex& mrLSequencesPerIndex;
290 // ----------------------------------------
292 class SchXMLEquationContext : public SvXMLImportContext
294 public:
295 SchXMLEquationContext(
296 SchXMLImportHelper& rImportHelper,
297 SvXMLImport& rImport,
298 sal_uInt16 nPrefix,
299 const OUString& rLocalName,
300 const ::com::sun::star::uno::Reference<
301 ::com::sun::star::chart2::XDataSeries >& xSeries,
302 const ::com::sun::star::awt::Size & rChartSize,
303 DataRowPointStyle & rRegressionStyle );
305 virtual ~SchXMLEquationContext();
307 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
309 private:
310 SchXMLImportHelper & mrImportHelper;
311 DataRowPointStyle & mrRegressionStyle;
312 ::com::sun::star::uno::Reference<
313 ::com::sun::star::chart2::XDataSeries > m_xSeries;
314 ::com::sun::star::awt::Size maChartSize;
317 #endif // _SCH_XMLPLOTAREACONTEXT_HXX_
319 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */