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 #ifndef INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLPLOTAREACONTEXT_HXX
20 #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLPLOTAREACONTEXT_HXX
21 
22 #include "SchXMLChartContext.hxx"
23 #include <rtl/ustrbuf.hxx>
24 #include <xmloff/xmlictxt.hxx>
25 #include <xmloff/prstylei.hxx>
26 #include <xmloff/shapeimport.hxx>
27 #include <com/sun/star/awt/Rectangle.hpp>
28 #include <com/sun/star/chart/ChartDataRowSource.hpp>
29 
30 #include "transporttypes.hxx"
31 
32 class SvXMLImport;
33 
34 namespace com::sun::star {
35  namespace chart {
36  class XDiagram;
37  class X3DDisplay;
38  class XStatisticDisplay;
39  }
40  namespace chart2 {
41  class XChartDocument;
42  }
43  namespace xml::sax {
44  class XAttributeList;
45  }
46 }
47 
49 {
50 public:
51  explicit SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
53 
54  void getCameraDefaultFromDiagram( const css::uno::Reference< css::chart::XDiagram >& xDiagram );
55 };
56 
58 {
59 public:
60  explicit SchXMLPositionAttributesHelper( SvXMLImport& rImporter );
62 
63  void readPositioningAttribute( sal_Int32 nAttributeToken, std::string_view rValue );
64  void readAutomaticPositioningProperties( XMLPropStyleContext const * pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
65 
66  bool hasPosSize() const;
67  bool isAutomatic() const;
68  css::awt::Rectangle getRectangle() const { return css::awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height );}
69 
70 private:
72 
73  css::awt::Point m_aPosition;
74  css::awt::Size m_aSize;
75 
82 };
83 
85 {
86 public:
88  SvXMLImport& rImport,
89  const OUString& rXLinkHRefAttributeToIndicateDataProvider,
90  OUString& rCategoriesAddress,
91  OUString& rChartAddress,
92  bool& bHasRangeAtPlotArea,
93  bool & rAllRangeAddressesAvailable,
94  bool & rColHasLabels,
95  bool & rRowHasLabels,
96  css::chart::ChartDataRowSource & rDataRowSource,
97  SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
98  const OUString& aChartTypeServiceName,
99  tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
100  const css::awt::Size & rChartSize );
101  virtual ~SchXMLPlotAreaContext() override;
102 
103  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
104  sal_Int32 nElement,
105  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
106  virtual void SAL_CALL startFastElement(
107  sal_Int32 nElement,
108  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
109  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
110 
111 private:
113  css::uno::Reference< css::chart::XDiagram > mxDiagram;
114  css::uno::Reference< css::chart2::XChartDocument > mxNewDoc;
115  ::std::vector< SchXMLAxis > maAxes;
118  sal_Int32 mnNumOfLinesProp;
120  sal_Int32 mnSeries;
122 
124  SchXMLPositionAttributesHelper m_aOuterPositioning;//including axes and axes titles
125  SchXMLPositionAttributesHelper m_aInnerPositioning;//excluding axes and axes titles
128  OUString msAutoStyleName;
130  OUString& mrChartAddress;
134  css::chart::ChartDataRowSource & mrDataRowSource;
136 
138 
140  css::awt::Size maChartSize;
141 };
142 
144 {
145 private:
146  ::std::vector<OUString>& mrLabels;
147  OUStringBuffer maCharBuffer;
148 public:
149  SchXMLDataLabelSpanContext( SvXMLImport& rImport, ::std::vector<OUString>& rLabels);
150  virtual void SAL_CALL characters( const OUString& rChars ) override;
151  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
152 };
153 
155 {
156 private:
157  ::std::vector<OUString>& mrLabels;
158 public:
159  SchXMLDataLabelParaContext( SvXMLImport& rImport, ::std::vector<OUString>& rLabels);
160  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
161  sal_Int32 nElement,
162  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
163 };
164 
166 {
167 private:
168  ::std::vector<OUString>& mrLabels;
170 public:
172  ::std::vector<OUString>& rLabels, DataRowPointStyle& rDataLabel);
173 
174  virtual void SAL_CALL startFastElement(
175  sal_Int32 nElement,
176  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
177 
178  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
179  sal_Int32 nElement,
180  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
181 };
182 
184 {
185 private:
186  ::std::vector<DataRowPointStyle>& mrStyleVector;
187  bool mbHasLabelParagraph = false;
188  sal_Int32& mrIndex;
190  // We let the data point manage the DataRowPointStyle-struct of its data label
192 
193 public:
195  ::std::vector< DataRowPointStyle >& rStyleVector,
196  const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
197  sal_Int32& rIndex,
198  bool bSymbolSizeForSeriesIsMissingInFile );
199  virtual ~SchXMLDataPointContext() override;
200 
201  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
202  sal_Int32 nElement,
203  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
204  virtual void SAL_CALL startFastElement(
205  sal_Int32 nElement,
206  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
207  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
208 };
209 
211 {
212 public:
214  SvXMLImport& rImport
215  , SchXMLPositionAttributesHelper& rPositioning );
216  virtual ~SchXMLCoordinateRegionContext() override;
217  virtual void SAL_CALL startFastElement(
218  sal_Int32 nElement,
219  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
220 
221 private:
223 };
224 
226 {
227 public:
229  {
232  };
233 
234 private:
236  css::uno::Reference< css::chart::X3DDisplay > mxWallFloorSupplier;
238 
239 public:
241  SvXMLImport& rImport,
242  css::uno::Reference< css::chart::XDiagram > const & xDiagram,
243  ContextType eContextType );
244  virtual ~SchXMLWallFloorContext() override;
245  virtual void SAL_CALL startFastElement (sal_Int32 Element,
246  const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
247 };
248 
250 {
251 public:
253  {
257  };
258 
259 private:
261  css::uno::Reference< css::chart::XStatisticDisplay > mxStockPropProvider;
263 
264 public:
265  SchXMLStockContext( SchXMLImportHelper& rImportHelper,
266  SvXMLImport& rImport,
267  css::uno::Reference< css::chart::XDiagram > const & xDiagram,
268  ContextType eContextType );
269  virtual ~SchXMLStockContext() override;
270  virtual void SAL_CALL startFastElement (sal_Int32 Element,
271  const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
272 };
273 
275 {
276 public:
278  {
281  };
282 
284  SchXMLImportHelper& rImportHelper,
285  SvXMLImport& rImport,
286  const OUString &rSeriesStyleName,
287  ::std::vector< DataRowPointStyle >& rStyleVector,
288  const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
289  ContextType eContextType,
290  tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
291 
292  virtual ~SchXMLStatisticsObjectContext() override;
293 
294  virtual void SAL_CALL startFastElement (sal_Int32 Element,
295  const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
296 
297 private:
299  ::std::vector< DataRowPointStyle > & mrStyleVector;
300  css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
304 };
305 
306 #endif // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLPLOTAREACONTEXT_HXX
307 
308 /* 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
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)
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
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
::std::vector< OUString > & mrLabels
SchXMLDataLabelContext(SvXMLImport &rImport,::std::vector< OUString > &rLabels, DataRowPointStyle &rDataLabel)
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
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