1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef XMLOFF_SCHXMLSERIES2CONTEXT_HXX
28*cdf0e10cSrcweir #define XMLOFF_SCHXMLSERIES2CONTEXT_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include "transporttypes.hxx"
31*cdf0e10cSrcweir #include "SchXMLChartContext.hxx"
32*cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx>
33*cdf0e10cSrcweir #include <xmloff/SchXMLImportHelper.hxx>
34*cdf0e10cSrcweir // header for class SvXMLStyleContext
35*cdf0e10cSrcweir #include <xmloff/xmlstyle.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <vector>
38*cdf0e10cSrcweir #include <list>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir namespace com { namespace sun { namespace star {
41*cdf0e10cSrcweir     namespace chart2 {
42*cdf0e10cSrcweir         class XChartDocument;
43*cdf0e10cSrcweir         class XDataSeries;
44*cdf0e10cSrcweir     }
45*cdf0e10cSrcweir     namespace awt {
46*cdf0e10cSrcweir         struct Size;
47*cdf0e10cSrcweir     }
48*cdf0e10cSrcweir }}}
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir // class for child contexts: series, data point and statistics objects
51*cdf0e10cSrcweir class SchXMLSeries2Context : public SvXMLImportContext
52*cdf0e10cSrcweir {
53*cdf0e10cSrcweir private:
54*cdf0e10cSrcweir 	SchXMLImportHelper& mrImportHelper;
55*cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
56*cdf0e10cSrcweir             ::com::sun::star::chart2::XChartDocument > mxNewDoc;
57*cdf0e10cSrcweir 	::std::vector< SchXMLAxis >& mrAxes;
58*cdf0e10cSrcweir 	::std::list< DataRowPointStyle >& mrStyleList;
59*cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > m_xSeries;
60*cdf0e10cSrcweir     sal_Int32 mnSeriesIndex;
61*cdf0e10cSrcweir     sal_Int32 mnDataPointIndex;
62*cdf0e10cSrcweir 	sal_Bool m_bStockHasVolume;
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir     GlobalSeriesImportInfo& m_rGlobalSeriesImportInfo;
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir     SchXMLAxis* mpAttachedAxis;
67*cdf0e10cSrcweir     sal_Int32 mnAttachedAxis;
68*cdf0e10cSrcweir     ::rtl::OUString msAutoStyleName;
69*cdf0e10cSrcweir     ::std::vector< ::rtl::OUString > maDomainAddresses;
70*cdf0e10cSrcweir     ::rtl::OUString maGlobalChartTypeName;
71*cdf0e10cSrcweir     ::rtl::OUString maSeriesChartTypeName;
72*cdf0e10cSrcweir     ::rtl::OUString m_aSeriesRange;
73*cdf0e10cSrcweir     ::rtl::OUString m_aSeriesLabelRange;
74*cdf0e10cSrcweir     bool            m_bHasDomainContext;
75*cdf0e10cSrcweir     tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
76*cdf0e10cSrcweir     tSchXMLLSequencesPerIndex maPostponedSequences;
77*cdf0e10cSrcweir     bool& mrGlobalChartTypeUsedBySeries;
78*cdf0e10cSrcweir     bool mbSymbolSizeIsMissingInFile;
79*cdf0e10cSrcweir     ::com::sun::star::awt::Size maChartSize;
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir public:
82*cdf0e10cSrcweir 	SchXMLSeries2Context( SchXMLImportHelper& rImpHelper,
83*cdf0e10cSrcweir                           SvXMLImport& rImport, const rtl::OUString& rLocalName,
84*cdf0e10cSrcweir                           const ::com::sun::star::uno::Reference<
85*cdf0e10cSrcweir                               ::com::sun::star::chart2::XChartDocument > & xNewDoc,
86*cdf0e10cSrcweir                           std::vector< SchXMLAxis >& rAxes,
87*cdf0e10cSrcweir                           ::std::list< DataRowPointStyle >& rStyleList,
88*cdf0e10cSrcweir                           sal_Int32 nSeriesIndex,
89*cdf0e10cSrcweir                           sal_Bool bStockHasVolume,
90*cdf0e10cSrcweir                           GlobalSeriesImportInfo& rGlobalSeriesImportInfo,
91*cdf0e10cSrcweir                           const ::rtl::OUString & aGlobalChartTypeName,
92*cdf0e10cSrcweir                           tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
93*cdf0e10cSrcweir                           bool& rGlobalChartTypeUsedBySeries,
94*cdf0e10cSrcweir                           const ::com::sun::star::awt::Size & rChartSize );
95*cdf0e10cSrcweir 	virtual ~SchXMLSeries2Context();
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
98*cdf0e10cSrcweir 	virtual SvXMLImportContext* CreateChildContext(
99*cdf0e10cSrcweir 		sal_uInt16 nPrefix,
100*cdf0e10cSrcweir 		const rtl::OUString& rLocalName,
101*cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
102*cdf0e10cSrcweir 	virtual void EndElement();
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir     static void initSeriesPropertySets( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
105*cdf0e10cSrcweir         , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     static void setDefaultsToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles );
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir     static void setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
110*cdf0e10cSrcweir         , const SvXMLStylesContext* pStylesCtxt
111*cdf0e10cSrcweir         , const SvXMLStyleContext*& rpStyle
112*cdf0e10cSrcweir         , ::rtl::OUString& rCurrStyleName
113*cdf0e10cSrcweir         , SchXMLImportHelper& rImportHelper
114*cdf0e10cSrcweir         , const SvXMLImport& rImport
115*cdf0e10cSrcweir         , bool bIsStockChart
116*cdf0e10cSrcweir         , tSchXMLLSequencesPerIndex & rInOutLSequencesPerIndex );
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     static void setStylesToStatisticsObjects( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
119*cdf0e10cSrcweir         , const SvXMLStylesContext* pStylesCtxt
120*cdf0e10cSrcweir         , const SvXMLStyleContext*& rpStyle
121*cdf0e10cSrcweir         , ::rtl::OUString& rCurrStyleName );
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir     static void setStylesToDataPoints( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
124*cdf0e10cSrcweir         , const SvXMLStylesContext* pStylesCtxt
125*cdf0e10cSrcweir         , const SvXMLStyleContext*& rpStyle
126*cdf0e10cSrcweir         , ::rtl::OUString& rCurrStyleName
127*cdf0e10cSrcweir         , SchXMLImportHelper& rImportHelper
128*cdf0e10cSrcweir         , const SvXMLImport& rImport
129*cdf0e10cSrcweir         , bool bIsStockChart, bool bIsDonutChart, bool bSwitchOffLinesForScatter );
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir     static void switchSeriesLinesOff( ::std::list< DataRowPointStyle >& rSeriesStyleList );
132*cdf0e10cSrcweir };
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir // XMLOFF_SCHXMLSERIES2CONTEXT_HXX
135*cdf0e10cSrcweir #endif
136