tdf#133368: update extensions website URLs and use https
[LibreOffice.git] / include / xmloff / SchXMLImportHelper.hxx
blobbec8167fe7a04ce49c5ec2fdbab85f5f89829200
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 #ifndef INCLUDED_XMLOFF_SCHXMLIMPORTHELPER_HXX
20 #define INCLUDED_XMLOFF_SCHXMLIMPORTHELPER_HXX
22 #include <com/sun/star/uno/Reference.hxx>
23 #include <salhelper/simplereferenceobject.hxx>
24 #include <xmloff/families.hxx>
26 namespace com::sun::star::chart { class XChartDocument; }
27 namespace com::sun::star::beans { class XPropertySet; }
29 namespace com::sun::star {
30 namespace frame {
31 class XModel;
33 namespace xml {
34 namespace sax {
35 class XAttributeList;
38 namespace chart2 {
39 class XChartDocument;
40 class XDataSeries;
44 class SvXMLStylesContext;
45 class SvXMLImportContext;
46 class SvXMLImport;
49 /** With this class you can import a <chart:chart> element containing
50 its data as <table:table> element or without internal table. In
51 the latter case you have to provide a table address mapper that
52 converts table addresses in XML format to the appropriate application
53 format.
55 class SchXMLImportHelper final : public salhelper::SimpleReferenceObject
57 private:
58 css::uno::Reference< css::chart::XChartDocument > mxChartDoc;
59 SvXMLStylesContext* mpAutoStyles;
61 public:
63 SchXMLImportHelper();
65 /** get the context for reading the <chart:chart> element with subelements.
66 The result is stored in the XModel given if it also implements
67 XChartDocument
69 SvXMLImportContext* CreateChartContext(
70 SvXMLImport& rImport,
71 const css::uno::Reference< css::frame::XModel >& rChartModel );
73 /** set the auto-style context that will be used to retrieve auto-styles
74 used inside the following <chart:chart> element to parse
76 void SetAutoStylesContext( SvXMLStylesContext* pAutoStyles ) { mpAutoStyles = pAutoStyles; }
77 SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStyles; }
79 /// Fill in the autostyle.
80 void FillAutoStyle(const OUString& rAutoStyleName, const css::uno::Reference<css::beans::XPropertySet>& rProp);
82 const css::uno::Reference< css::chart::XChartDocument >& GetChartDocument() const
83 { return mxChartDoc; }
85 static XmlStyleFamily GetChartFamilyID() { return XmlStyleFamily::SCH_CHART_ID; }
87 /** @param bPushLastChartType If </sal_False>, in case a new chart type has to
88 be added (because it does not exist yet), it is appended at the
89 end of the chart-type container. When </sal_True>, a new chart type
90 is added at one position before the last one, i.e. the formerly
91 last chart type is pushed back, so that it remains the last one.
93 This is needed when the global chart type is set to type A, but
94 the first series has type B. Then B should appear before A (done
95 by passing true). Once a series of type A has been read,
96 following new chart types are again be added at the end (by
97 passing false).
99 static css::uno::Reference< css::chart2::XDataSeries > GetNewDataSeries(
100 const css::uno::Reference< css::chart2::XChartDocument > & xDoc,
101 sal_Int32 nCoordinateSystemIndex,
102 const OUString & rChartTypeName,
103 bool bPushLastChartType );
105 static void DeleteDataSeries(
106 const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
107 const css::uno::Reference< css::chart2::XChartDocument > & xDoc );
110 #endif // INCLUDED_XMLOFF_SCHXMLIMPORTHELPER_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */