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 
21 #include "SchXMLChartContext.hxx"
22 #include <rtl/ustrbuf.hxx>
23 #include <xmloff/xmlictxt.hxx>
24 #include <xmloff/prstylei.hxx>
25 #include <xmloff/shapeimport.hxx>
26 #include <com/sun/star/awt/Rectangle.hpp>
27 #include <com/sun/star/chart/ChartDataRowSource.hpp>
28 
29 #include "transporttypes.hxx"
30 
31 class SvXMLImport;
32 
33 namespace 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 {
49 public:
50  explicit SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
52 
53  void getCameraDefaultFromDiagram( const css::uno::Reference< css::chart::XDiagram >& xDiagram );
54 };
55 
57 {
58 public:
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 
68 private:
70 
71  css::awt::Point m_aPosition;
72  css::awt::Size m_aSize;
73 
80 };
81 
83 {
84 public:
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  const 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 
109 private:
111  css::uno::Reference< css::chart::XDiagram > mxDiagram;
112  css::uno::Reference< css::chart2::XChartDocument > mxNewDoc;
113  ::std::vector< SchXMLAxis > maAxes;
116  sal_Int32 mnNumOfLinesProp;
118  sal_Int32 mnSeries;
120 
122  SchXMLPositionAttributesHelper m_aOuterPositioning;//including axes and axes titles
123  SchXMLPositionAttributesHelper m_aInnerPositioning;//excluding axes and axes titles
126  OUString msAutoStyleName;
128  OUString& mrChartAddress;
132  css::chart::ChartDataRowSource & mrDataRowSource;
134 
136 
138  css::awt::Size maChartSize;
139 };
140 
142 {
143 private:
144  ::std::vector<OUString>& mrLabels;
145  OUStringBuffer maCharBuffer;
146 public:
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 {
154 private:
155  ::std::vector<OUString>& mrLabels;
156 public:
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 {
165 private:
168 public:
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 {
183 private:
184  ::std::vector<DataRowPointStyle>& mrStyleVector;
185  bool mbHasLabelParagraph = false;
186  sal_Int32& mrIndex;
188  // We let the data point manage the DataRowPointStyle-struct of its data label
190 
191 public:
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 {
210 public:
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 
219 private:
221 };
222 
224 {
225 public:
227  {
230  };
231 
232 private:
234  css::uno::Reference< css::chart::X3DDisplay > mxWallFloorSupplier;
236 
237 public:
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 {
249 public:
251  {
255  };
256 
257 private:
259  css::uno::Reference< css::chart::XStatisticDisplay > mxStockPropProvider;
261 
262 public:
263  SchXMLStockContext( SchXMLImportHelper& rImportHelper,
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 {
274 public:
276  {
279  };
280 
282  SchXMLImportHelper& rImportHelper,
283  SvXMLImport& rImport,
284  const OUString &rSeriesStyleName,
285  ::std::vector< DataRowPointStyle >& rStyleVector,
286  const 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 
295 private:
297  ::std::vector< DataRowPointStyle > & mrStyleVector;
298  css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
302 };
303 
304 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::chart::XStatisticDisplay > mxStockPropProvider
css::chart::ChartDataRowSource & mrDataRowSource
SchXMLDataPointContext(SvXMLImport &rImport,::std::vector< DataRowPointStyle > &rStyleVector, const css::uno::Reference< css::chart2::XDataSeries > &xSeries, sal_Int32 &rIndex, bool bSymbolSizeForSeriesIsMissingInFile)
css::uno::Reference< css::chart::X3DDisplay > mxWallFloorSupplier
SchXMLStockContext(SchXMLImportHelper &rImportHelper, SvXMLImport &rImport, css::uno::Reference< css::chart::XDiagram > const &xDiagram, ContextType eContextType)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
css::uno::Reference< css::chart2::XChartDocument > mxNewDoc
SchXMLDataLabelContext(SvXMLImport &rImport, CustomLabelsInfo &rLabels, DataRowPointStyle &rDataLabel)
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, const OUString &aChartTypeServiceName, tSchXMLLSequencesPerIndex &rLSequencesPerIndex, const css::awt::Size &rChartSize)
virtual ~SchXMLDataPointContext() override
::std::vector< DataRowPointStyle > & mrStyleVector
SchXMLStatisticsObjectContext(SchXMLImportHelper &rImportHelper, SvXMLImport &rImport, const OUString &rSeriesStyleName,::std::vector< DataRowPointStyle > &rStyleVector, const css::uno::Reference< css::chart2::XDataSeries > &xSeries, ContextType eContextType, tSchXMLLSequencesPerIndex &rLSequencesPerIndex)
SchXMLImportHelper & mrImportHelper
SchXMLPositionAttributesHelper(SvXMLImport &rImporter)
exports com.sun.star. chart2
virtual ~SchXMLWallFloorContext() override
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 ~SchXMLStatisticsObjectContext() override
::std::vector< SchXMLAxis > maAxes
void readPositioningAttribute(sal_Int32 nAttributeToken, std::string_view rValue)
SchXML3DSceneAttributesHelper(SvXMLImport &rImporter)
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 ...
SchXMLImportHelper & mrImportHelper
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
::std::vector< OUString > & mrLabels
void getCameraDefaultFromDiagram(const css::uno::Reference< css::chart::XDiagram > &xDiagram)
const OUString & m_rXLinkHRefAttributeToIndicateDataProvider
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex
SchXMLWallFloorContext(SchXMLImportHelper &rImportHelper, SvXMLImport &rImport, css::uno::Reference< css::chart::XDiagram > const &xDiagram, ContextType eContextType)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
SchXMLCoordinateRegionContext(SvXMLImport &rImport, SchXMLPositionAttributesHelper &rPositioning)
void readAutomaticPositioningProperties(XMLPropStyleContext const *pPropStyleContext, const SvXMLStylesContext *pStylesCtxt)
ContextType
SchXMLPositionAttributesHelper m_aInnerPositioning
virtual void SAL_CALL startFastElement(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
::std::vector< DataRowPointStyle > & mrStyleVector
SchXMLDataLabelSpanContext(SvXMLImport &rImport,::std::vector< OUString > &rLabels)
virtual ~SchXMLPlotAreaContext() override
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
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 element containing its data as element o...
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
SchXMLPositionAttributesHelper & m_rPositioning
Used to store text content of a data point custom-label's fields and also the helper members that ind...
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
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 ...
SchXMLPositionAttributesHelper m_aOuterPositioning
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 ...
SchXML3DSceneAttributesHelper maSceneImportHelper
::std::vector< OUString > & mrLabels
SeriesDefaultsAndStyles & mrSeriesDefaultsAndStyles
css::awt::Rectangle getRectangle() const
SchXMLDataLabelParaContext(SvXMLImport &rImport,::std::vector< OUString > &rLabels)
GlobalSeriesImportInfo m_aGlobalSeriesImportInfo
virtual ~SchXMLStockContext() override
DataRowPointStyle & mrDataLabelStyle
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
SchXMLImportHelper & mrImportHelper
::std::multimap< tSchXMLIndexWithPart, css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tSchXMLLSequencesPerIndex
virtual void SAL_CALL startFastElement(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual ~SchXMLCoordinateRegionContext() override
css::uno::Reference< css::chart::XDiagram > mxDiagram