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 SCH_XML_TRANSPORTTYPES_HXX_
20 : #define SCH_XML_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 : rtl::OUString aString;
39 : ::com::sun::star::uno::Sequence< rtl::OUString > aComplexString;
40 : double fValue;
41 : SchXMLCellType eType;
42 : rtl::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 : ::rtl::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 : // ----------------------------------------
93 :
94 : struct SchNumericCellRangeAddress
95 : {
96 : sal_Int32 nRow1, nRow2;
97 : sal_Int32 nCol1, nCol2;
98 :
99 : SchNumericCellRangeAddress() :
100 : nRow1( -1 ), nRow2( -1 ),
101 : nCol1( -1 ), nCol2( -1 )
102 : {}
103 :
104 : SchNumericCellRangeAddress( const SchNumericCellRangeAddress& aOther )
105 : {
106 : nRow1 = aOther.nRow1; nRow2 = aOther.nRow2;
107 : nCol1 = aOther.nCol1; nCol2 = aOther.nCol2;
108 : }
109 : };
110 :
111 : // ----------------------------------------
112 :
113 : enum SchXMLAxisDimension
114 : {
115 : SCH_XML_AXIS_X = 0,
116 : SCH_XML_AXIS_Y,
117 : SCH_XML_AXIS_Z,
118 : SCH_XML_AXIS_UNDEF
119 : };
120 :
121 0 : struct SchXMLAxis
122 : {
123 : enum SchXMLAxisDimension eDimension;
124 : sal_Int8 nAxisIndex;//0->primary axis; 1->secondary axis
125 : rtl::OUString aName;
126 : rtl::OUString aTitle;
127 : bool bHasCategories;
128 :
129 0 : SchXMLAxis() : eDimension( SCH_XML_AXIS_UNDEF ), nAxisIndex( 0 ), bHasCategories( false ) {}
130 : };
131 :
132 : // ----------------------------------------
133 :
134 0 : struct GlobalSeriesImportInfo
135 : {
136 0 : GlobalSeriesImportInfo( sal_Bool& rAllRangeAddressesAvailable )
137 : : rbAllRangeAddressesAvailable( rAllRangeAddressesAvailable )
138 : , nCurrentDataIndex( 0 )
139 : , nFirstFirstDomainIndex( -1 )
140 0 : , nFirstSecondDomainIndex( -1 )
141 0 : {}
142 :
143 : sal_Bool& rbAllRangeAddressesAvailable;
144 :
145 : sal_Int32 nCurrentDataIndex;
146 :
147 : ::rtl::OUString aFirstFirstDomainAddress;
148 : sal_Int32 nFirstFirstDomainIndex;
149 :
150 : ::rtl::OUString aFirstSecondDomainAddress;
151 : sal_Int32 nFirstSecondDomainIndex;
152 : };
153 :
154 0 : struct DataRowPointStyle
155 : {
156 : enum StyleType
157 : {
158 : DATA_POINT,
159 : DATA_SERIES,
160 : MEAN_VALUE,
161 : REGRESSION,
162 : ERROR_INDICATOR
163 : };
164 :
165 : StyleType meType;
166 : ::com::sun::star::uno::Reference<
167 : ::com::sun::star::chart2::XDataSeries > m_xSeries;
168 : ::com::sun::star::uno::Reference<
169 : ::com::sun::star::beans::XPropertySet > m_xOldAPISeries;
170 : com::sun::star::uno::Reference<
171 : com::sun::star::beans::XPropertySet > m_xErrorXProperties;
172 : com::sun::star::uno::Reference<
173 : com::sun::star::beans::XPropertySet > m_xErrorYProperties;
174 : ::com::sun::star::uno::Reference<
175 : ::com::sun::star::beans::XPropertySet > m_xEquationProperties;
176 : sal_Int32 m_nPointIndex;
177 : sal_Int32 m_nPointRepeat;
178 : ::rtl::OUString msStyleName;
179 : ::rtl::OUString msSeriesStyleNameForDonuts;
180 : sal_Int32 mnAttachedAxis;
181 : bool mbSymbolSizeForSeriesIsMissingInFile;
182 :
183 0 : DataRowPointStyle( StyleType eType
184 : , const ::com::sun::star::uno::Reference<
185 : ::com::sun::star::chart2::XDataSeries >& xSeries
186 : , sal_Int32 nPointIndex
187 : , sal_Int32 nPointRepeat
188 : , ::rtl::OUString sStyleName
189 : , sal_Int32 nAttachedAxis = 0 ) :
190 : meType( eType ),
191 : m_xSeries( xSeries ),
192 : m_xOldAPISeries( 0 ),
193 : m_nPointIndex( nPointIndex ),
194 : m_nPointRepeat( nPointRepeat ),
195 : msStyleName( sStyleName ),
196 : mnAttachedAxis( nAttachedAxis ),
197 0 : mbSymbolSizeForSeriesIsMissingInFile( false )
198 0 : {}
199 : };
200 :
201 : typedef ::std::multimap< ::rtl::OUString, ::com::sun::star::uno::Reference<
202 : ::com::sun::star::chart2::data::XDataSequence > > tSchXMLRangeSequenceMap;
203 :
204 : #endif // SCH_XML_TRANSPORTTYPES_HXX_
205 :
206 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|