LibreOffice Module xmloff (master)  1
SchXMLTableContext.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_SCHXMLTABLECONTEXT_HXX
20 #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLTABLECONTEXT_HXX
21 
22 #include <xmloff/xmlictxt.hxx>
24 #include <com/sun/star/uno/Sequence.hxx>
25 
26 #include <com/sun/star/chart/ChartDataRowSource.hpp>
27 
28 #include "transporttypes.hxx"
29 
30 namespace com::sun::star {
31  namespace xml::sax {
32  class XAttributeList;
33  }
34  namespace chart {
35  class XChartDocument;
36  }
37 }
38 
40 {
41 private:
44 
47  css::uno::Sequence< sal_Int32 > maRowPermutation;
48  css::uno::Sequence< sal_Int32 > maColumnPermutation;
49 
50 public:
52  SvXMLImport& rImport,
53  SchXMLTable& aTable );
54  virtual ~SchXMLTableContext() override;
55 
56  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
57  sal_Int32 nElement,
58  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
59  virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
60  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
61 
62  void setRowPermutation( const css::uno::Sequence< sal_Int32 > & rPermutation );
63  void setColumnPermutation( const css::uno::Sequence< sal_Int32 > & rPermutation );
64 };
65 
67 {
68 public:
69  static void applyTableToInternalDataProvider( const SchXMLTable& rTable,
70  const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
71 
76  const tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
77  const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc,
78  css::chart::ChartDataRowSource eDataRowSource );
79 };
80 
81 // classes for columns
82 
89 {
90 private:
92 
93 public:
95  SchXMLTable& aTable );
96  virtual ~SchXMLTableColumnsContext() override;
97 
98  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
99  sal_Int32 nElement,
100  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
101 };
102 
104 {
105 private:
107 
108 public:
110  SchXMLTable& aTable );
111  virtual ~SchXMLTableColumnContext() override;
112  virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
113 };
114 
115 // classes for rows
116 
118 {
119 private:
122 
123 public:
125  SvXMLImport& rImport,
126  SchXMLTable& aTable );
127  virtual ~SchXMLTableRowsContext() override;
128 
129  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
130  sal_Int32 nElement,
131  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
132 };
133 
135 {
136 private:
139 
140 public:
142  SvXMLImport& rImport,
143  SchXMLTable& aTable );
144  virtual ~SchXMLTableRowContext() override;
145 
146  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
147  sal_Int32 nElement,
148  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
149 };
150 
151 // classes for cells and their content
152 
154 {
155 private:
158  OUString maCellContent;
159  OUString maRangeId;
161 
162 public:
164  SvXMLImport& rImport,
165  SchXMLTable& aTable );
166  virtual ~SchXMLTableCellContext() override;
167 
168  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
169  sal_Int32 nElement,
170  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
171  virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
172  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
173 };
174 
175 #endif // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLTABLECONTEXT_HXX
176 
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~SchXMLTableColumnContext() 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 void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
StartElement is called after a context has been constructed and before an elements context is parsed...
SchXMLTableColumnsContext(SvXMLImport &rImport, SchXMLTable &aTable)
void setRowPermutation(const css::uno::Sequence< sal_Int32 > &rPermutation)
SchXMLImportHelper & mrImportHelper
SchXMLTableColumnContext(SvXMLImport &rImport, SchXMLTable &aTable)
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 void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
StartElement is called after a context has been constructed and before an elements context is parsed...
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::Sequence< sal_Int32 > maRowPermutation
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::Sequence< sal_Int32 > maColumnPermutation
virtual ~SchXMLTableContext() override
SchXMLTableContext(SchXMLImportHelper &rImpHelper, SvXMLImport &rImport, SchXMLTable &aTable)
virtual ~SchXMLTableRowsContext() override
virtual ~SchXMLTableCellContext() override
SchXMLTableCellContext(SchXMLImportHelper &rImpHelper, SvXMLImport &rImport, SchXMLTable &aTable)
SchXMLImportHelper & mrImportHelper
With this class you can import a element containing its data as element o...
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 ...
SchXMLTableRowContext(SchXMLImportHelper &rImpHelper, SvXMLImport &rImport, SchXMLTable &aTable)
SchXMLTableRowsContext(SchXMLImportHelper &rImpHelper, SvXMLImport &rImport, SchXMLTable &aTable)
static void switchRangesFromOuterToInternalIfNecessary(const SchXMLTable &rTable, const tSchXMLLSequencesPerIndex &rLSequencesPerIndex, const css::uno::Reference< css::chart2::XChartDocument > &xChartDoc, css::chart::ChartDataRowSource eDataRowSource)
This function reorders local data to fit the correct data structure.
SchXMLImportHelper & mrImportHelper
SchXMLImportHelper & mrImportHelper
virtual ~SchXMLTableRowContext() override
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
StartElement is called after a context has been constructed and before an elements context is parsed...
With this context all column elements are parsed to determine the index of the column containing the ...
::std::multimap< tSchXMLIndexWithPart, css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tSchXMLLSequencesPerIndex
void setColumnPermutation(const css::uno::Sequence< sal_Int32 > &rPermutation)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
static void applyTableToInternalDataProvider(const SchXMLTable &rTable, const css::uno::Reference< css::chart2::XChartDocument > &xChartDoc)
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 ~SchXMLTableColumnsContext() override