LibreOffice Module xmloff (master)  1
SchXMLTools.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLTOOLS_HXX
20 #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLTOOLS_HXX
21 
22 #include <rtl/ustring.hxx>
23 #include <xmloff/xmltoken.hxx>
24 #include "transporttypes.hxx"
25 
26 #include <com/sun/star/frame/XModel.hpp>
27 #include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp>
28 
29 namespace com::sun::star {
30  namespace chart2 {
31  class XChartDocument;
32  class XRegressionCurve;
33  namespace data {
34  class XDataProvider;
35  }
36  }
37 }
38 
40 class SvXMLStylesContext;
41 class SvXMLExport;
42 
43 namespace SchXMLTools
44 {
45  bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const css::uno::Reference< css::frame::XModel >& xChartModel);
46  bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const css::uno::Reference< css::frame::XModel >& xChartModel);
47  bool isDocumentGeneratedWithOpenOfficeOlderThan2_4( const css::uno::Reference< css::frame::XModel >& xChartModel);
48  bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const css::uno::Reference< css::frame::XModel >& xChartModel);
49  bool isDocumentGeneratedWithOpenOfficeOlderThan3_3( const css::uno::Reference< css::frame::XModel >& xChartModel);
50 
51  void setBuildIDAtImportInfo( const css::uno::Reference< css::frame::XModel >& xModel
52  , const css::uno::Reference< css::beans::XPropertySet >& xImportInfo );
53 
55  {
68  };
69 
70  SchXMLChartTypeEnum GetChartTypeEnum( std::u16string_view rClassName );
71 
72  OUString GetChartTypeByClassName(
73  std::u16string_view rClassName, bool bUseOldNames );
74 
76  const OUString & rChartTypeService, bool bUseOldNames );
77 
78  OUString GetNewChartTypeName( const OUString & rOldChartTypeName );
79 
80  css::uno::Reference<
81  css::chart2::data::XLabeledDataSequence2 > GetNewLabeledDataSequence();
82 
83  css::uno::Reference< css::chart2::data::XDataSequence > CreateDataSequence(
84  const OUString& rRange,
85  const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
86 
87  css::uno::Reference< css::chart2::data::XDataSequence > CreateDataSequenceWithoutConvert(
88  const OUString& rRange,
89  const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
90 
91  void CreateCategories(
92  const css::uno::Reference< css::chart2::data::XDataProvider > & xDataProvider,
93  const css::uno::Reference< css::chart2::XChartDocument > & xNewDoc,
94  const OUString & rRangeAddress,
95  sal_Int32 nCooSysIndex,
96  sal_Int32 nDimensionIndex,
97  tSchXMLLSequencesPerIndex * pLSequencesPerIndex = nullptr );
98 
99  css::uno::Any getPropertyFromContext( std::u16string_view rPropertyName, const XMLPropStyleContext * pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
100 
101  void exportText( SvXMLExport& rExport, const OUString& rText, bool bConvertTabsLFs );
102 
103  void exportRangeToSomewhere( SvXMLExport& rExport, const OUString& rValue );
104 
110  const css::uno::Reference< css::chart2::data::XDataSequence > & xDataSequence,
111  const OUString & rXMLRange );
112 
123  const css::uno::Reference< css::chart2::data::XDataSequence > & xDataSequence,
124  OUString & rOutXMLRange,
125  bool bClearProp );
126 
127  css::uno::Reference< css::chart2::data::XDataProvider > getDataProviderFromParent( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
128 
129  bool switchBackToDataProviderFromParent( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc
130  , const tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
131 
132  void copyProperties(
133  const css::uno::Reference< css::beans::XPropertySet > & xSource,
134  const css::uno::Reference< css::beans::XPropertySet > & xDestination );
135 }
136 
137 #endif // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLTOOLS_HXX
138 
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString GetNewChartTypeName(const OUString &rOldChartTypeName)
Reference< chart2::data::XDataProvider > getDataProviderFromParent(const Reference< chart2::XChartDocument > &xChartDoc)
void setBuildIDAtImportInfo(const uno::Reference< frame::XModel > &xModel, const Reference< beans::XPropertySet > &xImportInfo)
uno::Any getPropertyFromContext(std::u16string_view rPropertyName, const XMLPropStyleContext *pPropStyleContext, const SvXMLStylesContext *pStylesCtxt)
bool isDocumentGeneratedWithOpenOfficeOlderThan3_3(const uno::Reference< frame::XModel > &xChartModel)
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
exports com.sun.star. chart2
void setXMLRangePropertyAtDataSequence(const Reference< chart2::data::XDataSequence > &xDataSequence, const OUString &rXMLRange)
OUString GetChartTypeByClassName(std::u16string_view rClassName, bool bUseOldNames)
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
Reference< chart2::data::XLabeledDataSequence2 > GetNewLabeledDataSequence()
bool isDocumentGeneratedWithOpenOfficeOlderThan2_0(const css::uno::Reference< css::frame::XModel > &xChartModel)
void exportText(SvXMLExport &rExport, const OUString &rText, bool bConvertTabsLFs)
exports com.sun.star.chart2. data
void exportRangeToSomewhere(SvXMLExport &rExport, const OUString &rValue)
Reference< chart2::data::XDataSequence > CreateDataSequenceWithoutConvert(const OUString &rRange, const Reference< chart2::XChartDocument > &xChartDoc)
void CreateCategories(const uno::Reference< chart2::data::XDataProvider > &xDataProvider, const uno::Reference< chart2::XChartDocument > &xNewDoc, const OUString &rRangeAddress, sal_Int32 nCooSysIndex, sal_Int32 nDimensionIndex, tSchXMLLSequencesPerIndex *pLSequencesPerIndex)
bool getXMLRangePropertyFromDataSequence(const Reference< chart2::data::XDataSequence > &xDataSequence, OUString &rOutXMLRange, bool bClearProp)
bool isDocumentGeneratedWithOpenOfficeOlderThan3_0(const uno::Reference< frame::XModel > &xChartModel)
bool switchBackToDataProviderFromParent(const Reference< chart2::XChartDocument > &xChartDoc, const tSchXMLLSequencesPerIndex &rLSequencesPerIndex)
Reference< chart2::data::XDataSequence > CreateDataSequence(const OUString &rRange, const Reference< chart2::XChartDocument > &xChartDoc)
bool isDocumentGeneratedWithOpenOfficeOlderThan2_3(const uno::Reference< frame::XModel > &xChartModel)
bool isDocumentGeneratedWithOpenOfficeOlderThan2_4(const uno::Reference< frame::XModel > &xChartModel)
SchXMLChartTypeEnum GetChartTypeEnum(std::u16string_view rClassName)
XMLTokenEnum getTokenByChartType(const OUString &rChartTypeService, bool bUseOldNames)
::std::multimap< tSchXMLIndexWithPart, css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tSchXMLLSequencesPerIndex
css::uno::Any const SvXMLExport & rExport
Definition: ImageStyle.hxx:38
void copyProperties(const Reference< beans::XPropertySet > &xSource, const Reference< beans::XPropertySet > &xDestination)