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_TRANSPORTTYPES_HXX
20 : #define INCLUDED_XMLOFF_SOURCE_CHART_TRANSPORTTYPES_HXX
21 :
22 : #include <com/sun/star/chart2/XDataSeries.hpp>
23 : #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
24 :
25 : #include <vector>
26 : #include <map>
27 :
28 : enum SchXMLCellType
29 : {
30 : SCH_CELL_TYPE_UNKNOWN,
31 : SCH_CELL_TYPE_FLOAT,
32 : SCH_CELL_TYPE_STRING,
33 : SCH_CELL_TYPE_COMPLEX_STRING
34 : };
35 :
36 0 : struct SchXMLCell
37 : {
38 : OUString aString;
39 : ::com::sun::star::uno::Sequence< OUString > aComplexString;
40 : double fValue;
41 : SchXMLCellType eType;
42 : OUString aRangeId;
43 :
44 0 : SchXMLCell(): fValue( 0.0 ), eType( SCH_CELL_TYPE_UNKNOWN )
45 0 : {}
46 : };
47 :
48 0 : struct SchXMLTable
49 : {
50 : std::vector< std::vector< SchXMLCell > > aData; /// an array of rows containing the table contents
51 :
52 : sal_Int32 nRowIndex; /// reflects the index of the row currently parsed
53 : sal_Int32 nColumnIndex; /// reflects the index of the column currently parsed
54 : sal_Int32 nMaxColumnIndex; /// the greatest number of columns detected
55 :
56 : sal_Int32 nNumberOfColsEstimate; /// parsing column-elements may yield an estimate
57 :
58 : bool bHasHeaderRow;
59 : bool bHasHeaderColumn;
60 :
61 : OUString aTableNameOfFile; /// the table name read at the table:table element
62 :
63 : ::std::vector< sal_Int32 > aHiddenColumns;
64 :
65 : bool bProtected;
66 :
67 0 : SchXMLTable() : nRowIndex( -1 ),
68 : nColumnIndex( -1 ),
69 : nMaxColumnIndex( -1 ),
70 : nNumberOfColsEstimate( 0 ),
71 : bHasHeaderRow( false ),
72 : bHasHeaderColumn( false ),
73 0 : bProtected( false )
74 0 : {}
75 : };
76 :
77 : typedef sal_Int32 tSchXMLIndex;
78 : #define SCH_XML_CATEGORIES_INDEX (static_cast<tSchXMLIndex>(-1))
79 : enum SchXMLLabeledSequencePart
80 : {
81 : SCH_XML_PART_LABEL,
82 : SCH_XML_PART_VALUES,
83 : SCH_XML_PART_ERROR_BARS
84 : };
85 : typedef ::std::pair< tSchXMLIndex, SchXMLLabeledSequencePart > tSchXMLIndexWithPart;
86 : typedef ::std::multimap< tSchXMLIndexWithPart,
87 : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >
88 : tSchXMLLSequencesPerIndex;
89 :
90 : bool operator < ( const tSchXMLIndexWithPart & rFirst, const tSchXMLIndexWithPart & rSecond );
91 :
92 : struct SchNumericCellRangeAddress
93 : {
94 : sal_Int32 nRow1, nRow2;
95 : sal_Int32 nCol1, nCol2;
96 :
97 : SchNumericCellRangeAddress() :
98 : nRow1( -1 ), nRow2( -1 ),
99 : nCol1( -1 ), nCol2( -1 )
100 : {}
101 :
102 : SchNumericCellRangeAddress( const SchNumericCellRangeAddress& aOther )
103 : {
104 : nRow1 = aOther.nRow1; nRow2 = aOther.nRow2;
105 : nCol1 = aOther.nCol1; nCol2 = aOther.nCol2;
106 : }
107 : };
108 :
109 : enum SchXMLAxisDimension
110 : {
111 : SCH_XML_AXIS_X = 0,
112 : SCH_XML_AXIS_Y,
113 : SCH_XML_AXIS_Z,
114 : SCH_XML_AXIS_UNDEF
115 : };
116 :
117 0 : struct SchXMLAxis
118 : {
119 : enum SchXMLAxisDimension eDimension;
120 : sal_Int8 nAxisIndex;//0->primary axis; 1->secondary axis
121 : OUString aName;
122 : OUString aTitle;
123 : bool bHasCategories;
124 :
125 0 : SchXMLAxis() : eDimension( SCH_XML_AXIS_UNDEF ), nAxisIndex( 0 ), bHasCategories( false ) {}
126 : };
127 :
128 0 : struct GlobalSeriesImportInfo
129 : {
130 0 : GlobalSeriesImportInfo( sal_Bool& rAllRangeAddressesAvailable )
131 : : rbAllRangeAddressesAvailable( rAllRangeAddressesAvailable )
132 : , nCurrentDataIndex( 0 )
133 : , nFirstFirstDomainIndex( -1 )
134 0 : , nFirstSecondDomainIndex( -1 )
135 0 : {}
136 :
137 : sal_Bool& rbAllRangeAddressesAvailable;
138 :
139 : sal_Int32 nCurrentDataIndex;
140 :
141 : OUString aFirstFirstDomainAddress;
142 : sal_Int32 nFirstFirstDomainIndex;
143 :
144 : OUString aFirstSecondDomainAddress;
145 : sal_Int32 nFirstSecondDomainIndex;
146 : };
147 :
148 0 : struct RegressionStyle
149 : {
150 : com::sun::star::uno::Reference<
151 : com::sun::star::chart2::XDataSeries > m_xSeries;
152 : com::sun::star::uno::Reference<
153 : com::sun::star::beans::XPropertySet > m_xEquationProperties;
154 :
155 : OUString msStyleName;
156 :
157 0 : RegressionStyle(const com::sun::star::uno::Reference<
158 : com::sun::star::chart2::XDataSeries >& xSeries,
159 : const OUString& sStyleName) :
160 : m_xSeries ( xSeries ),
161 0 : msStyleName ( sStyleName )
162 0 : {}
163 : };
164 :
165 0 : struct DataRowPointStyle
166 : {
167 : enum StyleType
168 : {
169 : DATA_POINT,
170 : DATA_SERIES,
171 : MEAN_VALUE,
172 : ERROR_INDICATOR
173 : };
174 :
175 : StyleType meType;
176 : com::sun::star::uno::Reference<
177 : com::sun::star::chart2::XDataSeries > m_xSeries;
178 :
179 : com::sun::star::uno::Reference<
180 : com::sun::star::beans::XPropertySet > m_xOldAPISeries;
181 :
182 : com::sun::star::uno::Reference<
183 : com::sun::star::beans::XPropertySet > m_xErrorXProperties;
184 :
185 : com::sun::star::uno::Reference<
186 : com::sun::star::beans::XPropertySet > m_xErrorYProperties;
187 :
188 : sal_Int32 m_nPointIndex;
189 : sal_Int32 m_nPointRepeat;
190 : OUString msStyleName;
191 : OUString msSeriesStyleNameForDonuts;
192 : sal_Int32 mnAttachedAxis;
193 : bool mbSymbolSizeForSeriesIsMissingInFile;
194 :
195 0 : DataRowPointStyle( StyleType eType
196 : , const com::sun::star::uno::Reference<
197 : com::sun::star::chart2::XDataSeries >& xSeries
198 : , sal_Int32 nPointIndex
199 : , sal_Int32 nPointRepeat
200 : , const OUString& sStyleName
201 : , sal_Int32 nAttachedAxis = 0 ) :
202 : meType( eType ),
203 : m_xSeries( xSeries ),
204 : m_xOldAPISeries( 0 ),
205 : m_nPointIndex( nPointIndex ),
206 : m_nPointRepeat( nPointRepeat ),
207 : msStyleName( sStyleName ),
208 : mnAttachedAxis( nAttachedAxis ),
209 0 : mbSymbolSizeForSeriesIsMissingInFile( false )
210 0 : {}
211 : };
212 :
213 : typedef ::std::multimap< OUString, ::com::sun::star::uno::Reference<
214 : ::com::sun::star::chart2::data::XDataSequence > > tSchXMLRangeSequenceMap;
215 :
216 : #endif // INCLUDED_XMLOFF_SOURCE_CHART_TRANSPORTTYPES_HXX
217 :
218 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|