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_SCHXMLSERIES2CONTEXT_HXX
20 #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLSERIES2CONTEXT_HXX
22 #include "transporttypes.hxx"
23 #include "SchXMLChartContext.hxx"
24 #include <xmloff/xmlictxt.hxx>
25 #include <xmloff/SchXMLImportHelper.hxx>
26 #include <xmloff/xmlstyle.hxx>
31 namespace com
{ namespace sun
{ namespace star
{
41 // class for child contexts: series, data point and statistics objects
42 class SchXMLSeries2Context
: public SvXMLImportContext
45 SchXMLImportHelper
& mrImportHelper
;
46 css::uno::Reference
< css::chart2::XChartDocument
> mxNewDoc
;
47 ::std::vector
< SchXMLAxis
>& mrAxes
;
48 ::std::list
< DataRowPointStyle
>& mrStyleList
;
49 ::std::list
< RegressionStyle
>& mrRegressionStyleList
;
51 css::uno::Reference
< css::chart2::XDataSeries
> m_xSeries
;
52 sal_Int32 mnSeriesIndex
;
53 sal_Int32 mnDataPointIndex
;
54 bool m_bStockHasVolume
;
56 GlobalSeriesImportInfo
& m_rGlobalSeriesImportInfo
;
58 SchXMLAxis
* mpAttachedAxis
;
59 sal_Int32 mnAttachedAxis
;
60 OUString msAutoStyleName
;
61 ::std::vector
< OUString
> maDomainAddresses
;
62 OUString maGlobalChartTypeName
;
63 OUString maSeriesChartTypeName
;
64 OUString m_aSeriesRange
;
65 bool m_bHasDomainContext
;
66 tSchXMLLSequencesPerIndex
& mrLSequencesPerIndex
;
67 tSchXMLLSequencesPerIndex maPostponedSequences
;
68 bool& mrGlobalChartTypeUsedBySeries
;
69 bool mbSymbolSizeIsMissingInFile
;
70 css::awt::Size maChartSize
;
73 SchXMLSeries2Context( SchXMLImportHelper
& rImpHelper
,
74 SvXMLImport
& rImport
, const OUString
& rLocalName
,
75 const css::uno::Reference
< css::chart2::XChartDocument
> & xNewDoc
,
76 std::vector
< SchXMLAxis
>& rAxes
,
77 ::std::list
< DataRowPointStyle
>& rStyleList
,
78 ::std::list
< RegressionStyle
>& rRegressionStyleList
,
79 sal_Int32 nSeriesIndex
,
81 GlobalSeriesImportInfo
& rGlobalSeriesImportInfo
,
82 const OUString
& aGlobalChartTypeName
,
83 tSchXMLLSequencesPerIndex
& rLSequencesPerIndex
,
84 bool& rGlobalChartTypeUsedBySeries
,
85 const css::awt::Size
& rChartSize
);
86 virtual ~SchXMLSeries2Context();
88 virtual void StartElement( const css::uno::Reference
< css::xml::sax::XAttributeList
>& xAttrList
) override
;
89 virtual SvXMLImportContext
* CreateChildContext(
91 const OUString
& rLocalName
,
92 const css::uno::Reference
< css::xml::sax::XAttributeList
>& xAttrList
) override
;
93 virtual void EndElement() override
;
95 static void initSeriesPropertySets( SeriesDefaultsAndStyles
& rSeriesDefaultsAndStyles
96 , const css::uno::Reference
< css::frame::XModel
>& xChartModel
);
98 static void setDefaultsToSeries( SeriesDefaultsAndStyles
& rSeriesDefaultsAndStyles
);
100 static void setStylesToSeries( SeriesDefaultsAndStyles
& rSeriesDefaultsAndStyles
101 , const SvXMLStylesContext
* pStylesCtxt
102 , const SvXMLStyleContext
*& rpStyle
103 , OUString
& rCurrStyleName
104 , SchXMLImportHelper
& rImportHelper
105 , const SvXMLImport
& rImport
107 , tSchXMLLSequencesPerIndex
& rInOutLSequencesPerIndex
);
109 static void setStylesToStatisticsObjects( SeriesDefaultsAndStyles
& rSeriesDefaultsAndStyles
110 , const SvXMLStylesContext
* pStylesCtxt
111 , const SvXMLStyleContext
*& rpStyle
112 , OUString
&rCurrStyleName
);
114 static void setStylesToRegressionCurves(
115 SeriesDefaultsAndStyles
& rSeriesDefaultsAndStyles
,
116 const SvXMLStylesContext
* pStylesCtxt
,
117 const SvXMLStyleContext
*& rpStyle
,
118 OUString
&rCurrStyleName
);
120 static void setStylesToDataPoints( SeriesDefaultsAndStyles
& rSeriesDefaultsAndStyles
121 , const SvXMLStylesContext
* pStylesCtxt
122 , const SvXMLStyleContext
*& rpStyle
123 , OUString
& rCurrStyleName
124 , SchXMLImportHelper
& rImportHelper
125 , const SvXMLImport
& rImport
126 , bool bIsStockChart
, bool bIsDonutChart
, bool bSwitchOffLinesForScatter
);
128 static void switchSeriesLinesOff( ::std::list
< DataRowPointStyle
>& rSeriesStyleList
);
131 // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLSERIES2CONTEXT_HXX
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */