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 #pragma once
20 
21 #include "transporttypes.hxx"
22 #include "SchXMLChartContext.hxx"
23 #include <xmloff/xmlictxt.hxx>
25 #include <xmloff/xmlstyle.hxx>
26 
27 #include <vector>
28 
29 namespace com::sun::star {
30  namespace chart2 {
31  class XChartDocument;
32  class XDataSeries;
33  }
34  namespace awt {
35  struct Size;
36  }
37 }
38 
39 // class for child contexts: series, data point and statistics objects
41 {
42 private:
44  css::uno::Reference< css::chart2::XChartDocument > mxNewDoc;
45  ::std::vector< SchXMLAxis >& mrAxes;
46  ::std::vector< DataRowPointStyle >& mrStyleVector;
47  ::std::vector< RegressionStyle >& mrRegressionStyleVector;
48  css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
49  sal_Int32 mnSeriesIndex;
50  sal_Int32 mnDataPointIndex;
52 
54 
56  sal_Int32 mnAttachedAxis;
57  OUString msAutoStyleName;
58  ::std::vector< OUString > maDomainAddresses;
61  OUString m_aSeriesRange;
67  css::awt::Size maChartSize;
68  // We let the series manage the DataRowPointStyle-struct of its data label
70 
71 public:
73  SvXMLImport& rImport,
74  const css::uno::Reference< css::chart2::XChartDocument > & xNewDoc,
75  std::vector< SchXMLAxis >& rAxes,
76  ::std::vector< DataRowPointStyle >& rStyleVector,
77  ::std::vector< RegressionStyle >& rRegressionStyleVector,
78  sal_Int32 nSeriesIndex,
79  bool bStockHasVolume,
80  GlobalSeriesImportInfo& rGlobalSeriesImportInfo,
81  const OUString & aGlobalChartTypeName,
82  tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
83  bool& rGlobalChartTypeUsedBySeries,
84  const css::awt::Size & rChartSize );
85  virtual ~SchXMLSeries2Context() override;
86 
87  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
88  sal_Int32 nElement,
89  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
90  virtual void SAL_CALL startFastElement(
91  sal_Int32 nElement,
92  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
93  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
94 
95  static void initSeriesPropertySets( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
96  , const css::uno::Reference< css::frame::XModel >& xChartModel );
97 
98  static void setDefaultsToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles );
99 
100  static void setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
101  , const SvXMLStylesContext* pStylesCtxt
102  , const SvXMLStyleContext*& rpStyle
103  , OUString& rCurrStyleName
104  , const SchXMLImportHelper& rImportHelper
105  , const SvXMLImport& rImport
106  , bool bIsStockChart
107  , tSchXMLLSequencesPerIndex & rInOutLSequencesPerIndex );
108 
109  static void setStylesToStatisticsObjects( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
110  , const SvXMLStylesContext* pStylesCtxt
111  , const SvXMLStyleContext*& rpStyle
112  , OUString &rCurrStyleName );
113 
114  static void setStylesToRegressionCurves(
115  SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
116  const SvXMLStylesContext* pStylesCtxt,
117  const SvXMLStyleContext*& rpStyle,
118  OUString const &rCurrStyleName );
119 
120  static void setStylesToDataPoints( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
121  , const SvXMLStylesContext* pStylesCtxt
122  , const SvXMLStyleContext*& rpStyle
123  , OUString& rCurrStyleName
124  , const SchXMLImportHelper& rImportHelper
125  , const SvXMLImport& rImport
126  , bool bIsStockChart, bool bIsDonutChart, bool bSwitchOffLinesForScatter );
127 
128  static void switchSeriesLinesOff( ::std::vector< DataRowPointStyle >& rSeriesStyleVector );
129 };
130 
131 // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLSERIES2CONTEXT_HXX
132 
133 /* 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:44
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