1*ecfe53c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ecfe53c5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ecfe53c5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ecfe53c5SAndrew Rist  * distributed with this work for additional information
6*ecfe53c5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ecfe53c5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ecfe53c5SAndrew Rist  * "License"); you may not use this file except in compliance
9*ecfe53c5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ecfe53c5SAndrew Rist  *
11*ecfe53c5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ecfe53c5SAndrew Rist  *
13*ecfe53c5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ecfe53c5SAndrew Rist  * software distributed under the License is distributed on an
15*ecfe53c5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ecfe53c5SAndrew Rist  * KIND, either express or implied.  See the License for the
17*ecfe53c5SAndrew Rist  * specific language governing permissions and limitations
18*ecfe53c5SAndrew Rist  * under the License.
19*ecfe53c5SAndrew Rist  *
20*ecfe53c5SAndrew Rist  *************************************************************/
21*ecfe53c5SAndrew Rist 
22*ecfe53c5SAndrew Rist 
23cdf0e10cSrcweir #ifndef XMLOFF_SCHXMLSERIES2CONTEXT_HXX
24cdf0e10cSrcweir #define XMLOFF_SCHXMLSERIES2CONTEXT_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "transporttypes.hxx"
27cdf0e10cSrcweir #include "SchXMLChartContext.hxx"
28cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx>
29cdf0e10cSrcweir #include <xmloff/SchXMLImportHelper.hxx>
30cdf0e10cSrcweir // header for class SvXMLStyleContext
31cdf0e10cSrcweir #include <xmloff/xmlstyle.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <vector>
34cdf0e10cSrcweir #include <list>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace com { namespace sun { namespace star {
37cdf0e10cSrcweir     namespace chart2 {
38cdf0e10cSrcweir         class XChartDocument;
39cdf0e10cSrcweir         class XDataSeries;
40cdf0e10cSrcweir     }
41cdf0e10cSrcweir     namespace awt {
42cdf0e10cSrcweir         struct Size;
43cdf0e10cSrcweir     }
44cdf0e10cSrcweir }}}
45cdf0e10cSrcweir 
46cdf0e10cSrcweir // class for child contexts: series, data point and statistics objects
47cdf0e10cSrcweir class SchXMLSeries2Context : public SvXMLImportContext
48cdf0e10cSrcweir {
49cdf0e10cSrcweir private:
50cdf0e10cSrcweir 	SchXMLImportHelper& mrImportHelper;
51cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
52cdf0e10cSrcweir             ::com::sun::star::chart2::XChartDocument > mxNewDoc;
53cdf0e10cSrcweir 	::std::vector< SchXMLAxis >& mrAxes;
54cdf0e10cSrcweir 	::std::list< DataRowPointStyle >& mrStyleList;
55cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > m_xSeries;
56cdf0e10cSrcweir     sal_Int32 mnSeriesIndex;
57cdf0e10cSrcweir     sal_Int32 mnDataPointIndex;
58cdf0e10cSrcweir 	sal_Bool m_bStockHasVolume;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     GlobalSeriesImportInfo& m_rGlobalSeriesImportInfo;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir     SchXMLAxis* mpAttachedAxis;
63cdf0e10cSrcweir     sal_Int32 mnAttachedAxis;
64cdf0e10cSrcweir     ::rtl::OUString msAutoStyleName;
65cdf0e10cSrcweir     ::std::vector< ::rtl::OUString > maDomainAddresses;
66cdf0e10cSrcweir     ::rtl::OUString maGlobalChartTypeName;
67cdf0e10cSrcweir     ::rtl::OUString maSeriesChartTypeName;
68cdf0e10cSrcweir     ::rtl::OUString m_aSeriesRange;
69cdf0e10cSrcweir     ::rtl::OUString m_aSeriesLabelRange;
70cdf0e10cSrcweir     bool            m_bHasDomainContext;
71cdf0e10cSrcweir     tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
72cdf0e10cSrcweir     tSchXMLLSequencesPerIndex maPostponedSequences;
73cdf0e10cSrcweir     bool& mrGlobalChartTypeUsedBySeries;
74cdf0e10cSrcweir     bool mbSymbolSizeIsMissingInFile;
75cdf0e10cSrcweir     ::com::sun::star::awt::Size maChartSize;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir public:
78cdf0e10cSrcweir 	SchXMLSeries2Context( SchXMLImportHelper& rImpHelper,
79cdf0e10cSrcweir                           SvXMLImport& rImport, const rtl::OUString& rLocalName,
80cdf0e10cSrcweir                           const ::com::sun::star::uno::Reference<
81cdf0e10cSrcweir                               ::com::sun::star::chart2::XChartDocument > & xNewDoc,
82cdf0e10cSrcweir                           std::vector< SchXMLAxis >& rAxes,
83cdf0e10cSrcweir                           ::std::list< DataRowPointStyle >& rStyleList,
84cdf0e10cSrcweir                           sal_Int32 nSeriesIndex,
85cdf0e10cSrcweir                           sal_Bool bStockHasVolume,
86cdf0e10cSrcweir                           GlobalSeriesImportInfo& rGlobalSeriesImportInfo,
87cdf0e10cSrcweir                           const ::rtl::OUString & aGlobalChartTypeName,
88cdf0e10cSrcweir                           tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
89cdf0e10cSrcweir                           bool& rGlobalChartTypeUsedBySeries,
90cdf0e10cSrcweir                           const ::com::sun::star::awt::Size & rChartSize );
91cdf0e10cSrcweir 	virtual ~SchXMLSeries2Context();
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
94cdf0e10cSrcweir 	virtual SvXMLImportContext* CreateChildContext(
95cdf0e10cSrcweir 		sal_uInt16 nPrefix,
96cdf0e10cSrcweir 		const rtl::OUString& rLocalName,
97cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
98cdf0e10cSrcweir 	virtual void EndElement();
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     static void initSeriesPropertySets( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
101cdf0e10cSrcweir         , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     static void setDefaultsToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles );
104cdf0e10cSrcweir 
105cdf0e10cSrcweir     static void setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
106cdf0e10cSrcweir         , const SvXMLStylesContext* pStylesCtxt
107cdf0e10cSrcweir         , const SvXMLStyleContext*& rpStyle
108cdf0e10cSrcweir         , ::rtl::OUString& rCurrStyleName
109cdf0e10cSrcweir         , SchXMLImportHelper& rImportHelper
110cdf0e10cSrcweir         , const SvXMLImport& rImport
111cdf0e10cSrcweir         , bool bIsStockChart
112cdf0e10cSrcweir         , tSchXMLLSequencesPerIndex & rInOutLSequencesPerIndex );
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     static void setStylesToStatisticsObjects( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
115cdf0e10cSrcweir         , const SvXMLStylesContext* pStylesCtxt
116cdf0e10cSrcweir         , const SvXMLStyleContext*& rpStyle
117cdf0e10cSrcweir         , ::rtl::OUString& rCurrStyleName );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     static void setStylesToDataPoints( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles
120cdf0e10cSrcweir         , const SvXMLStylesContext* pStylesCtxt
121cdf0e10cSrcweir         , const SvXMLStyleContext*& rpStyle
122cdf0e10cSrcweir         , ::rtl::OUString& rCurrStyleName
123cdf0e10cSrcweir         , SchXMLImportHelper& rImportHelper
124cdf0e10cSrcweir         , const SvXMLImport& rImport
125cdf0e10cSrcweir         , bool bIsStockChart, bool bIsDonutChart, bool bSwitchOffLinesForScatter );
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     static void switchSeriesLinesOff( ::std::list< DataRowPointStyle >& rSeriesStyleList );
128cdf0e10cSrcweir };
129cdf0e10cSrcweir 
130cdf0e10cSrcweir // XMLOFF_SCHXMLSERIES2CONTEXT_HXX
131cdf0e10cSrcweir #endif
132