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 _SCH_XMLPLOTAREACONTEXT_HXX_ 28*cdf0e10cSrcweir #define _SCH_XMLPLOTAREACONTEXT_HXX_ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include "SchXMLImport.hxx" 31*cdf0e10cSrcweir #include "SchXMLChartContext.hxx" 32*cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx> 33*cdf0e10cSrcweir #include <xmloff/shapeimport.hxx> 34*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 35*cdf0e10cSrcweir #include <com/sun/star/chart/ChartSeriesAddress.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/chart/ChartDataRowSource.hpp> 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir #include "transporttypes.hxx" 39*cdf0e10cSrcweir 40*cdf0e10cSrcweir class SvXMLImport; 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir namespace com { namespace sun { namespace star { 43*cdf0e10cSrcweir namespace chart { 44*cdf0e10cSrcweir class XDiagram; 45*cdf0e10cSrcweir class X3DDisplay; 46*cdf0e10cSrcweir class XStatisticDisplay; 47*cdf0e10cSrcweir } 48*cdf0e10cSrcweir namespace chart2 { 49*cdf0e10cSrcweir class XChartDocument; 50*cdf0e10cSrcweir } 51*cdf0e10cSrcweir namespace xml { namespace sax { 52*cdf0e10cSrcweir class XAttributeList; 53*cdf0e10cSrcweir }}}}} 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir // ---------------------------------------- 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir class SchXML3DSceneAttributesHelper : public SdXML3DSceneAttributesHelper 58*cdf0e10cSrcweir { 59*cdf0e10cSrcweir public: 60*cdf0e10cSrcweir SchXML3DSceneAttributesHelper( SvXMLImport& rImporter ); 61*cdf0e10cSrcweir virtual ~SchXML3DSceneAttributesHelper(); 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir void getCameraDefaultFromDiagram( const ::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram ); 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir private: 66*cdf0e10cSrcweir SchXML3DSceneAttributesHelper(); 67*cdf0e10cSrcweir }; 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir // ---------------------------------------- 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir class SchXMLPositonAttributesHelper 72*cdf0e10cSrcweir { 73*cdf0e10cSrcweir public: 74*cdf0e10cSrcweir SchXMLPositonAttributesHelper( SvXMLImport& rImporter ); 75*cdf0e10cSrcweir ~SchXMLPositonAttributesHelper(); 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir bool readPositioningAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ); 78*cdf0e10cSrcweir void readAutomaticPositioningProperties( XMLPropStyleContext* pPropStyleContext, const SvXMLStylesContext* pStylesCtxt ); 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir bool hasPosSize() const; 81*cdf0e10cSrcweir bool isAutomatic() const; 82*cdf0e10cSrcweir ::com::sun::star::awt::Rectangle getRectangle() const; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir private: 86*cdf0e10cSrcweir bool hasSize() const; 87*cdf0e10cSrcweir bool hasPosition() const; 88*cdf0e10cSrcweir ::com::sun::star::awt::Size getSize() const; 89*cdf0e10cSrcweir ::com::sun::star::awt::Point getPosition() const; 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir SvXMLImport& m_rImport; 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir ::com::sun::star::awt::Point m_aPosition; 94*cdf0e10cSrcweir ::com::sun::star::awt::Size m_aSize; 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir bool m_bHasSizeWidth; 97*cdf0e10cSrcweir bool m_bHasSizeHeight; 98*cdf0e10cSrcweir bool m_bHasPositionX; 99*cdf0e10cSrcweir bool m_bHasPositionY; 100*cdf0e10cSrcweir sal_Bool m_bAutoSize; 101*cdf0e10cSrcweir sal_Bool m_bAutoPosition; 102*cdf0e10cSrcweir }; 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir // ---------------------------------------- 105*cdf0e10cSrcweir 106*cdf0e10cSrcweir class SchXMLPlotAreaContext : public SvXMLImportContext 107*cdf0e10cSrcweir { 108*cdf0e10cSrcweir public: 109*cdf0e10cSrcweir SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper, 110*cdf0e10cSrcweir SvXMLImport& rImport, const rtl::OUString& rLocalName, 111*cdf0e10cSrcweir const rtl::OUString& rXLinkHRefAttributeToIndicateDataProvider, 112*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< 113*cdf0e10cSrcweir ::com::sun::star::chart::ChartSeriesAddress >& rSeriesAddresses, 114*cdf0e10cSrcweir ::rtl::OUString& rCategoriesAddress, 115*cdf0e10cSrcweir ::rtl::OUString& rChartAddress, 116*cdf0e10cSrcweir bool& bHasRangeAtPlotArea, 117*cdf0e10cSrcweir sal_Bool & rAllRangeAddressesAvailable, 118*cdf0e10cSrcweir sal_Bool & rColHasLabels, 119*cdf0e10cSrcweir sal_Bool & rRowHasLabels, 120*cdf0e10cSrcweir ::com::sun::star::chart::ChartDataRowSource & rDataRowSource, 121*cdf0e10cSrcweir SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles, 122*cdf0e10cSrcweir const ::rtl::OUString& aChartTypeServiceName, 123*cdf0e10cSrcweir tSchXMLLSequencesPerIndex & rLSequencesPerIndex, 124*cdf0e10cSrcweir const ::com::sun::star::awt::Size & rChartSize ); 125*cdf0e10cSrcweir virtual ~SchXMLPlotAreaContext(); 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 128*cdf0e10cSrcweir virtual SvXMLImportContext* CreateChildContext( 129*cdf0e10cSrcweir sal_uInt16 nPrefix, 130*cdf0e10cSrcweir const rtl::OUString& rLocalName, 131*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 132*cdf0e10cSrcweir virtual void EndElement(); 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir private: 135*cdf0e10cSrcweir SchXMLImportHelper& mrImportHelper; 136*cdf0e10cSrcweir ::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram; 137*cdf0e10cSrcweir ::com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > mxNewDoc; 138*cdf0e10cSrcweir ::std::vector< SchXMLAxis > maAxes; 139*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::chart::ChartSeriesAddress >& mrSeriesAddresses; 140*cdf0e10cSrcweir rtl::OUString& mrCategoriesAddress; 141*cdf0e10cSrcweir SeriesDefaultsAndStyles& mrSeriesDefaultsAndStyles; 142*cdf0e10cSrcweir sal_Int32 mnNumOfLinesProp; 143*cdf0e10cSrcweir sal_Bool mbStockHasVolume; 144*cdf0e10cSrcweir sal_Int32 mnSeries; 145*cdf0e10cSrcweir GlobalSeriesImportInfo m_aGlobalSeriesImportInfo; 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir SchXML3DSceneAttributesHelper maSceneImportHelper; 148*cdf0e10cSrcweir SchXMLPositonAttributesHelper m_aOuterPositioning;//including axes and axes titles 149*cdf0e10cSrcweir SchXMLPositonAttributesHelper m_aInnerPositioning;//excluding axes and axes titles 150*cdf0e10cSrcweir bool mbPercentStacked; 151*cdf0e10cSrcweir bool m_bAxisPositionAttributeImported; 152*cdf0e10cSrcweir ::rtl::OUString msAutoStyleName; 153*cdf0e10cSrcweir const ::rtl::OUString& m_rXLinkHRefAttributeToIndicateDataProvider; 154*cdf0e10cSrcweir ::rtl::OUString& mrChartAddress; 155*cdf0e10cSrcweir bool& m_rbHasRangeAtPlotArea; 156*cdf0e10cSrcweir sal_Bool & mrColHasLabels; 157*cdf0e10cSrcweir sal_Bool & mrRowHasLabels; 158*cdf0e10cSrcweir ::com::sun::star::chart::ChartDataRowSource & mrDataRowSource; 159*cdf0e10cSrcweir ::rtl::OUString maChartTypeServiceName; 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir tSchXMLLSequencesPerIndex & mrLSequencesPerIndex; 162*cdf0e10cSrcweir 163*cdf0e10cSrcweir bool mbGlobalChartTypeUsedBySeries; 164*cdf0e10cSrcweir ::com::sun::star::awt::Size maChartSize; 165*cdf0e10cSrcweir }; 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir //---------------------------------------- 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir class SchXMLDataPointContext : public SvXMLImportContext 170*cdf0e10cSrcweir { 171*cdf0e10cSrcweir private: 172*cdf0e10cSrcweir SchXMLImportHelper& mrImportHelper; 173*cdf0e10cSrcweir ::std::list< DataRowPointStyle >& mrStyleList; 174*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 175*cdf0e10cSrcweir ::com::sun::star::chart2::XDataSeries > m_xSeries; 176*cdf0e10cSrcweir sal_Int32& mrIndex; 177*cdf0e10cSrcweir bool mbSymbolSizeForSeriesIsMissingInFile; 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir public: 180*cdf0e10cSrcweir SchXMLDataPointContext( SchXMLImportHelper& rImpHelper, 181*cdf0e10cSrcweir SvXMLImport& rImport, const rtl::OUString& rLocalName, 182*cdf0e10cSrcweir ::std::list< DataRowPointStyle >& rStyleList, 183*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 184*cdf0e10cSrcweir ::com::sun::star::chart2::XDataSeries >& xSeries, sal_Int32& rIndex, 185*cdf0e10cSrcweir bool bSymbolSizeForSeriesIsMissingInFile ); 186*cdf0e10cSrcweir virtual ~SchXMLDataPointContext(); 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 189*cdf0e10cSrcweir }; 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir // ---------------------------------------- 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir class SchXMLCoordinateRegionContext : public SvXMLImportContext 194*cdf0e10cSrcweir { 195*cdf0e10cSrcweir public: 196*cdf0e10cSrcweir SchXMLCoordinateRegionContext( 197*cdf0e10cSrcweir SvXMLImport& rImport 198*cdf0e10cSrcweir , sal_uInt16 nPrefix 199*cdf0e10cSrcweir , const rtl::OUString& rLocalName 200*cdf0e10cSrcweir , SchXMLPositonAttributesHelper& rPositioning ); 201*cdf0e10cSrcweir virtual ~SchXMLCoordinateRegionContext(); 202*cdf0e10cSrcweir virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir private: 205*cdf0e10cSrcweir SchXMLPositonAttributesHelper& m_rPositioning; 206*cdf0e10cSrcweir }; 207*cdf0e10cSrcweir 208*cdf0e10cSrcweir // ---------------------------------------- 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir class SchXMLWallFloorContext : public SvXMLImportContext 211*cdf0e10cSrcweir { 212*cdf0e10cSrcweir public: 213*cdf0e10cSrcweir enum ContextType 214*cdf0e10cSrcweir { 215*cdf0e10cSrcweir CONTEXT_TYPE_WALL, 216*cdf0e10cSrcweir CONTEXT_TYPE_FLOOR 217*cdf0e10cSrcweir }; 218*cdf0e10cSrcweir 219*cdf0e10cSrcweir private: 220*cdf0e10cSrcweir SchXMLImportHelper& mrImportHelper; 221*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart::X3DDisplay > mxWallFloorSupplier; 222*cdf0e10cSrcweir ContextType meContextType; 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir public: 225*cdf0e10cSrcweir SchXMLWallFloorContext( SchXMLImportHelper& rImportHelper, 226*cdf0e10cSrcweir SvXMLImport& rImport, 227*cdf0e10cSrcweir sal_uInt16 nPrefix, 228*cdf0e10cSrcweir const rtl::OUString& rLocalName, 229*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram, 230*cdf0e10cSrcweir ContextType eContextType ); 231*cdf0e10cSrcweir virtual ~SchXMLWallFloorContext(); 232*cdf0e10cSrcweir virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 233*cdf0e10cSrcweir }; 234*cdf0e10cSrcweir 235*cdf0e10cSrcweir // ---------------------------------------- 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir class SchXMLStockContext : public SvXMLImportContext 238*cdf0e10cSrcweir { 239*cdf0e10cSrcweir public: 240*cdf0e10cSrcweir enum ContextType 241*cdf0e10cSrcweir { 242*cdf0e10cSrcweir CONTEXT_TYPE_GAIN, 243*cdf0e10cSrcweir CONTEXT_TYPE_LOSS, 244*cdf0e10cSrcweir CONTEXT_TYPE_RANGE 245*cdf0e10cSrcweir }; 246*cdf0e10cSrcweir 247*cdf0e10cSrcweir private: 248*cdf0e10cSrcweir SchXMLImportHelper& mrImportHelper; 249*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart::XStatisticDisplay > mxStockPropProvider; 250*cdf0e10cSrcweir ContextType meContextType; 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir public: 253*cdf0e10cSrcweir SchXMLStockContext( SchXMLImportHelper& rImportHelper, 254*cdf0e10cSrcweir SvXMLImport& rImport, 255*cdf0e10cSrcweir sal_uInt16 nPrefix, 256*cdf0e10cSrcweir const rtl::OUString& rLocalName, 257*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram, 258*cdf0e10cSrcweir ContextType eContextType ); 259*cdf0e10cSrcweir virtual ~SchXMLStockContext(); 260*cdf0e10cSrcweir virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 261*cdf0e10cSrcweir }; 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir // ---------------------------------------- 264*cdf0e10cSrcweir 265*cdf0e10cSrcweir class SchXMLStatisticsObjectContext : public SvXMLImportContext 266*cdf0e10cSrcweir { 267*cdf0e10cSrcweir public: 268*cdf0e10cSrcweir enum ContextType 269*cdf0e10cSrcweir { 270*cdf0e10cSrcweir CONTEXT_TYPE_MEAN_VALUE_LINE, 271*cdf0e10cSrcweir CONTEXT_TYPE_REGRESSION_CURVE, 272*cdf0e10cSrcweir CONTEXT_TYPE_ERROR_INDICATOR 273*cdf0e10cSrcweir }; 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir SchXMLStatisticsObjectContext( 276*cdf0e10cSrcweir SchXMLImportHelper& rImportHelper, 277*cdf0e10cSrcweir SvXMLImport& rImport, 278*cdf0e10cSrcweir sal_uInt16 nPrefix, 279*cdf0e10cSrcweir const rtl::OUString& rLocalName, 280*cdf0e10cSrcweir ::std::list< DataRowPointStyle >& rStyleList, 281*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 282*cdf0e10cSrcweir ::com::sun::star::chart2::XDataSeries >& xSeries, 283*cdf0e10cSrcweir ContextType eContextType, 284*cdf0e10cSrcweir const ::com::sun::star::awt::Size & rChartSize ); 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir virtual ~SchXMLStatisticsObjectContext(); 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 289*cdf0e10cSrcweir virtual SvXMLImportContext* CreateChildContext( 290*cdf0e10cSrcweir sal_uInt16 nPrefix, 291*cdf0e10cSrcweir const rtl::OUString& rLocalName, 292*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 293*cdf0e10cSrcweir 294*cdf0e10cSrcweir private: 295*cdf0e10cSrcweir SchXMLImportHelper & mrImportHelper; 296*cdf0e10cSrcweir ::std::list< DataRowPointStyle > & mrStyleList; 297*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 298*cdf0e10cSrcweir ::com::sun::star::chart2::XDataSeries > m_xSeries; 299*cdf0e10cSrcweir ContextType meContextType; 300*cdf0e10cSrcweir ::com::sun::star::awt::Size maChartSize; 301*cdf0e10cSrcweir }; 302*cdf0e10cSrcweir 303*cdf0e10cSrcweir // ---------------------------------------- 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir class SchXMLEquationContext : public SvXMLImportContext 306*cdf0e10cSrcweir { 307*cdf0e10cSrcweir public: 308*cdf0e10cSrcweir SchXMLEquationContext( 309*cdf0e10cSrcweir SchXMLImportHelper& rImportHelper, 310*cdf0e10cSrcweir SvXMLImport& rImport, 311*cdf0e10cSrcweir sal_uInt16 nPrefix, 312*cdf0e10cSrcweir const rtl::OUString& rLocalName, 313*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 314*cdf0e10cSrcweir ::com::sun::star::chart2::XDataSeries >& xSeries, 315*cdf0e10cSrcweir const ::com::sun::star::awt::Size & rChartSize, 316*cdf0e10cSrcweir DataRowPointStyle & rRegressionStyle ); 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir virtual ~SchXMLEquationContext(); 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 321*cdf0e10cSrcweir 322*cdf0e10cSrcweir private: 323*cdf0e10cSrcweir SchXMLImportHelper & mrImportHelper; 324*cdf0e10cSrcweir DataRowPointStyle & mrRegressionStyle; 325*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 326*cdf0e10cSrcweir ::com::sun::star::chart2::XDataSeries > m_xSeries; 327*cdf0e10cSrcweir ::com::sun::star::awt::Size maChartSize; 328*cdf0e10cSrcweir }; 329*cdf0e10cSrcweir 330*cdf0e10cSrcweir #endif // _SCH_XMLPLOTAREACONTEXT_HXX_ 331