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 _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"
32 namespace com
{ namespace sun
{ namespace star
{
36 class XStatisticDisplay
;
41 namespace xml
{ namespace sax
{
45 // ----------------------------------------
47 class SchXML3DSceneAttributesHelper
: public SdXML3DSceneAttributesHelper
50 SchXML3DSceneAttributesHelper( SvXMLImport
& rImporter
);
51 virtual ~SchXML3DSceneAttributesHelper();
53 void getCameraDefaultFromDiagram( const ::com::sun::star::uno::Reference
< com::sun::star::chart::XDiagram
>& xDiagram
);
56 SchXML3DSceneAttributesHelper();
59 // ----------------------------------------
61 class SchXMLPositonAttributesHelper
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;
77 bool hasPosition() const;
79 SvXMLImport
& m_rImport
;
81 ::com::sun::star::awt::Point m_aPosition
;
82 ::com::sun::star::awt::Size m_aSize
;
85 bool m_bHasSizeHeight
;
89 sal_Bool m_bAutoPosition
;
92 // ----------------------------------------
94 class SchXMLPlotAreaContext
: public SvXMLImportContext
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(
116 const OUString
& rLocalName
,
117 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
118 virtual void EndElement();
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
;
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
157 ::std::list
< DataRowPointStyle
>& mrStyleList
;
158 ::com::sun::star::uno::Reference
<
159 ::com::sun::star::chart2::XDataSeries
> m_xSeries
;
161 bool mbSymbolSizeForSeriesIsMissingInFile
;
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
179 SchXMLCoordinateRegionContext(
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
);
188 SchXMLPositonAttributesHelper
& m_rPositioning
;
191 // ----------------------------------------
193 class SchXMLWallFloorContext
: public SvXMLImportContext
203 SchXMLImportHelper
& mrImportHelper
;
204 ::com::sun::star::uno::Reference
< ::com::sun::star::chart::X3DDisplay
> mxWallFloorSupplier
;
205 ContextType meContextType
;
208 SchXMLWallFloorContext( SchXMLImportHelper
& rImportHelper
,
209 SvXMLImport
& rImport
,
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
231 SchXMLImportHelper
& mrImportHelper
;
232 ::com::sun::star::uno::Reference
< ::com::sun::star::chart::XStatisticDisplay
> mxStockPropProvider
;
233 ContextType meContextType
;
236 SchXMLStockContext( SchXMLImportHelper
& rImportHelper
,
237 SvXMLImport
& rImport
,
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
253 CONTEXT_TYPE_MEAN_VALUE_LINE
,
254 CONTEXT_TYPE_REGRESSION_CURVE
,
255 CONTEXT_TYPE_ERROR_INDICATOR
258 SchXMLStatisticsObjectContext(
259 SchXMLImportHelper
& rImportHelper
,
260 SvXMLImport
& rImport
,
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(
276 const OUString
& rLocalName
,
277 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
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
295 SchXMLEquationContext(
296 SchXMLImportHelper
& rImportHelper
,
297 SvXMLImport
& rImport
,
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
);
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: */