1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SchXMLChartContext.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SCH_XMLCHARTCONTEXT_HXX_
31 #define _SCH_XMLCHARTCONTEXT_HXX_
33 #include <xmloff/xmlictxt.hxx>
34 #include <com/sun/star/uno/Sequence.h>
35 #include <com/sun/star/drawing/XShape.hpp>
36 #include <com/sun/star/chart/ChartDataRowSource.hpp>
37 #include <com/sun/star/chart2/XChartDocument.hpp>
38 #include <com/sun/star/awt/Size.hpp>
40 #include "transporttypes.hxx"
46 class SchXMLImportHelper
;
48 namespace com
{ namespace sun
{ namespace star
{
52 struct ChartSeriesAddress
;
57 namespace xml
{ namespace sax
{
65 // ----------------------------------------
67 struct SeriesDefaultsAndStyles
69 //default values for series:
70 ::com::sun::star::uno::Any maSymbolTypeDefault
;
71 ::com::sun::star::uno::Any maDataCaptionDefault
;
73 ::com::sun::star::uno::Any maErrorIndicatorDefault
;
74 ::com::sun::star::uno::Any maErrorCategoryDefault
;
75 ::com::sun::star::uno::Any maConstantErrorLowDefault
;
76 ::com::sun::star::uno::Any maConstantErrorHighDefault
;
77 ::com::sun::star::uno::Any maPercentageErrorDefault
;
78 ::com::sun::star::uno::Any maErrorMarginDefault
;
80 ::com::sun::star::uno::Any maMeanValueDefault
;
81 ::com::sun::star::uno::Any maRegressionCurvesDefault
;
83 ::com::sun::star::uno::Any maStackedDefault
;
84 ::com::sun::star::uno::Any maPercentDefault
;
85 ::com::sun::star::uno::Any maDeepDefault
;
86 ::com::sun::star::uno::Any maStackedBarsConnectedDefault
;
88 //additional information
89 ::com::sun::star::uno::Any maLinesOnProperty
;
91 //styles for series and datapoints
92 ::std::list
< DataRowPointStyle
> maSeriesStyleList
;
95 class SchXMLChartContext
: public SvXMLImportContext
98 SchXMLChartContext( SchXMLImportHelper
& rImpHelper
,
99 SvXMLImport
& rImport
, const rtl::OUString
& rLocalName
);
100 virtual ~SchXMLChartContext();
102 virtual void StartElement( const com::sun::star::uno::Reference
<
103 com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
104 virtual void EndElement();
105 virtual SvXMLImportContext
*CreateChildContext(
107 const rtl::OUString
& rLocalName
,
108 const com::sun::star::uno::Reference
<
109 com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
113 SchXMLImportHelper
& mrImportHelper
;
115 ::rtl::OUString maMainTitle
, maSubTitle
;
116 com::sun::star::awt::Point maMainTitlePos
, maSubTitlePos
, maLegendPos
;
117 ::rtl::OUString m_aXLinkHRefAttributeToIndicateDataProvider
;
118 bool m_bHasRangeAtPlotArea
;
119 bool m_bHasTableElement
;
120 sal_Bool mbAllRangeAddressesAvailable
;
121 sal_Bool mbColHasLabels
;
122 sal_Bool mbRowHasLabels
;
123 ::com::sun::star::chart::ChartDataRowSource meDataRowSource
;
126 com::sun::star::uno::Sequence
< com::sun::star::chart::ChartSeriesAddress
> maSeriesAddresses
;
127 ::rtl::OUString msCategoriesAddress
;
128 ::rtl::OUString msChartAddress
;
130 SeriesDefaultsAndStyles maSeriesDefaultsAndStyles
;
131 tSchXMLLSequencesPerIndex maLSequencesPerIndex
;
133 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
> mxDrawPage
;
134 ::rtl::OUString msColTrans
;
135 ::rtl::OUString msRowTrans
;
136 ::rtl::OUString maChartTypeServiceName
;
138 ::com::sun::star::awt::Size maChartSize
;
140 /** @descr This method bundles some settings to the chart model and executes them with
141 a locked controller. This includes setting the chart type.
142 @param aServiceName The name of the service the diagram is initialized with.
143 @param bSetWitchData Indicates wether the data set takes it's data series from
144 rows or from columns.
146 void InitChart (const ::rtl::OUString
& rChartTypeServiceName
,
147 sal_Bool bSetSwitchData
);
149 void MergeSeriesForStockChart();
152 // ----------------------------------------
154 class SchXMLTitleContext
: public SvXMLImportContext
157 SchXMLImportHelper
& mrImportHelper
;
158 rtl::OUString
& mrTitle
;
159 com::sun::star::uno::Reference
< com::sun::star::drawing::XShape
> mxTitleShape
;
160 rtl::OUString msAutoStyleName
;
163 SchXMLTitleContext( SchXMLImportHelper
& rImpHelper
,
164 SvXMLImport
& rImport
, const rtl::OUString
& rLocalName
,
165 rtl::OUString
& rTitle
,
166 com::sun::star::uno::Reference
< com::sun::star::drawing::XShape
>& xTitleShape
);
167 virtual ~SchXMLTitleContext();
169 virtual void StartElement( const com::sun::star::uno::Reference
<
170 com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
171 virtual SvXMLImportContext
*CreateChildContext(
173 const rtl::OUString
& rLocalName
,
174 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
177 // ----------------------------------------
179 class SchXMLLegendContext
: public SvXMLImportContext
182 SchXMLImportHelper
& mrImportHelper
;
185 SchXMLLegendContext( SchXMLImportHelper
& rImpHelper
,
186 SvXMLImport
& rImport
, const rtl::OUString
& rLocalName
);
187 virtual ~SchXMLLegendContext();
189 virtual void StartElement( const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
192 #endif // _SCH_XMLCHARTCONTEXT_HXX_