LibreOffice Module xmloff (master)  1
SchXMLSeries2Context.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLSERIES2CONTEXT_HXX
20 #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLSERIES2CONTEXT_HXX
21 
22 #include "transporttypes.hxx"
23 #include "SchXMLChartContext.hxx"
24 #include <xmloff/xmlictxt.hxx>
26 #include <xmloff/xmlstyle.hxx>
27 
28 #include <vector>
29 
30 namespace com::sun::star {
31  namespace chart2 {
32  class XChartDocument;
33  class XDataSeries;
34  }
35  namespace awt {
36  struct Size;
37  }
38 }
39 
40 // class for child contexts: series, data point and statistics objects
42 {
43 private:
45  css::uno::Reference< css::chart2::XChartDocument > mxNewDoc;
46  ::std::vector< SchXMLAxis >& mrAxes;
47  ::std::vector< DataRowPointStyle >& mrStyleVector;
48  ::std::vector< RegressionStyle >& mrRegressionStyleVector;
49  css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
50  sal_Int32 mnSeriesIndex;
51  sal_Int32 mnDataPointIndex;
53 
55 
57  sal_Int32 mnAttachedAxis;
58  OUString msAutoStyleName;
59  ::std::vector< OUString > maDomainAddresses;
62  OUString m_aSeriesRange;
68  css::awt::Size maChartSize;
69  // We let the series manage the DataRowPointStyle-struct of its data label
71 
72 public:
74  SvXMLImport& rImport,
75  const css::uno::Reference< css::chart2::XChartDocument > & xNewDoc,
76  std::vector< SchXMLAxis >& rAxes,
77  ::std::vector< DataRowPointStyle >& rStyleVector,
78  ::std::vector< RegressionStyle >& rRegressionStyleVector,
79  sal_Int32 nSeriesIndex,
80  bool bStockHasVolume,
81  GlobalSeriesImportInfo& rGlobalSeriesImportInfo,
82  const OUString & aGlobalChartTypeName,
83  tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
84  bool& rGlobalChartTypeUsedBySeries,
85  const css::awt::Size & rChartSize );
86  virtual ~SchXMLSeries2Context() override;
87 
88  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
89  sal_Int32 nElement,
90  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
91  virtual void SAL_CALL startFastElement(
92  sal_Int32 nElement,
93  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
94  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
95 
96  static void initSeriesPropertySets( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
97  , const css::uno::Reference< css::frame::XModel >& xChartModel );
98 
99  static void setDefaultsToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles );
100 
101  static void setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
102  , const SvXMLStylesContext* pStylesCtxt
103  , const SvXMLStyleContext*& rpStyle
104  , OUString& rCurrStyleName
105  , const SchXMLImportHelper& rImportHelper
106  , const SvXMLImport& rImport
107  , bool bIsStockChart
108  , tSchXMLLSequencesPerIndex & rInOutLSequencesPerIndex );
109 
110  static void setStylesToStatisticsObjects( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
111  , const SvXMLStylesContext* pStylesCtxt
112  , const SvXMLStyleContext*& rpStyle
113  , OUString &rCurrStyleName );
114 
115  static void setStylesToRegressionCurves(
116  SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
117  const SvXMLStylesContext* pStylesCtxt,
118  const SvXMLStyleContext*& rpStyle,
119  OUString const &rCurrStyleName );
120 
121  static void setStylesToDataPoints( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
122  , const SvXMLStylesContext* pStylesCtxt
123  , const SvXMLStyleContext*& rpStyle
124  , OUString& rCurrStyleName
125  , const SchXMLImportHelper& rImportHelper
126  , const SvXMLImport& rImport
127  , bool bIsStockChart, bool bIsDonutChart, bool bSwitchOffLinesForScatter );
128 
129  static void switchSeriesLinesOff( ::std::vector< DataRowPointStyle >& rSeriesStyleVector );
130 };
131 
132 // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLSERIES2CONTEXT_HXX
133 #endif
134 
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SchXMLSeries2Context(SchXMLImportHelper &rImpHelper, SvXMLImport &rImport, const css::uno::Reference< css::chart2::XChartDocument > &xNewDoc, std::vector< SchXMLAxis > &rAxes,::std::vector< DataRowPointStyle > &rStyleVector,::std::vector< RegressionStyle > &rRegressionStyleVector, sal_Int32 nSeriesIndex, bool bStockHasVolume, GlobalSeriesImportInfo &rGlobalSeriesImportInfo, const OUString &aGlobalChartTypeName, tSchXMLLSequencesPerIndex &rLSequencesPerIndex, bool &rGlobalChartTypeUsedBySeries, const css::awt::Size &rChartSize)
static void switchSeriesLinesOff(::std::vector< DataRowPointStyle > &rSeriesStyleVector)
tSchXMLLSequencesPerIndex maPostponedSequences
exports com.sun.star. awt
css::uno::Reference< css::chart2::XDataSeries > m_xSeries
static void setDefaultsToSeries(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles)
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex
exports com.sun.star. chart2
static void setStylesToStatisticsObjects(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const SvXMLStylesContext *pStylesCtxt, const SvXMLStyleContext *&rpStyle, OUString &rCurrStyleName)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
virtual ~SchXMLSeries2Context() override
::std::vector< OUString > maDomainAddresses
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
static void initSeriesPropertySets(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const css::uno::Reference< css::frame::XModel > &xChartModel)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
::std::vector< RegressionStyle > & mrRegressionStyleVector
static void setStylesToSeries(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const SvXMLStylesContext *pStylesCtxt, const SvXMLStyleContext *&rpStyle, OUString &rCurrStyleName, const SchXMLImportHelper &rImportHelper, const SvXMLImport &rImport, bool bIsStockChart, tSchXMLLSequencesPerIndex &rInOutLSequencesPerIndex)
static void setStylesToRegressionCurves(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const SvXMLStylesContext *pStylesCtxt, const SvXMLStyleContext *&rpStyle, OUString const &rCurrStyleName)
DataRowPointStyle mDataLabel
static void setStylesToDataPoints(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const SvXMLStylesContext *pStylesCtxt, const SvXMLStyleContext *&rpStyle, OUString &rCurrStyleName, const SchXMLImportHelper &rImportHelper, const SvXMLImport &rImport, bool bIsStockChart, bool bIsDonutChart, bool bSwitchOffLinesForScatter)
With this class you can import a element containing its data as element o...
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
GlobalSeriesImportInfo & m_rGlobalSeriesImportInfo
::std::vector< SchXMLAxis > & mrAxes
css::uno::Reference< css::chart2::XChartDocument > mxNewDoc
::std::vector< DataRowPointStyle > & mrStyleVector
::std::multimap< tSchXMLIndexWithPart, css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tSchXMLLSequencesPerIndex
SchXMLImportHelper & mrImportHelper