bump product version to 7.6.3.2-android
[LibreOffice.git] / xmloff / source / chart / SchXMLPlotAreaContext.hxx
blobc6b74f0e0389a370e4f4605edbec9c5e60d95196
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 #pragma once
21 #include "SchXMLChartContext.hxx"
22 #include <rtl/ustrbuf.hxx>
23 #include <xmloff/xmlictxt.hxx>
24 #include <xmloff/prstylei.hxx>
25 #include <xmloff/shapeimport.hxx>
26 #include <com/sun/star/awt/Rectangle.hpp>
27 #include <com/sun/star/chart/ChartDataRowSource.hpp>
29 #include "transporttypes.hxx"
31 class SvXMLImport;
33 namespace com::sun::star {
34 namespace chart {
35 class XDiagram;
36 class X3DDisplay;
37 class XStatisticDisplay;
39 namespace chart2 {
40 class XChartDocument;
42 namespace xml::sax {
43 class XAttributeList;
47 class SchXML3DSceneAttributesHelper : public SdXML3DSceneAttributesHelper
49 public:
50 explicit SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
51 virtual ~SchXML3DSceneAttributesHelper();
53 void getCameraDefaultFromDiagram( const css::uno::Reference< css::chart::XDiagram >& xDiagram );
56 class SchXMLPositionAttributesHelper
58 public:
59 explicit SchXMLPositionAttributesHelper( SvXMLImport& rImporter );
61 void readPositioningAttribute( sal_Int32 nAttributeToken, std::string_view rValue );
62 void readAutomaticPositioningProperties( XMLPropStyleContext const * pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
64 bool hasPosSize() const;
65 bool isAutomatic() const;
66 css::awt::Rectangle getRectangle() const { return css::awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height );}
68 private:
69 SvXMLImport& m_rImport;
71 css::awt::Point m_aPosition;
72 css::awt::Size m_aSize;
74 bool m_bHasSizeWidth;
75 bool m_bHasSizeHeight;
76 bool m_bHasPositionX;
77 bool m_bHasPositionY;
78 bool m_bAutoSize;
79 bool m_bAutoPosition;
82 class SchXMLPlotAreaContext : public SvXMLImportContext
84 public:
85 SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
86 SvXMLImport& rImport,
87 const OUString& rXLinkHRefAttributeToIndicateDataProvider,
88 OUString& rCategoriesAddress,
89 OUString& rChartAddress,
90 bool& bHasRangeAtPlotArea,
91 bool & rAllRangeAddressesAvailable,
92 bool & rColHasLabels,
93 bool & rRowHasLabels,
94 css::chart::ChartDataRowSource & rDataRowSource,
95 SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
96 OUString aChartTypeServiceName,
97 tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
98 const css::awt::Size & rChartSize );
99 virtual ~SchXMLPlotAreaContext() override;
101 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
102 sal_Int32 nElement,
103 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
104 virtual void SAL_CALL startFastElement(
105 sal_Int32 nElement,
106 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
107 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
109 private:
110 SchXMLImportHelper& mrImportHelper;
111 css::uno::Reference< css::chart::XDiagram > mxDiagram;
112 css::uno::Reference< css::chart2::XChartDocument > mxNewDoc;
113 ::std::vector< SchXMLAxis > maAxes;
114 OUString& mrCategoriesAddress;
115 SeriesDefaultsAndStyles& mrSeriesDefaultsAndStyles;
116 sal_Int32 mnNumOfLinesProp;
117 bool mbStockHasVolume;
118 sal_Int32 mnSeries;
119 GlobalSeriesImportInfo m_aGlobalSeriesImportInfo;
121 SchXML3DSceneAttributesHelper maSceneImportHelper;
122 SchXMLPositionAttributesHelper m_aOuterPositioning;//including axes and axes titles
123 SchXMLPositionAttributesHelper m_aInnerPositioning;//excluding axes and axes titles
124 bool mbPercentStacked;
125 bool m_bAxisPositionAttributeImported;
126 OUString msAutoStyleName;
127 const OUString& m_rXLinkHRefAttributeToIndicateDataProvider;
128 OUString& mrChartAddress;
129 bool& m_rbHasRangeAtPlotArea;
130 bool & mrColHasLabels;
131 bool & mrRowHasLabels;
132 css::chart::ChartDataRowSource & mrDataRowSource;
133 OUString maChartTypeServiceName;
135 tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
137 bool mbGlobalChartTypeUsedBySeries;
138 css::awt::Size maChartSize;
141 class SchXMLDataLabelSpanContext: public SvXMLImportContext
143 private:
144 ::std::vector<OUString>& mrLabels;
145 OUStringBuffer maCharBuffer;
146 public:
147 SchXMLDataLabelSpanContext( SvXMLImport& rImport, ::std::vector<OUString>& rLabels);
148 virtual void SAL_CALL characters( const OUString& rChars ) override;
149 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
152 class SchXMLDataLabelParaContext: public SvXMLImportContext
154 private:
155 ::std::vector<OUString>& mrLabels;
156 public:
157 SchXMLDataLabelParaContext( SvXMLImport& rImport, ::std::vector<OUString>& rLabels);
158 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
159 sal_Int32 nElement,
160 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
163 class SchXMLDataLabelContext: public SvXMLImportContext
165 private:
166 CustomLabelsInfo& mrLabels;
167 DataRowPointStyle& mrDataLabelStyle;
168 public:
169 SchXMLDataLabelContext(SvXMLImport& rImport,
170 CustomLabelsInfo& rLabels, DataRowPointStyle& rDataLabel);
172 virtual void SAL_CALL startFastElement(
173 sal_Int32 nElement,
174 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
176 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
177 sal_Int32 nElement,
178 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
181 class SchXMLDataPointContext : public SvXMLImportContext
183 private:
184 ::std::vector<DataRowPointStyle>& mrStyleVector;
185 bool mbHasLabelParagraph = false;
186 sal_Int32& mrIndex;
187 DataRowPointStyle mDataPoint;
188 // We let the data point manage the DataRowPointStyle-struct of its data label
189 DataRowPointStyle mDataLabel;
191 public:
192 SchXMLDataPointContext( SvXMLImport& rImport,
193 ::std::vector< DataRowPointStyle >& rStyleVector,
194 const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
195 sal_Int32& rIndex,
196 bool bSymbolSizeForSeriesIsMissingInFile );
197 virtual ~SchXMLDataPointContext() override;
199 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
200 sal_Int32 nElement,
201 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
202 virtual void SAL_CALL startFastElement(
203 sal_Int32 nElement,
204 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
205 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
208 class SchXMLCoordinateRegionContext : public SvXMLImportContext
210 public:
211 SchXMLCoordinateRegionContext(
212 SvXMLImport& rImport
213 , SchXMLPositionAttributesHelper& rPositioning );
214 virtual ~SchXMLCoordinateRegionContext() override;
215 virtual void SAL_CALL startFastElement(
216 sal_Int32 nElement,
217 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
219 private:
220 SchXMLPositionAttributesHelper& m_rPositioning;
223 class SchXMLWallFloorContext : public SvXMLImportContext
225 public:
226 enum ContextType
228 CONTEXT_TYPE_WALL,
229 CONTEXT_TYPE_FLOOR
232 private:
233 SchXMLImportHelper& mrImportHelper;
234 css::uno::Reference< css::chart::X3DDisplay > mxWallFloorSupplier;
235 ContextType meContextType;
237 public:
238 SchXMLWallFloorContext( SchXMLImportHelper& rImportHelper,
239 SvXMLImport& rImport,
240 css::uno::Reference< css::chart::XDiagram > const & xDiagram,
241 ContextType eContextType );
242 virtual ~SchXMLWallFloorContext() override;
243 virtual void SAL_CALL startFastElement (sal_Int32 Element,
244 const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
247 class SchXMLStockContext : public SvXMLImportContext
249 public:
250 enum ContextType
252 CONTEXT_TYPE_GAIN,
253 CONTEXT_TYPE_LOSS,
254 CONTEXT_TYPE_RANGE
257 private:
258 SchXMLImportHelper& mrImportHelper;
259 css::uno::Reference< css::chart::XStatisticDisplay > mxStockPropProvider;
260 ContextType meContextType;
262 public:
263 SchXMLStockContext( SchXMLImportHelper& rImportHelper,
264 SvXMLImport& rImport,
265 css::uno::Reference< css::chart::XDiagram > const & xDiagram,
266 ContextType eContextType );
267 virtual ~SchXMLStockContext() override;
268 virtual void SAL_CALL startFastElement (sal_Int32 Element,
269 const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
272 class SchXMLStatisticsObjectContext : public SvXMLImportContext
274 public:
275 enum ContextType
277 CONTEXT_TYPE_MEAN_VALUE_LINE,
278 CONTEXT_TYPE_ERROR_INDICATOR
281 SchXMLStatisticsObjectContext(
282 SchXMLImportHelper& rImportHelper,
283 SvXMLImport& rImport,
284 OUString aSeriesStyleName,
285 ::std::vector< DataRowPointStyle >& rStyleVector,
286 css::uno::Reference< css::chart2::XDataSeries > xSeries,
287 ContextType eContextType,
288 tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
290 virtual ~SchXMLStatisticsObjectContext() override;
292 virtual void SAL_CALL startFastElement (sal_Int32 Element,
293 const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
295 private:
296 SchXMLImportHelper & mrImportHelper;
297 ::std::vector< DataRowPointStyle > & mrStyleVector;
298 css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
299 ContextType meContextType;
300 OUString maSeriesStyleName;
301 tSchXMLLSequencesPerIndex& mrLSequencesPerIndex;
304 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */