1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SchXMLPlotAreaContext.hxx,v $
* $Revision: 1.26 $
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _SCH_XMLPLOTAREACONTEXT_HXX_
#define _SCH_XMLPLOTAREACONTEXT_HXX_
#include "SchXMLImport.hxx"
#include "SchXMLChartContext.hxx"
#include <xmloff/xmlictxt.hxx>
#include <xmloff/shapeimport.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/chart/ChartSeriesAddress.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include "transporttypes.hxx"
class SvXMLImport;
namespace com { namespace sun { namespace star {
namespace chart {
class XDiagram;
class X3DDisplay;
class XStatisticDisplay;
}
namespace chart2 {
class XChartDocument;
}
namespace xml { namespace sax {
class XAttributeList;
}}}}}
// ----------------------------------------
class SchXML3DSceneAttributesHelper : public SdXML3DSceneAttributesHelper
{
public:
SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
virtual ~SchXML3DSceneAttributesHelper();
void getCameraDefaultFromDiagram( const ::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram );
private:
SchXML3DSceneAttributesHelper();
};
class SchXMLPlotAreaContext : public SvXMLImportContext
{
public:
SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport, const rtl::OUString& rLocalName,
const rtl::OUString& rXLinkHRefAttributeToIndicateDataProvider,
::com::sun::star::uno::Sequence<
::com::sun::star::chart::ChartSeriesAddress >& rSeriesAddresses,
::rtl::OUString& rCategoriesAddress,
::rtl::OUString& rChartAddress,
bool& bHasRangeAtPlotArea,
sal_Bool & rAllRangeAddressesAvailable,
sal_Bool & rColHasLabels,
sal_Bool & rRowHasLabels,
::com::sun::star::chart::ChartDataRowSource & rDataRowSource,
SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
const ::rtl::OUString& aChartTypeServiceName,
tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
const ::com::sun::star::awt::Size & rChartSize );
virtual ~SchXMLPlotAreaContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual SvXMLImportContext* CreateChildContext(
USHORT nPrefix,
const rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual void EndElement();
void CorrectAxisPositions();
private:
SchXMLImportHelper& mrImportHelper;
::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
::com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > mxNewDoc;
::std::vector< SchXMLAxis > maAxes;
::com::sun::star::uno::Sequence< ::com::sun::star::chart::ChartSeriesAddress >& mrSeriesAddresses;
rtl::OUString& mrCategoriesAddress;
SeriesDefaultsAndStyles& mrSeriesDefaultsAndStyles;
sal_Int32 mnNumOfLinesProp;
sal_Bool mbStockHasVolume;
sal_Int32 mnSeries;
GlobalSeriesImportInfo m_aGlobalSeriesImportInfo;
SchXML3DSceneAttributesHelper maSceneImportHelper;
::com::sun::star::awt::Size maSize;
::com::sun::star::awt::Point maPosition;
bool mbHasSize;
bool mbHasPosition;
bool mbPercentStacked;
bool m_bAxisPositionAttributeImported;
::rtl::OUString msAutoStyleName;
const ::rtl::OUString& m_rXLinkHRefAttributeToIndicateDataProvider;
::rtl::OUString& mrChartAddress;
bool& m_rbHasRangeAtPlotArea;
sal_Bool & mrColHasLabels;
sal_Bool & mrRowHasLabels;
::com::sun::star::chart::ChartDataRowSource & mrDataRowSource;
::rtl::OUString maChartTypeServiceName;
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
bool mbGlobalChartTypeUsedBySeries;
::com::sun::star::awt::Size maChartSize;
};
// ----------------------------------------
class SchXMLAxisContext : public SvXMLImportContext
{
private:
SchXMLImportHelper& mrImportHelper;
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram;
SchXMLAxis maCurrentAxis;
std::vector< SchXMLAxis >& maAxes;
rtl::OUString msAutoStyleName;
rtl::OUString& mrCategoriesAddress;
bool mbAddMissingXAxisForNetCharts; //to correct errors from older versions
bool mbAdaptWrongPercentScaleValues; //to correct errors from older versions
bool mbAdaptXAxisOrientationForOld2DBarCharts; //to correct different behaviour from older versions
bool& m_rbAxisPositionAttributeImported;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape();
void CreateGrid( ::rtl::OUString sAutoStyleName, sal_Bool bIsMajor );
void CreateAxis();
void SetAxisTitle();
public:
SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport, const rtl::OUString& rLocalName,
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > xDiagram,
std::vector< SchXMLAxis >& aAxes,
::rtl::OUString& rCategoriesAddress,
bool bAddMissingXAxisForNetCharts,
bool bAdaptWrongPercentScaleValues,
bool bAdaptXAxisOrientationForOld2DBarCharts,
bool& rbAxisPositionAttributeImported );
virtual ~SchXMLAxisContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual void EndElement();
virtual SvXMLImportContext* CreateChildContext(
USHORT nPrefix,
const rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
//----------------------------------------
class SchXMLDataPointContext : public SvXMLImportContext
{
private:
SchXMLImportHelper& mrImportHelper;
::std::list< DataRowPointStyle >& mrStyleList;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries > m_xSeries;
sal_Int32& mrIndex;
bool mbSymbolSizeForSeriesIsMissingInFile;
public:
SchXMLDataPointContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport, const rtl::OUString& rLocalName,
::std::list< DataRowPointStyle >& rStyleList,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries >& xSeries, sal_Int32& rIndex,
bool bSymbolSizeForSeriesIsMissingInFile );
virtual ~SchXMLDataPointContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
// ----------------------------------------
class SchXMLCategoriesContext : public SvXMLImportContext
{
private:
SchXMLImportHelper& mrImportHelper;
rtl::OUString& mrAddress;
public:
SchXMLCategoriesContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const rtl::OUString& rLocalName,
rtl::OUString& rAddress );
virtual ~SchXMLCategoriesContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
// ----------------------------------------
class SchXMLWallFloorContext : public SvXMLImportContext
{
public:
enum ContextType
{
CONTEXT_TYPE_WALL,
CONTEXT_TYPE_FLOOR
};
private:
SchXMLImportHelper& mrImportHelper;
::com::sun::star::uno::Reference< ::com::sun::star::chart::X3DDisplay > mxWallFloorSupplier;
ContextType meContextType;
public:
SchXMLWallFloorContext( SchXMLImportHelper& rImportHelper,
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const rtl::OUString& rLocalName,
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
ContextType eContextType );
virtual ~SchXMLWallFloorContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
// ----------------------------------------
class SchXMLStockContext : public SvXMLImportContext
{
public:
enum ContextType
{
CONTEXT_TYPE_GAIN,
CONTEXT_TYPE_LOSS,
CONTEXT_TYPE_RANGE
};
private:
SchXMLImportHelper& mrImportHelper;
::com::sun::star::uno::Reference< ::com::sun::star::chart::XStatisticDisplay > mxStockPropProvider;
ContextType meContextType;
public:
SchXMLStockContext( SchXMLImportHelper& rImportHelper,
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const rtl::OUString& rLocalName,
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
ContextType eContextType );
virtual ~SchXMLStockContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
// ----------------------------------------
class SchXMLStatisticsObjectContext : public SvXMLImportContext
{
public:
enum ContextType
{
CONTEXT_TYPE_MEAN_VALUE_LINE,
CONTEXT_TYPE_REGRESSION_CURVE,
CONTEXT_TYPE_ERROR_INDICATOR
};
SchXMLStatisticsObjectContext(
SchXMLImportHelper& rImportHelper,
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const rtl::OUString& rLocalName,
::std::list< DataRowPointStyle >& rStyleList,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries >& xSeries,
ContextType eContextType,
const ::com::sun::star::awt::Size & rChartSize );
virtual ~SchXMLStatisticsObjectContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual SvXMLImportContext* CreateChildContext(
USHORT nPrefix,
const rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
private:
SchXMLImportHelper & mrImportHelper;
::std::list< DataRowPointStyle > & mrStyleList;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries > m_xSeries;
ContextType meContextType;
::com::sun::star::awt::Size maChartSize;
};
// ----------------------------------------
class SchXMLEquationContext : public SvXMLImportContext
{
public:
SchXMLEquationContext(
SchXMLImportHelper& rImportHelper,
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries >& xSeries,
const ::com::sun::star::awt::Size & rChartSize,
DataRowPointStyle & rRegressionStyle );
virtual ~SchXMLEquationContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
private:
SchXMLImportHelper & mrImportHelper;
DataRowPointStyle & mrRegressionStyle;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries > m_xSeries;
::com::sun::star::awt::Size maChartSize;
};
#endif // _SCH_XMLPLOTAREACONTEXT_HXX_
|