LibreOffice Module xmloff (master) 1
SchXMLPlotAreaContext.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
22#include <rtl/ustrbuf.hxx>
23#include <xmloff/xmlictxt.hxx>
24#include <xmloff/prstylei.hxx>
26#include <com/sun/star/awt/Rectangle.hpp>
27#include <com/sun/star/chart/ChartDataRowSource.hpp>
28
29#include "transporttypes.hxx"
30
31class SvXMLImport;
32
33namespace com::sun::star {
34 namespace chart {
35 class XDiagram;
36 class X3DDisplay;
37 class XStatisticDisplay;
38 }
39 namespace chart2 {
40 class XChartDocument;
41 }
42 namespace xml::sax {
43 class XAttributeList;
44 }
45}
46
48{
49public:
50 explicit SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
52
53 void getCameraDefaultFromDiagram( const css::uno::Reference< css::chart::XDiagram >& xDiagram );
54};
55
57{
58public:
59 explicit SchXMLPositionAttributesHelper( SvXMLImport& rImporter );
60
61 void readPositioningAttribute( sal_Int32 nAttributeToken, std::string_view rValue );
62 void readAutomaticPositioningProperties( XMLPropStyleContext const * pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
63
64 bool hasPosSize() const;
65 bool isAutomatic() const;
66 css::awt::Rectangle getRectangle() const { return css::awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height );}
67
68private:
69 SvXMLImport& m_rImport;
70
71 css::awt::Point m_aPosition;
72 css::awt::Size m_aSize;
73
80};
81
83{
84public:
86 SvXMLImport& rImport,
87 const OUString& rXLinkHRefAttributeToIndicateDataProvider,
88 OUString& rCategoriesAddress,
89 OUString& rChartAddress,
90 bool& bHasRangeAtPlotArea,
91 bool & rAllRangeAddressesAvailable,
92 bool & rColHasLabels,
93 bool & rRowHasLabels,
94 css::chart::ChartDataRowSource & rDataRowSource,
95 SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
96 OUString aChartTypeServiceName,
97 tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
98 const css::awt::Size & rChartSize );
99 virtual ~SchXMLPlotAreaContext() override;
100
101 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
102 sal_Int32 nElement,
103 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
104 virtual void SAL_CALL startFastElement(
105 sal_Int32 nElement,
106 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
107 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
108
109private:
111 css::uno::Reference< css::chart::XDiagram > mxDiagram;
112 css::uno::Reference< css::chart2::XChartDocument > mxNewDoc;
113 ::std::vector< SchXMLAxis > maAxes;
118 sal_Int32 mnSeries;
120
128 OUString& mrChartAddress;
132 css::chart::ChartDataRowSource & mrDataRowSource;
134
136
138 css::awt::Size maChartSize;
139};
140
142{
143private:
144 ::std::vector<OUString>& mrLabels;
145 OUStringBuffer maCharBuffer;
146public:
147 SchXMLDataLabelSpanContext( SvXMLImport& rImport, ::std::vector<OUString>& rLabels);
148 virtual void SAL_CALL characters( const OUString& rChars ) override;
149 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
150};
151
153{
154private:
155 ::std::vector<OUString>& mrLabels;
156public:
157 SchXMLDataLabelParaContext( SvXMLImport& rImport, ::std::vector<OUString>& rLabels);
158 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
159 sal_Int32 nElement,
160 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
161};
162
164{
165private:
168public:
170 CustomLabelsInfo& rLabels, DataRowPointStyle& rDataLabel);
171
172 virtual void SAL_CALL startFastElement(
173 sal_Int32 nElement,
174 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
175
176 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
177 sal_Int32 nElement,
178 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
179};
180
182{
183private:
184 ::std::vector<DataRowPointStyle>& mrStyleVector;
186 sal_Int32& mrIndex;
188 // We let the data point manage the DataRowPointStyle-struct of its data label
190
191public:
193 ::std::vector< DataRowPointStyle >& rStyleVector,
194 const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
195 sal_Int32& rIndex,
196 bool bSymbolSizeForSeriesIsMissingInFile );
197 virtual ~SchXMLDataPointContext() override;
198
199 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
200 sal_Int32 nElement,
201 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
202 virtual void SAL_CALL startFastElement(
203 sal_Int32 nElement,
204 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
205 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
206};
207
209{
210public:
212 SvXMLImport& rImport
213 , SchXMLPositionAttributesHelper& rPositioning );
214 virtual ~SchXMLCoordinateRegionContext() override;
215 virtual void SAL_CALL startFastElement(
216 sal_Int32 nElement,
217 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
218
219private:
221};
222
224{
225public:
227 {
230 };
231
232private:
234 css::uno::Reference< css::chart::X3DDisplay > mxWallFloorSupplier;
236
237public:
239 SvXMLImport& rImport,
240 css::uno::Reference< css::chart::XDiagram > const & xDiagram,
241 ContextType eContextType );
242 virtual ~SchXMLWallFloorContext() override;
243 virtual void SAL_CALL startFastElement (sal_Int32 Element,
244 const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
245};
246
248{
249public:
251 {
255 };
256
257private:
259 css::uno::Reference< css::chart::XStatisticDisplay > mxStockPropProvider;
261
262public:
264 SvXMLImport& rImport,
265 css::uno::Reference< css::chart::XDiagram > const & xDiagram,
266 ContextType eContextType );
267 virtual ~SchXMLStockContext() override;
268 virtual void SAL_CALL startFastElement (sal_Int32 Element,
269 const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
270};
271
273{
274public:
276 {
279 };
280
282 SchXMLImportHelper& rImportHelper,
283 SvXMLImport& rImport,
284 OUString aSeriesStyleName,
285 ::std::vector< DataRowPointStyle >& rStyleVector,
286 css::uno::Reference< css::chart2::XDataSeries > xSeries,
287 ContextType eContextType,
288 tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
289
290 virtual ~SchXMLStatisticsObjectContext() override;
291
292 virtual void SAL_CALL startFastElement (sal_Int32 Element,
293 const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
294
295private:
297 ::std::vector< DataRowPointStyle > & mrStyleVector;
298 css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
302};
303
304/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void getCameraDefaultFromDiagram(const css::uno::Reference< css::chart::XDiagram > &xDiagram)
SchXML3DSceneAttributesHelper(SvXMLImport &rImporter)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual ~SchXMLCoordinateRegionContext() override
SchXMLCoordinateRegionContext(SvXMLImport &rImport, SchXMLPositionAttributesHelper &rPositioning)
SchXMLPositionAttributesHelper & m_rPositioning
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
DataRowPointStyle & mrDataLabelStyle
SchXMLDataLabelContext(SvXMLImport &rImport, CustomLabelsInfo &rLabels, DataRowPointStyle &rDataLabel)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
SchXMLDataLabelParaContext(SvXMLImport &rImport, ::std::vector< OUString > &rLabels)
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< OUString > & mrLabels
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
SchXMLDataLabelSpanContext(SvXMLImport &rImport, ::std::vector< OUString > &rLabels)
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 ...
::std::vector< OUString > & mrLabels
virtual ~SchXMLDataPointContext() override
::std::vector< DataRowPointStyle > & mrStyleVector
SchXMLDataPointContext(SvXMLImport &rImport, ::std::vector< DataRowPointStyle > &rStyleVector, const css::uno::Reference< css::chart2::XDataSeries > &xSeries, sal_Int32 &rIndex, bool bSymbolSizeForSeriesIsMissingInFile)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
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 ...
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
With this class you can import a <chart:chart> element containing its data as <table:table> element o...
css::chart::ChartDataRowSource & mrDataRowSource
::std::vector< SchXMLAxis > maAxes
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
SchXML3DSceneAttributesHelper maSceneImportHelper
css::uno::Reference< css::chart::XDiagram > mxDiagram
SchXMLPositionAttributesHelper m_aOuterPositioning
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
SchXMLImportHelper & mrImportHelper
GlobalSeriesImportInfo m_aGlobalSeriesImportInfo
css::uno::Reference< css::chart2::XChartDocument > mxNewDoc
SchXMLPositionAttributesHelper m_aInnerPositioning
virtual ~SchXMLPlotAreaContext() override
const OUString & m_rXLinkHRefAttributeToIndicateDataProvider
SchXMLPlotAreaContext(SchXMLImportHelper &rImpHelper, SvXMLImport &rImport, const OUString &rXLinkHRefAttributeToIndicateDataProvider, OUString &rCategoriesAddress, OUString &rChartAddress, bool &bHasRangeAtPlotArea, bool &rAllRangeAddressesAvailable, bool &rColHasLabels, bool &rRowHasLabels, css::chart::ChartDataRowSource &rDataRowSource, SeriesDefaultsAndStyles &rSeriesDefaultsAndStyles, OUString aChartTypeServiceName, tSchXMLLSequencesPerIndex &rLSequencesPerIndex, const css::awt::Size &rChartSize)
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex
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 ...
SeriesDefaultsAndStyles & mrSeriesDefaultsAndStyles
void readPositioningAttribute(sal_Int32 nAttributeToken, std::string_view rValue)
void readAutomaticPositioningProperties(XMLPropStyleContext const *pPropStyleContext, const SvXMLStylesContext *pStylesCtxt)
SchXMLPositionAttributesHelper(SvXMLImport &rImporter)
css::awt::Rectangle getRectangle() const
css::uno::Reference< css::chart2::XDataSeries > m_xSeries
virtual void SAL_CALL startFastElement(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex
::std::vector< DataRowPointStyle > & mrStyleVector
virtual ~SchXMLStatisticsObjectContext() override
SchXMLStatisticsObjectContext(SchXMLImportHelper &rImportHelper, SvXMLImport &rImport, OUString aSeriesStyleName, ::std::vector< DataRowPointStyle > &rStyleVector, css::uno::Reference< css::chart2::XDataSeries > xSeries, ContextType eContextType, tSchXMLLSequencesPerIndex &rLSequencesPerIndex)
SchXMLStockContext(SchXMLImportHelper &rImportHelper, SvXMLImport &rImport, css::uno::Reference< css::chart::XDiagram > const &xDiagram, ContextType eContextType)
SchXMLImportHelper & mrImportHelper
virtual ~SchXMLStockContext() override
virtual void SAL_CALL startFastElement(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
css::uno::Reference< css::chart::XStatisticDisplay > mxStockPropProvider
SchXMLImportHelper & mrImportHelper
css::uno::Reference< css::chart::X3DDisplay > mxWallFloorSupplier
virtual void SAL_CALL startFastElement(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
SchXMLWallFloorContext(SchXMLImportHelper &rImportHelper, SvXMLImport &rImport, css::uno::Reference< css::chart::XDiagram > const &xDiagram, ContextType eContextType)
virtual ~SchXMLWallFloorContext() override
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
ContextType
Used to store text content of a data point custom-label's fields and also the helper members that ind...
::std::multimap< tSchXMLIndexWithPart, css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tSchXMLLSequencesPerIndex