Bump for 3.6-28
[LibreOffice.git] / xmloff / source / chart / SchXMLChartContext.hxx
blob249cbdbb4fd95dbd00f03d4dac6622c2700bad75
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _SCH_XMLCHARTCONTEXT_HXX_
29 #define _SCH_XMLCHARTCONTEXT_HXX_
31 #include <xmloff/xmlictxt.hxx>
32 #include <com/sun/star/uno/Sequence.h>
33 #include <com/sun/star/drawing/XShape.hpp>
34 #include <com/sun/star/chart/ChartDataRowSource.hpp>
35 #include <com/sun/star/chart2/XChartDocument.hpp>
36 #include <com/sun/star/awt/Size.hpp>
38 #include "transporttypes.hxx"
40 #include <list>
41 #include <map>
43 class SchXMLImport;
44 class SchXMLImportHelper;
46 namespace com { namespace sun { namespace star {
47 namespace chart {
48 class XChartDocument;
49 class XDiagram;
50 struct ChartSeriesAddress;
52 namespace util {
53 class XStringMapping;
55 namespace xml { namespace sax {
56 class XAttributeList;
58 namespace drawing {
59 class XShapes;
61 }}}
63 // ----------------------------------------
65 struct SeriesDefaultsAndStyles
67 //default values for series:
68 ::com::sun::star::uno::Any maSymbolTypeDefault;
69 ::com::sun::star::uno::Any maDataCaptionDefault;
71 ::com::sun::star::uno::Any maErrorIndicatorDefault;
72 ::com::sun::star::uno::Any maErrorCategoryDefault;
73 ::com::sun::star::uno::Any maConstantErrorLowDefault;
74 ::com::sun::star::uno::Any maConstantErrorHighDefault;
75 ::com::sun::star::uno::Any maPercentageErrorDefault;
76 ::com::sun::star::uno::Any maErrorMarginDefault;
78 ::com::sun::star::uno::Any maMeanValueDefault;
79 ::com::sun::star::uno::Any maRegressionCurvesDefault;
81 ::com::sun::star::uno::Any maStackedDefault;
82 ::com::sun::star::uno::Any maPercentDefault;
83 ::com::sun::star::uno::Any maDeepDefault;
84 ::com::sun::star::uno::Any maStackedBarsConnectedDefault;
86 //additional information
87 ::com::sun::star::uno::Any maLinesOnProperty;
89 //styles for series and datapoints
90 ::std::list< DataRowPointStyle > maSeriesStyleList;
93 class SchXMLChartContext : public SvXMLImportContext
95 public:
96 SchXMLChartContext( SchXMLImportHelper& rImpHelper,
97 SvXMLImport& rImport, const rtl::OUString& rLocalName );
98 virtual ~SchXMLChartContext();
100 virtual void StartElement( const com::sun::star::uno::Reference<
101 com::sun::star::xml::sax::XAttributeList >& xAttrList );
102 virtual void EndElement();
103 virtual SvXMLImportContext *CreateChildContext(
104 sal_uInt16 nPrefix,
105 const rtl::OUString& rLocalName,
106 const com::sun::star::uno::Reference<
107 com::sun::star::xml::sax::XAttributeList >& xAttrList );
109 private:
110 SchXMLTable maTable;
111 SchXMLImportHelper& mrImportHelper;
113 ::rtl::OUString maMainTitle, maSubTitle;
114 com::sun::star::awt::Point maMainTitlePos, maSubTitlePos, maLegendPos;
115 ::rtl::OUString m_aXLinkHRefAttributeToIndicateDataProvider;
116 bool m_bHasRangeAtPlotArea;
117 bool m_bHasTableElement;
118 sal_Bool mbAllRangeAddressesAvailable;
119 sal_Bool mbColHasLabels;
120 sal_Bool mbRowHasLabels;
121 ::com::sun::star::chart::ChartDataRowSource meDataRowSource;
122 bool mbIsStockChart;
124 com::sun::star::uno::Sequence< com::sun::star::chart::ChartSeriesAddress > maSeriesAddresses;
125 ::rtl::OUString msCategoriesAddress;
126 ::rtl::OUString msChartAddress;
128 SeriesDefaultsAndStyles maSeriesDefaultsAndStyles;
129 tSchXMLLSequencesPerIndex maLSequencesPerIndex;
131 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxDrawPage;
132 ::rtl::OUString msColTrans;
133 ::rtl::OUString msRowTrans;
134 ::rtl::OUString maChartTypeServiceName;
136 ::com::sun::star::awt::Size maChartSize;
138 /** @descr This method bundles some settings to the chart model and executes them with
139 a locked controller. This includes setting the chart type.
140 @param aServiceName The name of the service the diagram is initialized with.
141 @param bSetWitchData Indicates whether the data set takes it's data series from
142 rows or from columns.
144 void InitChart (const ::rtl::OUString & rChartTypeServiceName,
145 sal_Bool bSetSwitchData);
147 void MergeSeriesForStockChart();
150 // ----------------------------------------
152 class SchXMLTitleContext : public SvXMLImportContext
154 private:
155 SchXMLImportHelper& mrImportHelper;
156 rtl::OUString& mrTitle;
157 com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxTitleShape;
158 rtl::OUString msAutoStyleName;
160 public:
161 SchXMLTitleContext( SchXMLImportHelper& rImpHelper,
162 SvXMLImport& rImport, const rtl::OUString& rLocalName,
163 rtl::OUString& rTitle,
164 com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xTitleShape );
165 virtual ~SchXMLTitleContext();
167 virtual void StartElement( const com::sun::star::uno::Reference<
168 com::sun::star::xml::sax::XAttributeList >& xAttrList );
169 virtual SvXMLImportContext *CreateChildContext(
170 sal_uInt16 nPrefix,
171 const rtl::OUString& rLocalName,
172 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
175 #endif // _SCH_XMLCHARTCONTEXT_HXX_
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */