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"
23#include <xmloff/xmlictxt.hxx>
25#include <xmloff/xmlstyle.hxx>
26
27#include <vector>
28
29namespace 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{
42private:
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;
52
54
56 sal_Int32 mnAttachedAxis;
58 ::std::vector< OUString > maDomainAddresses;
67 css::awt::Size maChartSize;
68 // We let the series manage the DataRowPointStyle-struct of its data label
70
71public:
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: */
With this class you can import a <chart:chart> element containing its data as <table:table> element o...
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
::std::vector< DataRowPointStyle > & mrStyleVector
css::uno::Reference< css::chart2::XDataSeries > m_xSeries
static void initSeriesPropertySets(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const css::uno::Reference< css::frame::XModel > &xChartModel)
SchXMLImportHelper & mrImportHelper
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex
static void setDefaultsToSeries(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles)
css::uno::Reference< css::chart2::XChartDocument > mxNewDoc
static void switchSeriesLinesOff(::std::vector< DataRowPointStyle > &rSeriesStyleVector)
::std::vector< RegressionStyle > & mrRegressionStyleVector
::std::vector< SchXMLAxis > & mrAxes
::std::vector< OUString > maDomainAddresses
static void setStylesToSeries(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const SvXMLStylesContext *pStylesCtxt, const SvXMLStyleContext *&rpStyle, OUString &rCurrStyleName, const SchXMLImportHelper &rImportHelper, const SvXMLImport &rImport, bool bIsStockChart, tSchXMLLSequencesPerIndex &rInOutLSequencesPerIndex)
tSchXMLLSequencesPerIndex maPostponedSequences
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)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual ~SchXMLSeries2Context() override
static void setStylesToRegressionCurves(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const SvXMLStylesContext *pStylesCtxt, const SvXMLStyleContext *&rpStyle, OUString const &rCurrStyleName)
static void setStylesToStatisticsObjects(SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, const SvXMLStylesContext *pStylesCtxt, const SvXMLStyleContext *&rpStyle, OUString &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)
GlobalSeriesImportInfo & m_rGlobalSeriesImportInfo
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 ...
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
friend class SvXMLImport
Definition: xmlictxt.hxx:49
::std::multimap< tSchXMLIndexWithPart, css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tSchXMLLSequencesPerIndex