Line data Source code
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_SCHXMLCHARTCONTEXT_HXX
20 : #define INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLCHARTCONTEXT_HXX
21 :
22 : #include <xmloff/xmlictxt.hxx>
23 : #include <com/sun/star/uno/Sequence.h>
24 : #include <com/sun/star/drawing/XShape.hpp>
25 : #include <com/sun/star/chart/ChartDataRowSource.hpp>
26 : #include <com/sun/star/chart2/XChartDocument.hpp>
27 : #include <com/sun/star/awt/Size.hpp>
28 :
29 : #include "transporttypes.hxx"
30 :
31 : #include <list>
32 :
33 : class SchXMLImportHelper;
34 :
35 : namespace com { namespace sun { namespace star {
36 : namespace chart {
37 : class XChartDocument;
38 : struct ChartSeriesAddress;
39 : }
40 : namespace xml { namespace sax {
41 : class XAttributeList;
42 : }}
43 : namespace drawing {
44 : class XShapes;
45 : }
46 : }}}
47 :
48 172 : struct SeriesDefaultsAndStyles
49 : {
50 : //default values for series:
51 : ::com::sun::star::uno::Any maSymbolTypeDefault;
52 : ::com::sun::star::uno::Any maDataCaptionDefault;
53 :
54 : ::com::sun::star::uno::Any maErrorIndicatorDefault;
55 : ::com::sun::star::uno::Any maErrorCategoryDefault;
56 : ::com::sun::star::uno::Any maConstantErrorLowDefault;
57 : ::com::sun::star::uno::Any maConstantErrorHighDefault;
58 : ::com::sun::star::uno::Any maPercentageErrorDefault;
59 : ::com::sun::star::uno::Any maErrorMarginDefault;
60 :
61 : ::com::sun::star::uno::Any maMeanValueDefault;
62 : ::com::sun::star::uno::Any maRegressionCurvesDefault;
63 :
64 : ::com::sun::star::uno::Any maStackedDefault;
65 : ::com::sun::star::uno::Any maPercentDefault;
66 : ::com::sun::star::uno::Any maDeepDefault;
67 : ::com::sun::star::uno::Any maStackedBarsConnectedDefault;
68 :
69 : //additional information
70 : ::com::sun::star::uno::Any maLinesOnProperty;
71 :
72 : //styles for series and datapoints
73 : ::std::list< DataRowPointStyle > maSeriesStyleList;
74 : ::std::list< RegressionStyle > maRegressionStyleList;
75 : };
76 :
77 : class SchXMLChartContext : public SvXMLImportContext
78 : {
79 : public:
80 : SchXMLChartContext( SchXMLImportHelper& rImpHelper,
81 : SvXMLImport& rImport, const OUString& rLocalName );
82 : virtual ~SchXMLChartContext();
83 :
84 : virtual void StartElement( const com::sun::star::uno::Reference<
85 : com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
86 : virtual void EndElement() SAL_OVERRIDE;
87 : virtual SvXMLImportContext *CreateChildContext(
88 : sal_uInt16 nPrefix,
89 : const OUString& rLocalName,
90 : const com::sun::star::uno::Reference<
91 : com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
92 :
93 : private:
94 : SchXMLTable maTable;
95 : SchXMLImportHelper& mrImportHelper;
96 :
97 : OUString maMainTitle, maSubTitle;
98 : com::sun::star::awt::Point maMainTitlePos, maSubTitlePos, maLegendPos;
99 : OUString m_aXLinkHRefAttributeToIndicateDataProvider;
100 : bool m_bHasRangeAtPlotArea;
101 : bool m_bHasTableElement;
102 : bool mbAllRangeAddressesAvailable;
103 : bool mbColHasLabels;
104 : bool mbRowHasLabels;
105 : ::com::sun::star::chart::ChartDataRowSource meDataRowSource;
106 : bool mbIsStockChart;
107 :
108 : OUString msCategoriesAddress;
109 : OUString msChartAddress;
110 :
111 : SeriesDefaultsAndStyles maSeriesDefaultsAndStyles;
112 : tSchXMLLSequencesPerIndex maLSequencesPerIndex;
113 :
114 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxDrawPage;
115 : OUString msColTrans;
116 : OUString msRowTrans;
117 : OUString maChartTypeServiceName;
118 :
119 : ::com::sun::star::awt::Size maChartSize;
120 :
121 : /** @descr This method bundles some settings to the chart model and executes them with
122 : a locked controller. This includes setting the chart type.
123 : @param aServiceName The name of the service the diagram is initialized with.
124 : @param bSetWitchData Indicates whether the data set takes it's data series from
125 : rows or from columns.
126 : */
127 : void InitChart (const OUString & rChartTypeServiceName,
128 : bool bSetSwitchData);
129 :
130 : void MergeSeriesForStockChart();
131 : };
132 :
133 : class SchXMLTitleContext : public SvXMLImportContext
134 : {
135 : private:
136 : SchXMLImportHelper& mrImportHelper;
137 : OUString& mrTitle;
138 : com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxTitleShape;
139 : OUString msAutoStyleName;
140 :
141 : public:
142 : SchXMLTitleContext( SchXMLImportHelper& rImpHelper,
143 : SvXMLImport& rImport, const OUString& rLocalName,
144 : OUString& rTitle,
145 : com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xTitleShape );
146 : virtual ~SchXMLTitleContext();
147 :
148 : virtual void StartElement( const com::sun::star::uno::Reference<
149 : com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
150 : virtual SvXMLImportContext *CreateChildContext(
151 : sal_uInt16 nPrefix,
152 : const OUString& rLocalName,
153 : const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
154 : };
155 :
156 : #endif // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLCHARTCONTEXT_HXX
157 :
158 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|