LibreOffice Module xmloff (master)  1
transporttypes.hxx
Go to the documentation of this file.
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 #include <optional>
28 
30 {
35 };
36 
37 struct SchXMLCell
38 {
39  OUString aString;
40  css::uno::Sequence< OUString > aComplexString;
41  double fValue;
43  OUString aRangeId;
44 
45  SchXMLCell(): fValue( 0.0 ), eType( SCH_CELL_TYPE_UNKNOWN )
46  {}
47 };
48 
50 {
51  std::vector< std::vector< SchXMLCell > > aData;
52 
53  sal_Int32 nRowIndex;
54  sal_Int32 nColumnIndex;
55  sal_Int32 nMaxColumnIndex;
56 
58 
61 
62  OUString aTableNameOfFile;
63 
64  ::std::vector< sal_Int32 > aHiddenColumns;
65 
66  bool bProtected;
67 
68  SchXMLTable() : nRowIndex( -1 ),
69  nColumnIndex( -1 ),
70  nMaxColumnIndex( -1 ),
71  nNumberOfColsEstimate( 0 ),
72  bHasHeaderRow( false ),
73  bHasHeaderColumn( false ),
74  bProtected( false )
75  {}
76 };
77 
78 typedef sal_Int32 tSchXMLIndex;
79 #define SCH_XML_CATEGORIES_INDEX (static_cast<tSchXMLIndex>(-1))
81 {
85 };
86 typedef ::std::pair< tSchXMLIndex, SchXMLLabeledSequencePart > tSchXMLIndexWithPart;
87 typedef ::std::multimap< tSchXMLIndexWithPart,
88  css::uno::Reference< css::chart2::data::XLabeledDataSequence > >
90 
91 bool operator < ( const tSchXMLIndexWithPart & rFirst, const tSchXMLIndexWithPart & rSecond );
92 
94 {
99 };
100 
102 {
104  sal_Int8 nAxisIndex;//0->primary axis; 1->secondary axis
105  OUString aName;
106  OUString aTitle;
108 
109  SchXMLAxis() : eDimension( SCH_XML_AXIS_UNDEF ), nAxisIndex( 0 ), bHasCategories( false ) {}
110 };
111 
113 {
114  explicit GlobalSeriesImportInfo( bool& rAllRangeAddressesAvailable )
115  : rbAllRangeAddressesAvailable( rAllRangeAddressesAvailable )
116  , nCurrentDataIndex( 0 )
117  , nFirstFirstDomainIndex( -1 )
119  {}
120 
122 
123  sal_Int32 nCurrentDataIndex;
124 
127 
130 };
131 
133 {
134  css::uno::Reference<
135  css::chart2::XDataSeries > m_xSeries;
136  css::uno::Reference<
137  css::beans::XPropertySet > m_xEquationProperties;
138 
139  OUString msStyleName;
140 
141  RegressionStyle(const css::uno::Reference<
142  css::chart2::XDataSeries >& xSeries,
143  const OUString& sStyleName) :
144  m_xSeries ( xSeries ),
145  msStyleName ( sStyleName )
146  {}
147 };
148 
150 {
152  {
159  };
160 
162  css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
163 
164  css::uno::Reference< css::beans::XPropertySet > m_xOldAPISeries;
165 
166  css::uno::Reference< css::beans::XPropertySet > m_xErrorXProperties;
167 
168  css::uno::Reference< css::beans::XPropertySet > m_xErrorYProperties;
169 
170  sal_Int32 m_nPointIndex;
171  sal_Int32 m_nPointRepeat;
172  OUString msStyleName;
173  OUString msStyleNameOfParent; // e.g. target of line and fill styles of data-labels
174  ::std::vector<OUString> mCustomLabels;
175  double mCustomLabelPos[2] = { 0.0, 0.0 };
176  // for svg:x and svg:y attribute (in core unit), of element <chart:data-label>
177  std::optional<sal_Int32> mo_nLabelAbsolutePosX;
178  std::optional<sal_Int32> mo_nLabelAbsolutePosY;
180 
181  sal_Int32 mnAttachedAxis;
183 
185  , const css::uno::Reference< css::chart2::XDataSeries >& xSeries
186  , sal_Int32 nPointIndex
187  , sal_Int32 nPointRepeat
188  , const OUString& sStyleName
189  , sal_Int32 nAttachedAxis = 0 ) :
190  meType( eType ),
191  m_xSeries( xSeries ),
192  m_nPointIndex( nPointIndex ),
193  m_nPointRepeat( nPointRepeat ),
194  msStyleName( sStyleName ),
195  mnAttachedAxis( nAttachedAxis ),
196  mbSymbolSizeForSeriesIsMissingInFile( false )
197  {}
198 
199  // ctor for use in import of <chart:data-label> as child of <chart:series>
200  DataRowPointStyle(StyleType eType, const OUString& sStyleName, sal_Int32 nAttachedAxis = 0)
201  : meType(eType)
202  , m_nPointIndex(0)
203  , m_nPointRepeat(0)
204  , msStyleName(sStyleName)
205  , mnAttachedAxis(nAttachedAxis)
206  , mbSymbolSizeForSeriesIsMissingInFile(false)
207  {
208  }
209 };
210 
211 typedef ::std::multimap< OUString, css::uno::Reference<
212  css::chart2::data::XDataSequence > > tSchXMLRangeSequenceMap;
213 
214 #endif // INCLUDED_XMLOFF_SOURCE_CHART_TRANSPORTTYPES_HXX
215 
216 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SchXMLCellType
css::uno::Reference< css::chart2::XDataSeries > m_xSeries
std::optional< sal_Int32 > mo_nLabelAbsolutePosX
sal_Int32 tSchXMLIndex
OUString aString
signed char sal_Int8
sal_Int8 nAxisIndex
SchXMLAxisDimension
css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties
css::uno::Sequence< OUString > aComplexString
OUString msSeriesStyleNameForDonuts
GlobalSeriesImportInfo(bool &rAllRangeAddressesAvailable)
RegressionStyle(const css::uno::Reference< css::chart2::XDataSeries > &xSeries, const OUString &sStyleName)
OUString aTitle
::std::pair< tSchXMLIndex, SchXMLLabeledSequencePart > tSchXMLIndexWithPart
sal_Int32 nNumberOfColsEstimate
the greatest number of columns detected
css::uno::Reference< css::chart2::XDataSeries > m_xSeries
OUString aRangeId
enum SchXMLAxisDimension eDimension
css::uno::Reference< css::beans::XPropertySet > m_xErrorXProperties
sal_Int32 nColumnIndex
reflects the index of the row currently parsed
std::vector< std::vector< SchXMLCell > > aData
OUString aName
OUString msStyleNameOfParent
bool mbSymbolSizeForSeriesIsMissingInFile
::std::multimap< OUString, css::uno::Reference< css::chart2::data::XDataSequence > > tSchXMLRangeSequenceMap
bool bHasHeaderRow
parsing column-elements may yield an estimate
OUString aTableNameOfFile
SchXMLLabeledSequencePart
DataRowPointStyle(StyleType eType, const OUString &sStyleName, sal_Int32 nAttachedAxis=0)
bool operator<(const tSchXMLIndexWithPart &rFirst, const tSchXMLIndexWithPart &rSecond)
sal_Int32 nMaxColumnIndex
reflects the index of the column currently parsed
DataRowPointStyle(StyleType eType, const css::uno::Reference< css::chart2::XDataSeries > &xSeries, sal_Int32 nPointIndex, sal_Int32 nPointRepeat, const OUString &sStyleName, sal_Int32 nAttachedAxis=0)
SchXMLCellType eType
::std::vector< OUString > mCustomLabels
::std::vector< sal_Int32 > aHiddenColumns
the table name read at the table:table element
css::uno::Reference< css::beans::XPropertySet > m_xErrorYProperties
::std::multimap< tSchXMLIndexWithPart, css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tSchXMLLSequencesPerIndex
std::optional< sal_Int32 > mo_nLabelAbsolutePosY
css::uno::Reference< css::beans::XPropertySet > m_xOldAPISeries
sal_Int32 nRowIndex
an array of rows containing the table contents