bump product version to 7.6.3.2-android
[LibreOffice.git] / xmloff / source / chart / SchXMLTools.hxx
blob994308a19bc3f4f7fe273d58466c3e235ab3f74b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #pragma once
21 #include <rtl/ustring.hxx>
22 #include <xmloff/xmltoken.hxx>
23 #include "transporttypes.hxx"
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp>
28 namespace com::sun::star {
29 namespace chart2 {
30 class XChartDocument;
31 class XRegressionCurve;
32 namespace data {
33 class XDataProvider;
38 class XMLPropStyleContext;
39 class SvXMLStylesContext;
40 class SvXMLExport;
42 namespace SchXMLTools
44 bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const css::uno::Reference< css::frame::XModel >& xChartModel);
45 bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const css::uno::Reference< css::frame::XModel >& xChartModel);
46 bool isDocumentGeneratedWithOpenOfficeOlderThan2_4( const css::uno::Reference< css::frame::XModel >& xChartModel);
47 bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const css::uno::Reference< css::frame::XModel >& xChartModel);
48 bool isDocumentGeneratedWithOpenOfficeOlderThan3_3( const css::uno::Reference< css::frame::XModel >& xChartModel);
50 void setBuildIDAtImportInfo( const css::uno::Reference< css::frame::XModel >& xModel
51 , const css::uno::Reference< css::beans::XPropertySet >& xImportInfo );
53 enum SchXMLChartTypeEnum
55 XML_CHART_CLASS_LINE,
56 XML_CHART_CLASS_AREA,
57 XML_CHART_CLASS_CIRCLE,
58 XML_CHART_CLASS_RING,
59 XML_CHART_CLASS_SCATTER,
60 XML_CHART_CLASS_RADAR,
61 XML_CHART_CLASS_FILLED_RADAR,
62 XML_CHART_CLASS_BAR,
63 XML_CHART_CLASS_STOCK,
64 XML_CHART_CLASS_BUBBLE,
65 XML_CHART_CLASS_ADDIN,
66 XML_CHART_CLASS_UNKNOWN
69 SchXMLChartTypeEnum GetChartTypeEnum( std::u16string_view rClassName );
71 OUString GetChartTypeByClassName(
72 std::u16string_view rClassName, bool bUseOldNames );
74 ::xmloff::token::XMLTokenEnum getTokenByChartType(
75 std::u16string_view rChartTypeService, bool bUseOldNames );
77 OUString GetNewChartTypeName( const OUString & rOldChartTypeName );
79 css::uno::Reference<
80 css::chart2::data::XLabeledDataSequence2 > GetNewLabeledDataSequence();
82 css::uno::Reference< css::chart2::data::XDataSequence > CreateDataSequence(
83 const OUString& rRange,
84 const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
86 css::uno::Reference< css::chart2::data::XDataSequence > CreateDataSequenceWithoutConvert(
87 const OUString& rRange,
88 const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
90 void CreateCategories(
91 const css::uno::Reference< css::chart2::data::XDataProvider > & xDataProvider,
92 const css::uno::Reference< css::chart2::XChartDocument > & xNewDoc,
93 const OUString & rRangeAddress,
94 sal_Int32 nCooSysIndex,
95 sal_Int32 nDimensionIndex,
96 tSchXMLLSequencesPerIndex * pLSequencesPerIndex = nullptr );
98 css::uno::Any getPropertyFromContext( std::u16string_view rPropertyName, const XMLPropStyleContext * pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
100 void exportText( SvXMLExport& rExport, const OUString& rText, bool bConvertTabsLFs );
102 void exportRangeToSomewhere( SvXMLExport& rExport, const OUString& rValue );
104 /** checks if the data sequence has the property "CachedXMLRange" (true for
105 internal data sequences), and if so sets this property to the range
106 given in rXMLRange
108 void setXMLRangePropertyAtDataSequence(
109 const css::uno::Reference< css::chart2::data::XDataSequence > & xDataSequence,
110 const OUString & rXMLRange );
112 /** checks if the data sequence has the property "CachedXMLRange" (true for
113 internal data sequences), and if so retrieves this property and applies
114 it to the range given in rOutXMLRange.
116 @param bClearProp If true, the property is reset to its default after it
117 was assigned to rOutXMLRange
119 @return true, if the property was found, assigned and is non-empty
121 bool getXMLRangePropertyFromDataSequence(
122 const css::uno::Reference< css::chart2::data::XDataSequence > & xDataSequence,
123 OUString & rOutXMLRange,
124 bool bClearProp );
126 css::uno::Reference< css::chart2::data::XDataProvider > getDataProviderFromParent( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
128 bool switchBackToDataProviderFromParent( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc
129 , const tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
131 void copyProperties(
132 const css::uno::Reference< css::beans::XPropertySet > & xSource,
133 const css::uno::Reference< css::beans::XPropertySet > & xDestination );
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */