update emoji autocorrect entries from po-files
[LibreOffice.git] / include / xmloff / SchXMLImportHelper.hxx
blobe96b500b30a650f7d36b22dfe678c94c57747790
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 <salhelper/simplereferenceobject.hxx>
23 #include <xmloff/families.hxx>
24 #include <com/sun/star/util/XStringMapping.hpp>
25 #include <com/sun/star/chart/XChartDocument.hpp>
27 namespace com { namespace sun { namespace star {
28 namespace frame {
29 class XModel;
31 namespace task {
32 class XStatusIndicator;
34 namespace xml {
35 namespace sax {
36 class XAttributeList;
39 namespace chart2 {
40 namespace data {
41 class XDataProvider;
42 class XLabeledDataSequence;
44 class XChartDocument;
45 class XDataSeries;
47 }}}
49 class SvXMLUnitConverter;
50 class SvXMLStylesContext;
51 class XMLChartImportPropertyMapper;
52 class SvXMLTokenMap;
53 class SvXMLImportContext;
54 class SvXMLImport;
58 /** With this class you can import a <chart:chart> element containing
59 its data as <table:table> element or without internal table. In
60 the latter case you have to provide a table address mapper that
61 converts table addresses in XML format to the appropriate application
62 format.
64 class SchXMLImportHelper : public salhelper::SimpleReferenceObject
66 private:
67 com::sun::star::uno::Reference< com::sun::star::chart::XChartDocument > mxChartDoc;
68 SvXMLStylesContext* mpAutoStyles;
70 SvXMLTokenMap* mpChartDocElemTokenMap;
71 SvXMLTokenMap* mpTableElemTokenMap;
72 SvXMLTokenMap* mpChartElemTokenMap;
73 SvXMLTokenMap* mpPlotAreaElemTokenMap;
74 SvXMLTokenMap* mpSeriesElemTokenMap;
76 SvXMLTokenMap* mpChartAttrTokenMap;
77 SvXMLTokenMap* mpPlotAreaAttrTokenMap;
78 SvXMLTokenMap* mpAutoStyleAttrTokenMap;
79 SvXMLTokenMap* mpCellAttrTokenMap;
80 SvXMLTokenMap* mpSeriesAttrTokenMap;
81 SvXMLTokenMap* mpPropMappingAttrTokenMap;
82 SvXMLTokenMap* mpRegEquationAttrTokenMap;
84 public:
86 SchXMLImportHelper();
87 virtual ~SchXMLImportHelper();
89 /** get the context for reading the <chart:chart> element with subelements.
90 The result is stored in the XModel given if it also implements
91 XChartDocument
93 SvXMLImportContext* CreateChartContext(
94 SvXMLImport& rImport,
95 sal_uInt16 nPrefix, const OUString& rLocalName,
96 const com::sun::star::uno::Reference<
97 com::sun::star::frame::XModel >& rChartModel,
98 const com::sun::star::uno::Reference<
99 com::sun::star::xml::sax::XAttributeList >& rAttrList );
101 /** set the auto-style context that will be used to retrieve auto-styles
102 used inside the following <chart:chart> element to parse
104 void SetAutoStylesContext( SvXMLStylesContext* pAutoStyles ) { mpAutoStyles = pAutoStyles; }
105 SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStyles; }
107 const com::sun::star::uno::Reference<
108 com::sun::star::chart::XChartDocument >& GetChartDocument()
109 { return mxChartDoc; }
111 const SvXMLTokenMap& GetDocElemTokenMap();
112 const SvXMLTokenMap& GetTableElemTokenMap();
113 const SvXMLTokenMap& GetChartElemTokenMap();
114 const SvXMLTokenMap& GetPlotAreaElemTokenMap();
115 const SvXMLTokenMap& GetSeriesElemTokenMap();
116 const SvXMLTokenMap& GetPropMappingAttrTokenMap();
118 const SvXMLTokenMap& GetChartAttrTokenMap();
119 const SvXMLTokenMap& GetPlotAreaAttrTokenMap();
120 const SvXMLTokenMap& GetCellAttrTokenMap();
121 const SvXMLTokenMap& GetSeriesAttrTokenMap();
122 const SvXMLTokenMap& GetRegEquationAttrTokenMap();
124 static sal_uInt16 GetChartFamilyID() { return XML_STYLE_FAMILY_SCH_CHART_ID; }
126 /** @param bPushLastChartType If </sal_False>, in case a new chart type has to
127 be added (because it does not exist yet), it is appended at the
128 end of the chart-type container. When </sal_True>, a new chart type
129 is added at one position before the last one, i.e. the formerly
130 last chart type is pushed back, so that it remains the last one.
132 This is needed when the global chart type is set to type A, but
133 the first series has type B. Then B should appear before A (done
134 by passing true). Once a series of type A has been read,
135 following new chart types are again be added at the end (by
136 passing false).
138 static ::com::sun::star::uno::Reference<
139 ::com::sun::star::chart2::XDataSeries > GetNewDataSeries(
140 const ::com::sun::star::uno::Reference<
141 ::com::sun::star::chart2::XChartDocument > & xDoc,
142 sal_Int32 nCoordinateSystemIndex,
143 const OUString & rChartTypeName,
144 bool bPushLastChartType = false );
146 static void DeleteDataSeries(
147 const ::com::sun::star::uno::Reference<
148 ::com::sun::star::chart2::XDataSeries >& xSeries,
149 const ::com::sun::star::uno::Reference<
150 ::com::sun::star::chart2::XChartDocument > & xDoc );
153 #endif // INCLUDED_XMLOFF_SCHXMLIMPORTHELPER_HXX
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */