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 );
61 
62  void readPositioningAttribute( sal_Int32 nAttributeToken, std::string_view rValue );
63  void readAutomaticPositioningProperties( XMLPropStyleContext const * pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
64 
65  bool hasPosSize() const;
66  bool isAutomatic() const;
67  css::awt::Rectangle getRectangle() const { return css::awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height );}
68 
69 private:
71 
72  css::awt::Point m_aPosition;
73  css::awt::Size m_aSize;
74 
81 };
82 
84 {
85 public:
87  SvXMLImport& rImport,
88  const OUString& rXLinkHRefAttributeToIndicateDataProvider,
89  OUString& rCategoriesAddress,
90  OUString& rChartAddress,
91  bool& bHasRangeAtPlotArea,
92  bool & rAllRangeAddressesAvailable,
93  bool & rColHasLabels,
94  bool & rRowHasLabels,
95  css::chart::ChartDataRowSource & rDataRowSource,
96  SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
97  const OUString& aChartTypeServiceName,
98  tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
99  const css::awt::Size & rChartSize );
100  virtual ~SchXMLPlotAreaContext() override;
101 
102  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
103  sal_Int32 nElement,
104  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
105  virtual void SAL_CALL startFastElement(
106  sal_Int32 nElement,
107  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
108  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
109 
110 private:
112  css::uno::Reference< css::chart::XDiagram > mxDiagram;
113  css::uno::Reference< css::chart2::XChartDocument > mxNewDoc;
114  ::std::vector< SchXMLAxis > maAxes;
117  sal_Int32 mnNumOfLinesProp;
119  sal_Int32 mnSeries;
121 
123  SchXMLPositionAttributesHelper m_aOuterPositioning;//including axes and axes titles
124  SchXMLPositionAttributesHelper m_aInnerPositioning;//excluding axes and axes titles
127  OUString msAutoStyleName;
129  OUString& mrChartAddress;
133  css::chart::ChartDataRowSource & mrDataRowSource;
135 
137 
139  css::awt::Size maChartSize;
140 };
141 
143 {
144 private:
145  ::std::vector<OUString>& mrLabels;
146  OUStringBuffer maCharBuffer;
147 public:
148  SchXMLDataLabelSpanContext( SvXMLImport& rImport, ::std::vector<OUString>& rLabels);
149  virtual void SAL_CALL characters( const OUString& rChars ) override;
150  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
151 };
152 
154 {
155 private:
156  ::std::vector<OUString>& mrLabels;
157 public:
158  SchXMLDataLabelParaContext( SvXMLImport& rImport, ::std::vector<OUString>& rLabels);
159  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
160  sal_Int32 nElement,
161  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
162 };
163 
165 {
166 private:
169 public:
171  CustomLabelsInfo& rLabels, DataRowPointStyle& rDataLabel);
172 
173  virtual void SAL_CALL startFastElement(
174  sal_Int32 nElement,
175  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
176 
177  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
178  sal_Int32 nElement,
179  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
180 };
181 
183 {
184 private:
185  ::std::vector<DataRowPointStyle>& mrStyleVector;
186  bool mbHasLabelParagraph = false;
187  sal_Int32& mrIndex;
189  // We let the data point manage the DataRowPointStyle-struct of its data label
191 
192 public:
194  ::std::vector< DataRowPointStyle >& rStyleVector,
195  const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
196  sal_Int32& rIndex,
197  bool bSymbolSizeForSeriesIsMissingInFile );
198  virtual ~SchXMLDataPointContext() override;
199 
200  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
201  sal_Int32 nElement,
202  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
203  virtual void SAL_CALL startFastElement(
204  sal_Int32 nElement,
205  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
206  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
207 };
208 
210 {
211 public:
213  SvXMLImport& rImport
214  , SchXMLPositionAttributesHelper& rPositioning );
215  virtual ~SchXMLCoordinateRegionContext() override;
216  virtual void SAL_CALL startFastElement(
217  sal_Int32 nElement,
218  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
219 
220 private:
222 };
223 
225 {
226 public:
228  {
231  };
232 
233 private:
235  css::uno::Reference< css::chart::X3DDisplay > mxWallFloorSupplier;
237 
238 public:
240  SvXMLImport& rImport,
241  css::uno::Reference< css::chart::XDiagram > const & xDiagram,
242  ContextType eContextType );
243  virtual ~SchXMLWallFloorContext() override;
244  virtual void SAL_CALL startFastElement (sal_Int32 Element,
245  const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
246 };
247 
249 {
250 public:
252  {
256  };
257 
258 private:
260  css::uno::Reference< css::chart::XStatisticDisplay > mxStockPropProvider;
262 
263 public:
264  SchXMLStockContext( SchXMLImportHelper& rImportHelper,
265  SvXMLImport& rImport,
266  css::uno::Reference< css::chart::XDiagram > const & xDiagram,
267  ContextType eContextType );
268  virtual ~SchXMLStockContext() override;
269  virtual void SAL_CALL startFastElement (sal_Int32 Element,
270  const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
271 };
272 
274 {
275 public:
277  {
280  };
281 
283  SchXMLImportHelper& rImportHelper,
284  SvXMLImport& rImport,
285  const OUString &rSeriesStyleName,
286  ::std::vector< DataRowPointStyle >& rStyleVector,
287  const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
288  ContextType eContextType,
289  tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
290 
291  virtual ~SchXMLStatisticsObjectContext() override;
292 
293  virtual void SAL_CALL startFastElement (sal_Int32 Element,
294  const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
295 
296 private:
298  ::std::vector< DataRowPointStyle > & mrStyleVector;
299  css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
303 };
304 
305 /* 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:44
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