update dev300-m58
[ooovba.git] / xmloff / source / chart / SchXMLSeries2Context.hxx
blobcb5a8419742f882f28340e3e4087e07594d36a02
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SchXMLSeries2Context.hxx,v $
10 * $Revision: 1.7 $
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 XMLOFF_SCHXMLSERIES2CONTEXT_HXX
31 #define XMLOFF_SCHXMLSERIES2CONTEXT_HXX
33 #include "transporttypes.hxx"
34 #include "SchXMLChartContext.hxx"
35 #include <xmloff/xmlictxt.hxx>
36 #include <xmloff/SchXMLImportHelper.hxx>
37 // header for class SvXMLStyleContext
38 #include <xmloff/xmlstyle.hxx>
40 #include <vector>
41 #include <list>
43 namespace com { namespace sun { namespace star {
44 namespace chart2 {
45 class XChartDocument;
46 class XDataSeries;
48 namespace awt {
49 struct Size;
51 }}}
53 // class for child contexts: series, data point and statistics objects
54 class SchXMLSeries2Context : public SvXMLImportContext
56 private:
57 SchXMLImportHelper& mrImportHelper;
58 ::com::sun::star::uno::Reference<
59 ::com::sun::star::chart2::XChartDocument > mxNewDoc;
60 ::std::vector< SchXMLAxis >& mrAxes;
61 ::std::list< DataRowPointStyle >& mrStyleList;
62 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > m_xSeries;
63 sal_Int32 mnSeriesIndex;
64 sal_Int32 mnDataPointIndex;
65 sal_Bool m_bStockHasVolume;
67 GlobalSeriesImportInfo& m_rGlobalSeriesImportInfo;
69 SchXMLAxis* mpAttachedAxis;
70 sal_Int32 mnAttachedAxis;
71 ::rtl::OUString msAutoStyleName;
72 ::std::vector< ::rtl::OUString > maDomainAddresses;
73 ::rtl::OUString maGlobalChartTypeName;
74 ::rtl::OUString maSeriesChartTypeName;
75 ::rtl::OUString m_aSeriesRange;
76 ::rtl::OUString m_aSeriesLabelRange;
77 bool m_bHasDomainContext;
78 tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
79 tSchXMLLSequencesPerIndex maPostponedSequences;
80 bool& mrGlobalChartTypeUsedBySeries;
81 bool mbSymbolSizeIsMissingInFile;
82 ::com::sun::star::awt::Size maChartSize;
84 public:
85 SchXMLSeries2Context( SchXMLImportHelper& rImpHelper,
86 SvXMLImport& rImport, const rtl::OUString& rLocalName,
87 const ::com::sun::star::uno::Reference<
88 ::com::sun::star::chart2::XChartDocument > & xNewDoc,
89 std::vector< SchXMLAxis >& rAxes,
90 ::std::list< DataRowPointStyle >& rStyleList,
91 sal_Int32 nSeriesIndex,
92 sal_Bool bStockHasVolume,
93 GlobalSeriesImportInfo& rGlobalSeriesImportInfo,
94 const ::rtl::OUString & aGlobalChartTypeName,
95 tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
96 bool& rGlobalChartTypeUsedBySeries,
97 const ::com::sun::star::awt::Size & rChartSize );
98 virtual ~SchXMLSeries2Context();
100 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
101 virtual SvXMLImportContext* CreateChildContext(
102 USHORT nPrefix,
103 const rtl::OUString& rLocalName,
104 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
105 virtual void EndElement();
107 static void initSeriesPropertySets( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
108 , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
110 static void setDefaultsToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles );
112 static void setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
113 , const SvXMLStylesContext* pStylesCtxt
114 , const SvXMLStyleContext*& rpStyle
115 , ::rtl::OUString& rCurrStyleName
116 , SchXMLImportHelper& rImportHelper
117 , const SvXMLImport& rImport
118 , bool bIsStockChart
119 , tSchXMLLSequencesPerIndex & rInOutLSequencesPerIndex );
121 static void setStylesToStatisticsObjects( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
122 , const SvXMLStylesContext* pStylesCtxt
123 , const SvXMLStyleContext*& rpStyle
124 , ::rtl::OUString& rCurrStyleName );
126 static void setStylesToDataPoints( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
127 , const SvXMLStylesContext* pStylesCtxt
128 , const SvXMLStyleContext*& rpStyle
129 , ::rtl::OUString& rCurrStyleName
130 , SchXMLImportHelper& rImportHelper
131 , const SvXMLImport& rImport
132 , bool bIsStockChart, bool bIsDonutChart, bool bSwitchOffLinesForScatter );
134 static void switchSeriesLinesOff( ::std::list< DataRowPointStyle >& rSeriesStyleList );
137 // XMLOFF_SCHXMLSERIES2CONTEXT_HXX
138 #endif