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 #pragma once
20 
21 #include <com/sun/star/chart2/XDataSeries.hpp>
22 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
23 
24 #include <vector>
25 #include <map>
26 #include <optional>
27 
29 {
34 };
35 
36 struct SchXMLCell
37 {
38  OUString aString;
39  css::uno::Sequence< OUString > aComplexString;
40  double fValue;
42  OUString aRangeId;
43 
44  SchXMLCell(): fValue( 0.0 ), eType( SCH_CELL_TYPE_UNKNOWN )
45  {}
46 };
47 
49 {
50  std::vector< std::vector< SchXMLCell > > aData;
51 
52  sal_Int32 nRowIndex;
53  sal_Int32 nColumnIndex;
54  sal_Int32 nMaxColumnIndex;
55 
57 
60 
61  OUString aTableNameOfFile;
62 
63  ::std::vector< sal_Int32 > aHiddenColumns;
64 
65  bool bProtected;
66 
67  SchXMLTable() : nRowIndex( -1 ),
68  nColumnIndex( -1 ),
69  nMaxColumnIndex( -1 ),
70  nNumberOfColsEstimate( 0 ),
71  bHasHeaderRow( false ),
72  bHasHeaderColumn( false ),
73  bProtected( false )
74  {}
75 };
76 
77 typedef sal_Int32 tSchXMLIndex;
78 #define SCH_XML_CATEGORIES_INDEX (static_cast<tSchXMLIndex>(-1))
80 {
84 };
85 typedef ::std::pair< tSchXMLIndex, SchXMLLabeledSequencePart > tSchXMLIndexWithPart;
86 typedef ::std::multimap< tSchXMLIndexWithPart,
87  css::uno::Reference< css::chart2::data::XLabeledDataSequence > >
89 
90 bool operator < ( const tSchXMLIndexWithPart & rFirst, const tSchXMLIndexWithPart & rSecond );
91 
93 {
98 };
99 
101 {
103  sal_Int8 nAxisIndex;//0->primary axis; 1->secondary axis
104  OUString aName;
105  OUString aTitle;
107 
108  SchXMLAxis() : eDimension( SCH_XML_AXIS_UNDEF ), nAxisIndex( 0 ), bHasCategories( false ) {}
109 };
110 
112 {
113  explicit GlobalSeriesImportInfo( bool& rAllRangeAddressesAvailable )
114  : rbAllRangeAddressesAvailable( rAllRangeAddressesAvailable )
115  , nCurrentDataIndex( 0 )
116  , nFirstFirstDomainIndex( -1 )
118  {}
119 
121 
122  sal_Int32 nCurrentDataIndex;
123 
126 
129 };
130 
132 {
133  css::uno::Reference<
134  css::chart2::XDataSeries > m_xSeries;
135  css::uno::Reference<
136  css::beans::XPropertySet > m_xEquationProperties;
137 
138  OUString msStyleName;
139 
140  RegressionStyle(const css::uno::Reference<
141  css::chart2::XDataSeries >& xSeries,
142  const OUString& sStyleName) :
143  m_xSeries ( xSeries ),
144  msStyleName ( sStyleName )
145  {}
146 };
147 
155 {
157  ::std::vector<OUString> mLabels;
159  bool mbDataLabelsRange = false;
161  OUString msLabelGuid;
164 };
165 
167 {
169  {
176  };
177 
179  css::uno::Reference< css::chart2::XDataSeries > m_xSeries;
180 
181  css::uno::Reference< css::beans::XPropertySet > m_xOldAPISeries;
182 
183  css::uno::Reference< css::beans::XPropertySet > m_xErrorXProperties;
184 
185  css::uno::Reference< css::beans::XPropertySet > m_xErrorYProperties;
186 
187  sal_Int32 m_nPointIndex;
188  sal_Int32 m_nPointRepeat;
189  OUString msStyleName;
190  OUString msStyleNameOfParent; // e.g. target of line and fill styles of data-labels
192  double mCustomLabelPos[2] = { 0.0, 0.0 };
193  // for svg:x and svg:y attribute (in core unit), of element <chart:data-label>
194  std::optional<sal_Int32> mo_nLabelAbsolutePosX;
195  std::optional<sal_Int32> mo_nLabelAbsolutePosY;
197 
198  sal_Int32 mnAttachedAxis;
200 
202  , const css::uno::Reference< css::chart2::XDataSeries >& xSeries
203  , sal_Int32 nPointIndex
204  , sal_Int32 nPointRepeat
205  , const OUString& sStyleName
206  , sal_Int32 nAttachedAxis = 0 ) :
207  meType( eType ),
208  m_xSeries( xSeries ),
209  m_nPointIndex( nPointIndex ),
210  m_nPointRepeat( nPointRepeat ),
211  msStyleName( sStyleName ),
212  mnAttachedAxis( nAttachedAxis ),
213  mbSymbolSizeForSeriesIsMissingInFile( false )
214  {}
215 
216  // ctor for use in import of <chart:data-label> as child of <chart:series>
217  DataRowPointStyle(StyleType eType, const OUString& sStyleName, sal_Int32 nAttachedAxis = 0)
218  : meType(eType)
219  , m_nPointIndex(0)
220  , m_nPointRepeat(0)
221  , msStyleName(sStyleName)
222  , mnAttachedAxis(nAttachedAxis)
223  , mbSymbolSizeForSeriesIsMissingInFile(false)
224  {
225  }
226 };
227 
228 typedef ::std::multimap< OUString, css::uno::Reference<
229  css::chart2::data::XDataSequence > > tSchXMLRangeSequenceMap;
230 
231 /* 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
OUString msLabelGuid
GUID of the CELLRANGE field.
signed char sal_Int8
sal_Int8 nAxisIndex
SchXMLAxisDimension
css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties
CustomLabelsInfo mCustomLabels
css::uno::Sequence< OUString > aComplexString
OUString msSeriesStyleNameForDonuts
GlobalSeriesImportInfo(bool &rAllRangeAddressesAvailable)
RegressionStyle(const css::uno::Reference< css::chart2::XDataSeries > &xSeries, const OUString &sStyleName)
bool mbDataLabelsRange
Are label's contents sourced from a cell[range] ?
OUString aTitle
::std::pair< tSchXMLIndex, SchXMLLabeledSequencePart > tSchXMLIndexWithPart
::std::vector< OUString > mLabels
Text content of each field.
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
Used to store text content of a data point custom-label's fields and also the helper members that ind...
::std::multimap< OUString, css::uno::Reference< css::chart2::data::XDataSequence > > tSchXMLRangeSequenceMap
bool bHasHeaderRow
parsing column-elements may yield an estimate
OUString aTableNameOfFile
SchXMLLabeledSequencePart
OUString msLabelsCellRange
cell[range] from which label's contents are sourced.
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< 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