2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 20:24:20 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:24:20 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:24:20 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:24:20 +00:00
|
|
|
* $RCSfile: SchXMLPlotAreaContext.hxx,v $
|
|
|
|
* $Revision: 1.26 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:24:20 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:24:20 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:24:20 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:24:20 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _SCH_XMLPLOTAREACONTEXT_HXX_
|
|
|
|
#define _SCH_XMLPLOTAREACONTEXT_HXX_
|
|
|
|
|
2008-03-06 14:51:29 +00:00
|
|
|
#include "SchXMLImport.hxx"
|
2007-05-22 15:06:52 +00:00
|
|
|
#include "SchXMLChartContext.hxx"
|
2007-06-27 13:49:11 +00:00
|
|
|
#include <xmloff/xmlictxt.hxx>
|
|
|
|
#include <xmloff/shapeimport.hxx>
|
2007-05-22 15:06:52 +00:00
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <com/sun/star/chart/ChartSeriesAddress.hpp>
|
2007-05-22 15:06:52 +00:00
|
|
|
#include <com/sun/star/chart/ChartDataRowSource.hpp>
|
2001-03-22 11:31:46 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "transporttypes.hxx"
|
|
|
|
|
|
|
|
class SvXMLImport;
|
|
|
|
|
|
|
|
namespace com { namespace sun { namespace star {
|
|
|
|
namespace chart {
|
|
|
|
class XDiagram;
|
2001-01-15 07:58:30 +00:00
|
|
|
class X3DDisplay;
|
2001-12-17 09:22:11 +00:00
|
|
|
class XStatisticDisplay;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2007-05-22 15:06:52 +00:00
|
|
|
namespace chart2 {
|
|
|
|
class XChartDocument;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
namespace xml { namespace sax {
|
|
|
|
class XAttributeList;
|
|
|
|
}}}}}
|
|
|
|
|
2005-07-05 09:56:13 +00:00
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
class SchXML3DSceneAttributesHelper : public SdXML3DSceneAttributesHelper
|
|
|
|
{
|
|
|
|
public:
|
2007-05-22 15:06:52 +00:00
|
|
|
SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
|
|
|
|
virtual ~SchXML3DSceneAttributesHelper();
|
2005-07-05 09:56:13 +00:00
|
|
|
|
2007-05-22 15:06:52 +00:00
|
|
|
void getCameraDefaultFromDiagram( const ::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram );
|
2005-07-05 09:56:13 +00:00
|
|
|
|
|
|
|
private:
|
2007-05-22 15:06:52 +00:00
|
|
|
SchXML3DSceneAttributesHelper();
|
2005-07-05 09:56:13 +00:00
|
|
|
};
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
class SchXMLPlotAreaContext : public SvXMLImportContext
|
|
|
|
{
|
2008-03-06 14:51:29 +00:00
|
|
|
public:
|
|
|
|
SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
|
|
|
|
SvXMLImport& rImport, const rtl::OUString& rLocalName,
|
|
|
|
::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::chart::ChartSeriesAddress >& rSeriesAddresses,
|
|
|
|
::rtl::OUString& rCategoriesAddress,
|
|
|
|
::rtl::OUString& rChartAddress,
|
|
|
|
sal_Bool & rHasOwnTable,
|
|
|
|
sal_Bool & rAllRangeAddressesAvailable,
|
|
|
|
sal_Bool & rColHasLabels,
|
|
|
|
sal_Bool & rRowHasLabels,
|
|
|
|
::com::sun::star::chart::ChartDataRowSource & rDataRowSource,
|
|
|
|
SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
|
|
|
|
const ::rtl::OUString& aChartTypeServiceName,
|
|
|
|
tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
|
|
|
|
const ::com::sun::star::awt::Size & rChartSize );
|
|
|
|
virtual ~SchXMLPlotAreaContext();
|
|
|
|
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
virtual SvXMLImportContext* CreateChildContext(
|
|
|
|
USHORT nPrefix,
|
|
|
|
const rtl::OUString& rLocalName,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
virtual void EndElement();
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
private:
|
|
|
|
SchXMLImportHelper& mrImportHelper;
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
|
|
|
|
::com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > mxNewDoc;
|
|
|
|
::std::vector< SchXMLAxis > maAxes;
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::chart::ChartSeriesAddress >& mrSeriesAddresses;
|
2000-09-18 16:07:07 +00:00
|
|
|
rtl::OUString& mrCategoriesAddress;
|
2007-05-22 15:06:52 +00:00
|
|
|
SeriesDefaultsAndStyles& mrSeriesDefaultsAndStyles;
|
|
|
|
sal_Int32 mnNumOfLinesProp;
|
|
|
|
sal_Int32 mnNumOfLinesReadBySeries;
|
2004-08-20 07:54:10 +00:00
|
|
|
sal_Bool mbStockHasVolume;
|
2001-03-22 11:31:46 +00:00
|
|
|
sal_Int32 mnSeries;
|
|
|
|
sal_Int32 mnMaxSeriesLength;
|
2005-07-05 09:56:13 +00:00
|
|
|
SchXML3DSceneAttributesHelper maSceneImportHelper;
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::awt::Size maSize;
|
|
|
|
::com::sun::star::awt::Point maPosition;
|
|
|
|
bool mbHasSize;
|
|
|
|
bool mbHasPosition;
|
|
|
|
bool mbPercentStacked;
|
2001-03-28 18:30:56 +00:00
|
|
|
::rtl::OUString msAutoStyleName;
|
2001-05-15 11:27:08 +00:00
|
|
|
::rtl::OUString& mrChartAddress;
|
2007-05-22 15:06:52 +00:00
|
|
|
sal_Bool & mrHasOwnTable;
|
|
|
|
sal_Bool & mrAllRangeAddressesAvailable;
|
|
|
|
sal_Bool & mrColHasLabels;
|
|
|
|
sal_Bool & mrRowHasLabels;
|
|
|
|
::com::sun::star::chart::ChartDataRowSource & mrDataRowSource;
|
|
|
|
::rtl::OUString maFirstFirstDomainAddress;
|
|
|
|
sal_Int32 mnFirstFirstDomainIndex;
|
|
|
|
|
|
|
|
::rtl::OUString maChartTypeServiceName;
|
|
|
|
|
|
|
|
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
|
|
|
|
sal_Int32 mnCurrentDataIndex;
|
|
|
|
bool mbGlobalChartTypeUsedBySeries;
|
2007-11-23 10:37:05 +00:00
|
|
|
::com::sun::star::awt::Size maChartSize;
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
class SchXMLAxisContext : public SvXMLImportContext
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
SchXMLImportHelper& mrImportHelper;
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram;
|
2000-09-18 16:07:07 +00:00
|
|
|
SchXMLAxis maCurrentAxis;
|
|
|
|
std::vector< SchXMLAxis >& maAxes;
|
|
|
|
rtl::OUString msAutoStyleName;
|
2004-07-13 07:03:47 +00:00
|
|
|
rtl::OUString& mrCategoriesAddress;
|
2007-05-22 15:06:52 +00:00
|
|
|
bool mbAddMissingXAxisForNetCharts; //to correct errors from older versions
|
|
|
|
bool mbAdaptWrongPercentScaleValues; //to correct errors from older versions
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape();
|
2000-11-29 13:18:44 +00:00
|
|
|
void CreateGrid( ::rtl::OUString sAutoStyleName, sal_Bool bIsMajor );
|
2007-05-22 15:06:52 +00:00
|
|
|
void CreateAxis();
|
|
|
|
void SetAxisTitle();
|
2000-11-27 16:37:52 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
public:
|
|
|
|
SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
|
|
|
|
SvXMLImport& rImport, const rtl::OUString& rLocalName,
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > xDiagram,
|
2004-07-13 07:03:47 +00:00
|
|
|
std::vector< SchXMLAxis >& aAxes,
|
2007-05-22 15:06:52 +00:00
|
|
|
::rtl::OUString& rCategoriesAddress,
|
|
|
|
bool bAddMissingXAxisForNetCharts,
|
|
|
|
bool bAdaptWrongPercentScaleValues );
|
2000-09-18 16:07:07 +00:00
|
|
|
virtual ~SchXMLAxisContext();
|
|
|
|
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
virtual void EndElement();
|
|
|
|
virtual SvXMLImportContext* CreateChildContext(
|
|
|
|
USHORT nPrefix,
|
|
|
|
const rtl::OUString& rLocalName,
|
2007-05-22 15:06:52 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------
|
|
|
|
|
|
|
|
class SchXMLDataPointContext : public SvXMLImportContext
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
SchXMLImportHelper& mrImportHelper;
|
2007-05-22 15:06:52 +00:00
|
|
|
::std::list< DataRowPointStyle >& mrStyleList;
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XDataSeries > m_xSeries;
|
2000-09-18 16:07:07 +00:00
|
|
|
sal_Int32& mrIndex;
|
2007-08-17 11:05:23 +00:00
|
|
|
bool mbSymbolSizeForSeriesIsMissingInFile;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
SchXMLDataPointContext( SchXMLImportHelper& rImpHelper,
|
|
|
|
SvXMLImport& rImport, const rtl::OUString& rLocalName,
|
2007-05-22 15:06:52 +00:00
|
|
|
::std::list< DataRowPointStyle >& rStyleList,
|
|
|
|
const ::com::sun::star::uno::Reference<
|
2007-08-17 11:05:23 +00:00
|
|
|
::com::sun::star::chart2::XDataSeries >& xSeries, sal_Int32& rIndex,
|
|
|
|
bool bSymbolSizeForSeriesIsMissingInFile );
|
2000-09-18 16:07:07 +00:00
|
|
|
virtual ~SchXMLDataPointContext();
|
|
|
|
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
class SchXMLCategoriesDomainContext : public SvXMLImportContext
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
SchXMLImportHelper& mrImportHelper;
|
|
|
|
rtl::OUString& mrAddress;
|
|
|
|
|
|
|
|
public:
|
|
|
|
SchXMLCategoriesDomainContext( SchXMLImportHelper& rImpHelper,
|
|
|
|
SvXMLImport& rImport,
|
|
|
|
sal_uInt16 nPrefix,
|
|
|
|
const rtl::OUString& rLocalName,
|
|
|
|
rtl::OUString& rAddress );
|
2002-05-06 06:24:33 +00:00
|
|
|
virtual ~SchXMLCategoriesDomainContext();
|
2000-09-18 16:07:07 +00:00
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
};
|
|
|
|
|
2001-01-15 07:58:30 +00:00
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
class SchXMLWallFloorContext : public SvXMLImportContext
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum ContextType
|
|
|
|
{
|
|
|
|
CONTEXT_TYPE_WALL,
|
|
|
|
CONTEXT_TYPE_FLOOR
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
SchXMLImportHelper& mrImportHelper;
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::X3DDisplay > mxWallFloorSupplier;
|
2001-01-15 07:58:30 +00:00
|
|
|
ContextType meContextType;
|
|
|
|
|
|
|
|
public:
|
|
|
|
SchXMLWallFloorContext( SchXMLImportHelper& rImportHelper,
|
|
|
|
SvXMLImport& rImport,
|
|
|
|
sal_uInt16 nPrefix,
|
|
|
|
const rtl::OUString& rLocalName,
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
|
2001-01-15 07:58:30 +00:00
|
|
|
ContextType eContextType );
|
2002-05-06 06:24:33 +00:00
|
|
|
virtual ~SchXMLWallFloorContext();
|
2001-01-15 07:58:30 +00:00
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
};
|
|
|
|
|
2001-12-17 09:22:11 +00:00
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
class SchXMLStockContext : public SvXMLImportContext
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum ContextType
|
|
|
|
{
|
|
|
|
CONTEXT_TYPE_GAIN,
|
|
|
|
CONTEXT_TYPE_LOSS,
|
|
|
|
CONTEXT_TYPE_RANGE
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
SchXMLImportHelper& mrImportHelper;
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XStatisticDisplay > mxStockPropProvider;
|
2001-12-17 09:22:11 +00:00
|
|
|
ContextType meContextType;
|
|
|
|
|
|
|
|
public:
|
|
|
|
SchXMLStockContext( SchXMLImportHelper& rImportHelper,
|
|
|
|
SvXMLImport& rImport,
|
|
|
|
sal_uInt16 nPrefix,
|
|
|
|
const rtl::OUString& rLocalName,
|
2007-05-22 15:06:52 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
|
2001-12-17 09:22:11 +00:00
|
|
|
ContextType eContextType );
|
2002-05-06 06:24:33 +00:00
|
|
|
virtual ~SchXMLStockContext();
|
2001-12-17 09:22:11 +00:00
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
};
|
|
|
|
|
2002-05-06 06:24:33 +00:00
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
class SchXMLStatisticsObjectContext : public SvXMLImportContext
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum ContextType
|
|
|
|
{
|
|
|
|
CONTEXT_TYPE_MEAN_VALUE_LINE,
|
|
|
|
CONTEXT_TYPE_REGRESSION_CURVE,
|
|
|
|
CONTEXT_TYPE_ERROR_INDICATOR
|
|
|
|
};
|
|
|
|
|
|
|
|
SchXMLStatisticsObjectContext(
|
|
|
|
SchXMLImportHelper& rImportHelper,
|
|
|
|
SvXMLImport& rImport,
|
|
|
|
sal_uInt16 nPrefix,
|
|
|
|
const rtl::OUString& rLocalName,
|
2007-05-22 15:06:52 +00:00
|
|
|
::std::list< DataRowPointStyle >& rStyleList,
|
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XDataSeries >& xSeries,
|
2007-11-23 10:37:05 +00:00
|
|
|
ContextType eContextType,
|
|
|
|
const ::com::sun::star::awt::Size & rChartSize );
|
2002-05-06 06:24:33 +00:00
|
|
|
|
|
|
|
virtual ~SchXMLStatisticsObjectContext();
|
|
|
|
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
2007-11-23 10:37:05 +00:00
|
|
|
virtual SvXMLImportContext* CreateChildContext(
|
|
|
|
USHORT nPrefix,
|
|
|
|
const rtl::OUString& rLocalName,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
2002-05-06 06:24:33 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SchXMLImportHelper & mrImportHelper;
|
2007-05-22 15:06:52 +00:00
|
|
|
::std::list< DataRowPointStyle > & mrStyleList;
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XDataSeries > m_xSeries;
|
2002-05-06 06:24:33 +00:00
|
|
|
ContextType meContextType;
|
2007-11-23 10:37:05 +00:00
|
|
|
::com::sun::star::awt::Size maChartSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
class SchXMLEquationContext : public SvXMLImportContext
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SchXMLEquationContext(
|
|
|
|
SchXMLImportHelper& rImportHelper,
|
|
|
|
SvXMLImport& rImport,
|
|
|
|
sal_uInt16 nPrefix,
|
|
|
|
const rtl::OUString& rLocalName,
|
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XDataSeries >& xSeries,
|
|
|
|
const ::com::sun::star::awt::Size & rChartSize,
|
|
|
|
DataRowPointStyle & rRegressionStyle );
|
|
|
|
|
|
|
|
virtual ~SchXMLEquationContext();
|
|
|
|
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
|
|
|
|
private:
|
|
|
|
SchXMLImportHelper & mrImportHelper;
|
|
|
|
DataRowPointStyle & mrRegressionStyle;
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XDataSeries > m_xSeries;
|
|
|
|
::com::sun::star::awt::Size maChartSize;
|
2002-05-06 06:24:33 +00:00
|
|
|
};
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#endif // _SCH_XMLPLOTAREACONTEXT_HXX_
|