Update ooo320-m1
[ooovba.git] / xmloff / source / chart / SchXMLTools.hxx
blob8be5df2ddbb06e229eaa696158bbd53ca1712cce
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: SchXMLTools.hxx,v $
10 * $Revision: 1.9 $
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 SCH_XML_TOOLS_HXX_
31 #define SCH_XML_TOOLS_HXX_
33 #include <rtl/ustring.hxx>
34 #include <xmloff/xmltoken.hxx>
35 #include "transporttypes.hxx"
37 #include <com/sun/star/frame/XModel.hpp>
39 namespace com { namespace sun { namespace star {
40 namespace chart2 {
41 class XChartDocument;
42 class XRegressionCurve;
43 namespace data {
44 class XDataProvider;
45 class XLabeledDataSequence;
48 }}}
50 class XMLPropStyleContext;
51 class SvXMLStylesContext;
52 class SvXMLExport;
54 namespace SchXMLTools
56 bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
57 bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
58 bool isDocumentGeneratedWithOpenOfficeOlderThan2_4( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
59 bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
61 void setBuildIDAtImportInfo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel
62 , ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xImportInfo );
64 enum SchXMLChartTypeEnum
66 XML_CHART_CLASS_LINE,
67 XML_CHART_CLASS_AREA,
68 XML_CHART_CLASS_CIRCLE,
69 XML_CHART_CLASS_RING,
70 XML_CHART_CLASS_SCATTER,
71 XML_CHART_CLASS_RADAR,
72 XML_CHART_CLASS_FILLED_RADAR,
73 XML_CHART_CLASS_BAR,
74 XML_CHART_CLASS_STOCK,
75 XML_CHART_CLASS_BUBBLE,
76 XML_CHART_CLASS_ADDIN,
77 XML_CHART_CLASS_UNKNOWN
80 SchXMLChartTypeEnum GetChartTypeEnum( const ::rtl::OUString& rClassName );
82 ::rtl::OUString GetChartTypeByClassName(
83 const ::rtl::OUString & rClassName, bool bUseOldNames );
85 ::xmloff::token::XMLTokenEnum getTokenByChartType(
86 const ::rtl::OUString & rChartTypeService, bool bUseOldNames );
88 ::rtl::OUString GetNewChartTypeName( const ::rtl::OUString & rOldChartTypeName );
90 ::com::sun::star::uno::Reference<
91 ::com::sun::star::chart2::data::XLabeledDataSequence > GetNewLabeledDataSequence();
93 void CreateCategories(
94 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > & xDataProvider,
95 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > & xNewDoc,
96 const ::rtl::OUString & rRangeAddress,
97 sal_Int32 nCooSysIndex,
98 sal_Int32 nDimensionIndex,
99 tSchXMLLSequencesPerIndex * pLSequencesPerIndex = 0 );
101 ::com::sun::star::uno::Any getPropertyFromContext( const ::rtl::OUString& rPropertyName, const XMLPropStyleContext * pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
103 void exportText( SvXMLExport& rExport, const ::rtl::OUString& rText, bool bConvertTabsLFs );
105 /** returns the properties of the equation of the first regression curve
106 that is no mean-value line
108 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XRegressionCurve > getRegressionCurve(
109 const ::com::sun::star::uno::Reference<
110 ::com::sun::star::chart2::XDataSeries > & xDataSeries );
112 /** checks if the data sequence has the property "CachedXMLRange" (true for
113 internal data sequences), and if so sets this property to the range
114 given in rXMLRange
116 void setXMLRangePropertyAtDataSequence(
117 const ::com::sun::star::uno::Reference<
118 ::com::sun::star::chart2::data::XDataSequence > & xDataSequence,
119 const ::rtl::OUString & rXMLRange );
121 /** checks if the data sequence has the property "CachedXMLRange" (true for
122 internal data sequences), and if so retrieves this property and applies
123 it to the range given in rOutXMLRange.
125 @param bClearProp If true, the property is reset to its default after it
126 was assigned to rOutXMLRange
128 @return true, if the property was found, assigned and is non-empty
130 bool getXMLRangePropertyFromDataSequence(
131 const ::com::sun::star::uno::Reference<
132 ::com::sun::star::chart2::data::XDataSequence > & xDataSequence,
133 ::rtl::OUString & rOutXMLRange,
134 bool bClearProp = false );
136 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > getDataProviderFromParent( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc );
138 bool switchBackToDataProviderFromParent( const ::com::sun::star::uno::Reference<
139 ::com::sun::star::chart2::XChartDocument >& xChartDoc
140 , const tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
142 void copyProperties(
143 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xSource,
144 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xDestination );
147 #endif // SCH_XML_TOOLS_HXX_