1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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"
32 namespace com
{ namespace sun
{ namespace star
{
36 class XStatisticDisplay
;
41 namespace xml
{ namespace sax
{
45 class SchXML3DSceneAttributesHelper
: public SdXML3DSceneAttributesHelper
48 explicit SchXML3DSceneAttributesHelper( SvXMLImport
& rImporter
);
49 virtual ~SchXML3DSceneAttributesHelper();
51 void getCameraDefaultFromDiagram( const css::uno::Reference
< css::chart::XDiagram
>& xDiagram
);
54 class SchXMLPositionAttributesHelper
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
);}
69 bool hasPosition() const;
71 SvXMLImport
& m_rImport
;
73 css::awt::Point m_aPosition
;
74 css::awt::Size m_aSize
;
77 bool m_bHasSizeHeight
;
84 class SchXMLPlotAreaContext
: public SvXMLImportContext
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
,
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(
106 const OUString
& rLocalName
,
107 const css::uno::Reference
< css::xml::sax::XAttributeList
>& xAttrList
) override
;
108 virtual void EndElement() override
;
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
;
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
145 ::std::list
< DataRowPointStyle
>& mrStyleList
;
146 css::uno::Reference
< css::chart2::XDataSeries
> m_xSeries
;
148 bool mbSymbolSizeForSeriesIsMissingInFile
;
151 SchXMLDataPointContext( SvXMLImport
& rImport
, const OUString
& rLocalName
,
152 ::std::list
< DataRowPointStyle
>& rStyleList
,
153 const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
,
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
164 SchXMLCoordinateRegionContext(
167 , const OUString
& rLocalName
168 , SchXMLPositionAttributesHelper
& rPositioning
);
169 virtual ~SchXMLCoordinateRegionContext();
170 virtual void StartElement( const css::uno::Reference
< css::xml::sax::XAttributeList
>& xAttrList
) override
;
173 SchXMLPositionAttributesHelper
& m_rPositioning
;
176 class SchXMLWallFloorContext
: public SvXMLImportContext
186 SchXMLImportHelper
& mrImportHelper
;
187 css::uno::Reference
< css::chart::X3DDisplay
> mxWallFloorSupplier
;
188 ContextType meContextType
;
191 SchXMLWallFloorContext( SchXMLImportHelper
& rImportHelper
,
192 SvXMLImport
& rImport
,
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
212 SchXMLImportHelper
& mrImportHelper
;
213 css::uno::Reference
< css::chart::XStatisticDisplay
> mxStockPropProvider
;
214 ContextType meContextType
;
217 SchXMLStockContext( SchXMLImportHelper
& rImportHelper
,
218 SvXMLImport
& rImport
,
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
232 CONTEXT_TYPE_MEAN_VALUE_LINE
,
233 CONTEXT_TYPE_ERROR_INDICATOR
236 SchXMLStatisticsObjectContext(
237 SchXMLImportHelper
& rImportHelper
,
238 SvXMLImport
& rImport
,
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(
252 const OUString
& rLocalName
,
253 const css::uno::Reference
< css::xml::sax::XAttributeList
>& xAttrList
) override
;
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: */