1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <xmloff/xmlictxt.hxx>
22 #include <xmloff/SchXMLImportHelper.hxx>
23 #include <com/sun/star/uno/Sequence.hxx>
25 #include <com/sun/star/chart/ChartDataRowSource.hpp>
27 #include "transporttypes.hxx"
29 namespace com::sun::star
{
38 class SchXMLTableContext
: public SvXMLImportContext
43 bool mbHasRowPermutation
;
44 bool mbHasColumnPermutation
;
45 css::uno::Sequence
< sal_Int32
> maRowPermutation
;
46 css::uno::Sequence
< sal_Int32
> maColumnPermutation
;
49 SchXMLTableContext( SvXMLImport
& rImport
,
50 SchXMLTable
& aTable
);
51 virtual ~SchXMLTableContext() override
;
53 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
55 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
56 virtual void SAL_CALL
startFastElement(
58 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
59 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
61 void setRowPermutation( const css::uno::Sequence
< sal_Int32
> & rPermutation
);
62 void setColumnPermutation( const css::uno::Sequence
< sal_Int32
> & rPermutation
);
65 class SchXMLTableHelper
68 static void applyTableToInternalDataProvider( const SchXMLTable
& rTable
,
69 const css::uno::Reference
< css::chart2::XChartDocument
>& xChartDoc
);
71 /** This function reorders local data to fit the correct data structure.
72 Call it after the data series got their styles set.
74 static void switchRangesFromOuterToInternalIfNecessary( const SchXMLTable
& rTable
,
75 const tSchXMLLSequencesPerIndex
& rLSequencesPerIndex
,
76 const css::uno::Reference
< css::chart2::XChartDocument
>& xChartDoc
,
77 css::chart::ChartDataRowSource eDataRowSource
);
80 // classes for columns
82 /** With this context all column elements are parsed to
83 determine the index of the column containing
84 the row descriptions and probably get an estimate
85 for the altogether number of columns
87 class SchXMLTableColumnsContext
: public SvXMLImportContext
93 SchXMLTableColumnsContext( SvXMLImport
& rImport
,
94 SchXMLTable
& aTable
);
95 virtual ~SchXMLTableColumnsContext() override
;
97 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
99 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
102 class SchXMLTableColumnContext
: public SvXMLImportContext
105 SchXMLTable
& mrTable
;
108 SchXMLTableColumnContext( SvXMLImport
& rImport
,
109 SchXMLTable
& aTable
);
110 virtual ~SchXMLTableColumnContext() override
;
111 virtual void SAL_CALL
startFastElement(
113 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
118 class SchXMLTableRowsContext
: public SvXMLImportContext
121 SchXMLTable
& mrTable
;
124 SchXMLTableRowsContext( SvXMLImport
& rImport
,
125 SchXMLTable
& aTable
);
126 virtual ~SchXMLTableRowsContext() override
;
128 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
130 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
133 class SchXMLTableRowContext
: public SvXMLImportContext
136 SchXMLTable
& mrTable
;
139 SchXMLTableRowContext( SvXMLImport
& rImport
,
140 SchXMLTable
& aTable
);
141 virtual ~SchXMLTableRowContext() override
;
143 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
145 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
148 // classes for cells and their content
150 class SchXMLTableCellContext
: public SvXMLImportContext
153 SchXMLTable
& mrTable
;
154 OUString maCellContent
;
159 SchXMLTableCellContext( SvXMLImport
& rImport
,
160 SchXMLTable
& aTable
);
161 virtual ~SchXMLTableCellContext() override
;
163 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
165 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
166 virtual void SAL_CALL
startFastElement(
168 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
169 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */