LibreOffice Module xmloff (master)  1
SchXMLAxisContext.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_SCHXMLAXISCONTEXT_HXX
20 #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLAXISCONTEXT_HXX
21 
23 #include <xmloff/xmlictxt.hxx>
24 
25 #include "transporttypes.hxx"
26 
27 #include <com/sun/star/chart/XDiagram.hpp>
28 #include <com/sun/star/xml/sax/XAttributeList.hpp>
29 
31 {
32 public:
34  SvXMLImport& rImport,
35  css::uno::Reference< css::chart::XDiagram > const & xDiagram,
36  std::vector< SchXMLAxis >& aAxes,
37  OUString& rCategoriesAddress,
38  bool bAddMissingXAxisForNetCharts,
39  bool bAdaptWrongPercentScaleValues,
40  bool bAdaptXAxisOrientationForOld2DBarCharts,
41  bool& rbAxisPositionAttributeImported );
42  virtual ~SchXMLAxisContext() override;
43 
44  virtual void SAL_CALL startFastElement( sal_Int32 nElement,
45  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
46  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
47  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
48  sal_Int32 nElement,
49  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
50 
51  static void CorrectAxisPositions( const css::uno::Reference< css::chart2::XChartDocument >& xNewDoc,
52  std::u16string_view rChartTypeServiceName,
53  std::u16string_view rODFVersionOfFile,
54  bool bAxisPositionAttributeImported );
55 
56 private:
58  css::uno::Reference< css::chart::XDiagram > m_xDiagram;
60  std::vector< SchXMLAxis >& m_rAxes;
61  css::uno::Reference< css::beans::XPropertySet > m_xAxisProps;
62  OUString m_aAutoStyleName;
64  sal_Int32 m_nAxisType;//css::chart::ChartAxisType
67  bool m_bAddMissingXAxisForNetCharts; //to correct errors from older versions
68  bool m_bAdaptWrongPercentScaleValues; //to correct errors from older versions
69  bool m_bAdaptXAxisOrientationForOld2DBarCharts; //to correct different behaviour from older versions
71 
72  css::uno::Reference< css::drawing::XShape > getTitleShape() const;
73  void CreateGrid( const OUString& sAutoStyleName, bool bIsMajor );
74  void CreateAxis();
75  void SetAxisTitle();
76 };
77 
78 #endif // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLAXISCONTEXT_HXX
79 
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
SchXMLAxisContext(SchXMLImportHelper &rImpHelper, SvXMLImport &rImport, css::uno::Reference< css::chart::XDiagram > const &xDiagram, std::vector< SchXMLAxis > &aAxes, OUString &rCategoriesAddress, bool bAddMissingXAxisForNetCharts, bool bAdaptWrongPercentScaleValues, bool bAdaptXAxisOrientationForOld2DBarCharts, bool &rbAxisPositionAttributeImported)
css::uno::Reference< css::drawing::XShape > getTitleShape() const
css::uno::Reference< css::chart::XDiagram > m_xDiagram
bool & m_rbAxisPositionAttributeImported
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 ...
static void CorrectAxisPositions(const css::uno::Reference< css::chart2::XChartDocument > &xNewDoc, std::u16string_view rChartTypeServiceName, std::u16string_view rODFVersionOfFile, bool bAxisPositionAttributeImported)
std::vector< SchXMLAxis > & m_rAxes
bool m_bAdaptXAxisOrientationForOld2DBarCharts
OUString & m_rCategoriesAddress
css::uno::Reference< css::beans::XPropertySet > m_xAxisProps
With this class you can import a element containing its data as element o...
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
SchXMLImportHelper & m_rImportHelper
virtual ~SchXMLAxisContext() override
void CreateGrid(const OUString &sAutoStyleName, bool bIsMajor)