Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef SCH_XML_TRANSPORTTYPES_HXX_
29 : : #define SCH_XML_TRANSPORTTYPES_HXX_
30 : :
31 : : #include <com/sun/star/chart2/XDataSeries.hpp>
32 : : #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
33 : :
34 : : #include <vector>
35 : : #include <map>
36 : :
37 : : enum SchXMLCellType
38 : : {
39 : : SCH_CELL_TYPE_UNKNOWN,
40 : : SCH_CELL_TYPE_FLOAT,
41 : : SCH_CELL_TYPE_STRING,
42 : : SCH_CELL_TYPE_COMPLEX_STRING
43 : : };
44 : :
45 [ + - ][ # # ]: 540 : struct SchXMLCell
46 : : {
47 : : rtl::OUString aString;
48 : : ::com::sun::star::uno::Sequence< rtl::OUString > aComplexString;
49 : : double fValue;
50 : : SchXMLCellType eType;
51 : : rtl::OUString aRangeId;
52 : :
53 [ + - ]: 120 : SchXMLCell(): fValue( 0.0 ), eType( SCH_CELL_TYPE_UNKNOWN )
54 : 120 : {}
55 : : };
56 : :
57 : 6 : struct SchXMLTable
58 : : {
59 : : std::vector< std::vector< SchXMLCell > > aData; /// an array of rows containing the table contents
60 : :
61 : : sal_Int32 nRowIndex; /// reflects the index of the row currently parsed
62 : : sal_Int32 nColumnIndex; /// reflects the index of the column currently parsed
63 : : sal_Int32 nMaxColumnIndex; /// the greatest number of columns detected
64 : :
65 : : sal_Int32 nNumberOfColsEstimate; /// parsing column-elements may yield an estimate
66 : :
67 : : bool bHasHeaderRow;
68 : : bool bHasHeaderColumn;
69 : :
70 : : ::rtl::OUString aTableNameOfFile; /// the table name read at the table:table element
71 : :
72 : : ::std::vector< sal_Int32 > aHiddenColumns;
73 : :
74 : : bool bProtected;
75 : :
76 : 6 : SchXMLTable() : nRowIndex( -1 ),
77 : : nColumnIndex( -1 ),
78 : : nMaxColumnIndex( -1 ),
79 : : nNumberOfColsEstimate( 0 ),
80 : : bHasHeaderRow( false ),
81 : : bHasHeaderColumn( false ),
82 [ + - ]: 6 : bProtected( false )
83 : 6 : {}
84 : : };
85 : :
86 : : typedef sal_Int32 tSchXMLIndex;
87 : : #define SCH_XML_CATEGORIES_INDEX (static_cast<tSchXMLIndex>(-1))
88 : : enum SchXMLLabeledSequencePart
89 : : {
90 : : SCH_XML_PART_LABEL,
91 : : SCH_XML_PART_VALUES,
92 : : SCH_XML_PART_ERROR_BARS
93 : : };
94 : : typedef ::std::pair< tSchXMLIndex, SchXMLLabeledSequencePart > tSchXMLIndexWithPart;
95 : : typedef ::std::multimap< tSchXMLIndexWithPart,
96 : : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >
97 : : tSchXMLLSequencesPerIndex;
98 : :
99 : : bool operator < ( const tSchXMLIndexWithPart & rFirst, const tSchXMLIndexWithPart & rSecond );
100 : :
101 : : // ----------------------------------------
102 : :
103 : : struct SchNumericCellRangeAddress
104 : : {
105 : : sal_Int32 nRow1, nRow2;
106 : : sal_Int32 nCol1, nCol2;
107 : :
108 : : SchNumericCellRangeAddress() :
109 : : nRow1( -1 ), nRow2( -1 ),
110 : : nCol1( -1 ), nCol2( -1 )
111 : : {}
112 : :
113 : : SchNumericCellRangeAddress( const SchNumericCellRangeAddress& aOther )
114 : : {
115 : : nRow1 = aOther.nRow1; nRow2 = aOther.nRow2;
116 : : nCol1 = aOther.nCol1; nCol2 = aOther.nCol2;
117 : : }
118 : : };
119 : :
120 : : // ----------------------------------------
121 : :
122 : : enum SchXMLAxisDimension
123 : : {
124 : : SCH_XML_AXIS_X = 0,
125 : : SCH_XML_AXIS_Y,
126 : : SCH_XML_AXIS_Z,
127 : : SCH_XML_AXIS_UNDEF
128 : : };
129 : :
130 : 96 : struct SchXMLAxis
131 : : {
132 : : enum SchXMLAxisDimension eDimension;
133 : : sal_Int8 nAxisIndex;//0->primary axis; 1->secondary axis
134 : : rtl::OUString aName;
135 : : rtl::OUString aTitle;
136 : : bool bHasCategories;
137 : :
138 : 12 : SchXMLAxis() : eDimension( SCH_XML_AXIS_UNDEF ), nAxisIndex( 0 ), bHasCategories( false ) {}
139 : : };
140 : :
141 : : // ----------------------------------------
142 : :
143 : 6 : struct GlobalSeriesImportInfo
144 : : {
145 : 6 : GlobalSeriesImportInfo( sal_Bool& rAllRangeAddressesAvailable )
146 : : : rbAllRangeAddressesAvailable( rAllRangeAddressesAvailable )
147 : : , nCurrentDataIndex( 0 )
148 : : , nFirstFirstDomainIndex( -1 )
149 : 6 : , nFirstSecondDomainIndex( -1 )
150 : 6 : {}
151 : :
152 : : sal_Bool& rbAllRangeAddressesAvailable;
153 : :
154 : : sal_Int32 nCurrentDataIndex;
155 : :
156 : : ::rtl::OUString aFirstFirstDomainAddress;
157 : : sal_Int32 nFirstFirstDomainIndex;
158 : :
159 : : ::rtl::OUString aFirstSecondDomainAddress;
160 : : sal_Int32 nFirstSecondDomainIndex;
161 : : };
162 : :
163 : 54 : struct DataRowPointStyle
164 : : {
165 : : enum StyleType
166 : : {
167 : : DATA_POINT,
168 : : DATA_SERIES,
169 : : MEAN_VALUE,
170 : : REGRESSION,
171 : : ERROR_INDICATOR
172 : : };
173 : :
174 : : StyleType meType;
175 : : ::com::sun::star::uno::Reference<
176 : : ::com::sun::star::chart2::XDataSeries > m_xSeries;
177 : : ::com::sun::star::uno::Reference<
178 : : ::com::sun::star::beans::XPropertySet > m_xOldAPISeries;
179 : : com::sun::star::uno::Reference<
180 : : com::sun::star::beans::XPropertySet > m_xErrorXProperties;
181 : : com::sun::star::uno::Reference<
182 : : com::sun::star::beans::XPropertySet > m_xErrorYProperties;
183 : : ::com::sun::star::uno::Reference<
184 : : ::com::sun::star::beans::XPropertySet > m_xEquationProperties;
185 : : sal_Int32 m_nPointIndex;
186 : : sal_Int32 m_nPointRepeat;
187 : : ::rtl::OUString msStyleName;
188 : : ::rtl::OUString msSeriesStyleNameForDonuts;
189 : : sal_Int32 mnAttachedAxis;
190 : : bool mbSymbolSizeForSeriesIsMissingInFile;
191 : :
192 : 18 : DataRowPointStyle( StyleType eType
193 : : , const ::com::sun::star::uno::Reference<
194 : : ::com::sun::star::chart2::XDataSeries >& xSeries
195 : : , sal_Int32 nPointIndex
196 : : , sal_Int32 nPointRepeat
197 : : , ::rtl::OUString sStyleName
198 : : , sal_Int32 nAttachedAxis = 0 ) :
199 : : meType( eType ),
200 : : m_xSeries( xSeries ),
201 : : m_xOldAPISeries( 0 ),
202 : : m_nPointIndex( nPointIndex ),
203 : : m_nPointRepeat( nPointRepeat ),
204 : : msStyleName( sStyleName ),
205 : : mnAttachedAxis( nAttachedAxis ),
206 [ + - ]: 18 : mbSymbolSizeForSeriesIsMissingInFile( false )
207 : 18 : {}
208 : : };
209 : :
210 : : typedef ::std::multimap< ::rtl::OUString, ::com::sun::star::uno::Reference<
211 : : ::com::sun::star::chart2::data::XDataSequence > > tSchXMLRangeSequenceMap;
212 : :
213 : : #endif // SCH_XML_TRANSPORTTYPES_HXX_
214 : :
215 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|