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 #pragma once
20 
21 #include <rtl/ustring.hxx>
22 #include <xmloff/xmltoken.hxx>
23 #include "transporttypes.hxx"
24 
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp>
27 
28 namespace com::sun::star {
29  namespace chart2 {
30  class XChartDocument;
31  class XRegressionCurve;
32  namespace data {
33  class XDataProvider;
34  }
35  }
36 }
37 
39 class SvXMLStylesContext;
40 class SvXMLExport;
41 
42 namespace SchXMLTools
43 {
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);
49 
50  void setBuildIDAtImportInfo( const css::uno::Reference< css::frame::XModel >& xModel
51  , const css::uno::Reference< css::beans::XPropertySet >& xImportInfo );
52 
54  {
67  };
68 
69  SchXMLChartTypeEnum GetChartTypeEnum( std::u16string_view rClassName );
70 
71  OUString GetChartTypeByClassName(
72  std::u16string_view rClassName, bool bUseOldNames );
73 
75  const OUString & rChartTypeService, bool bUseOldNames );
76 
77  OUString GetNewChartTypeName( const OUString & rOldChartTypeName );
78 
79  css::uno::Reference<
80  css::chart2::data::XLabeledDataSequence2 > GetNewLabeledDataSequence();
81 
82  css::uno::Reference< css::chart2::data::XDataSequence > CreateDataSequence(
83  const OUString& rRange,
84  const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
85 
86  css::uno::Reference< css::chart2::data::XDataSequence > CreateDataSequenceWithoutConvert(
87  const OUString& rRange,
88  const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
89 
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 );
97 
98  css::uno::Any getPropertyFromContext( std::u16string_view rPropertyName, const XMLPropStyleContext * pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
99 
100  void exportText( SvXMLExport& rExport, const OUString& rText, bool bConvertTabsLFs );
101 
102  void exportRangeToSomewhere( SvXMLExport& rExport, const OUString& rValue );
103 
109  const css::uno::Reference< css::chart2::data::XDataSequence > & xDataSequence,
110  const OUString & rXMLRange );
111 
122  const css::uno::Reference< css::chart2::data::XDataSequence > & xDataSequence,
123  OUString & rOutXMLRange,
124  bool bClearProp );
125 
126  css::uno::Reference< css::chart2::data::XDataProvider > getDataProviderFromParent( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
127 
128  bool switchBackToDataProviderFromParent( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc
129  , const tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
130 
131  void copyProperties(
132  const css::uno::Reference< css::beans::XPropertySet > & xSource,
133  const css::uno::Reference< css::beans::XPropertySet > & xDestination );
134 }
135 
136 /* 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)
exports com.sun.star. chart2
void setXMLRangePropertyAtDataSequence(const Reference< chart2::data::XDataSequence > &xDataSequence, const OUString &rXMLRange)
OUString GetChartTypeByClassName(std::u16string_view rClassName, bool bUseOldNames)
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)
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
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
void copyProperties(const Reference< beans::XPropertySet > &xSource, const Reference< beans::XPropertySet > &xDestination)