Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / xmloff / source / chart / SchXMLTableContext.hxx
blob6523facb0a0103cf62a5e55b9e7af866b3c90333
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLTABLECONTEXT_HXX
20 #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLTABLECONTEXT_HXX
22 #include <xmloff/xmlictxt.hxx>
23 #include "SchXMLImport.hxx"
24 #include <com/sun/star/uno/Sequence.hxx>
26 #include <com/sun/star/chart/ChartDataRowSource.hpp>
28 #include "transporttypes.hxx"
30 namespace com { namespace sun { namespace star {
31 namespace xml { namespace sax {
32 class XAttributeList;
34 namespace chart {
35 class XChartDocument;
36 }}}}
38 class SchXMLTableContext : public SvXMLImportContext
40 private:
41 SchXMLImportHelper& mrImportHelper;
42 SchXMLTable& mrTable;
44 bool mbHasRowPermutation;
45 bool mbHasColumnPermutation;
46 css::uno::Sequence< sal_Int32 > maRowPermutation;
47 css::uno::Sequence< sal_Int32 > maColumnPermutation;
49 public:
50 SchXMLTableContext( SchXMLImportHelper& rImpHelper,
51 SvXMLImport& rImport,
52 const OUString& rLocalName,
53 SchXMLTable& aTable );
54 virtual ~SchXMLTableContext();
56 virtual SvXMLImportContext* CreateChildContext(
57 sal_uInt16 nPrefix,
58 const OUString& rLocalName,
59 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
60 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
61 virtual void EndElement() override;
63 void setRowPermutation( const css::uno::Sequence< sal_Int32 > & rPermutation );
64 void setColumnPermutation( const css::uno::Sequence< sal_Int32 > & rPermutation );
67 class SchXMLTableHelper
69 public:
70 static void applyTableToInternalDataProvider( const SchXMLTable& rTable,
71 const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
73 /** This function reorders local data to fit the correct data structure.
74 Call it after the data series got their styles set.
76 static void switchRangesFromOuterToInternalIfNecessary( const SchXMLTable& rTable,
77 const tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
78 const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc,
79 css::chart::ChartDataRowSource eDataRowSource );
82 // classes for columns
84 /** With this context all column elements are parsed to
85 determine the index of the column containing
86 the row descriptions and probably get an estimate
87 for the altogether number of columns
89 class SchXMLTableColumnsContext : public SvXMLImportContext
91 private:
92 SchXMLTable& mrTable;
94 public:
95 SchXMLTableColumnsContext( SvXMLImport& rImport,
96 const OUString& rLocalName,
97 SchXMLTable& aTable );
98 virtual ~SchXMLTableColumnsContext();
100 virtual SvXMLImportContext* CreateChildContext(
101 sal_uInt16 nPrefix,
102 const OUString& rLocalName,
103 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
106 class SchXMLTableColumnContext : public SvXMLImportContext
108 private:
109 SchXMLTable& mrTable;
111 public:
112 SchXMLTableColumnContext( SvXMLImport& rImport,
113 const OUString& rLocalName,
114 SchXMLTable& aTable );
115 virtual ~SchXMLTableColumnContext();
116 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
119 // classes for rows
121 class SchXMLTableRowsContext : public SvXMLImportContext
123 private:
124 SchXMLImportHelper& mrImportHelper;
125 SchXMLTable& mrTable;
127 public:
128 SchXMLTableRowsContext( SchXMLImportHelper& rImpHelper,
129 SvXMLImport& rImport,
130 const OUString& rLocalName,
131 SchXMLTable& aTable );
132 virtual ~SchXMLTableRowsContext();
134 virtual SvXMLImportContext* CreateChildContext(
135 sal_uInt16 nPrefix,
136 const OUString& rLocalName,
137 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
140 class SchXMLTableRowContext : public SvXMLImportContext
142 private:
143 SchXMLImportHelper& mrImportHelper;
144 SchXMLTable& mrTable;
146 public:
147 SchXMLTableRowContext( SchXMLImportHelper& rImpHelper,
148 SvXMLImport& rImport,
149 const OUString& rLocalName,
150 SchXMLTable& aTable );
151 virtual ~SchXMLTableRowContext();
153 virtual SvXMLImportContext* CreateChildContext(
154 sal_uInt16 nPrefix,
155 const OUString& rLocalName,
156 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
159 // classes for cells and their content
161 class SchXMLTableCellContext : public SvXMLImportContext
163 private:
164 SchXMLImportHelper& mrImportHelper;
165 SchXMLTable& mrTable;
166 OUString maCellContent;
167 OUString maRangeId;
168 bool mbReadText;
170 public:
171 SchXMLTableCellContext( SchXMLImportHelper& rImpHelper,
172 SvXMLImport& rImport,
173 const OUString& rLocalName,
174 SchXMLTable& aTable );
175 virtual ~SchXMLTableCellContext();
177 virtual SvXMLImportContext* CreateChildContext(
178 sal_uInt16 nPrefix,
179 const OUString& rLocalName,
180 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
181 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
182 virtual void EndElement() override;
185 #endif // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLTABLECONTEXT_HXX
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */