LibreOffice Module sc (master)  1
pivot.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 
20 /*
21  IMPORTANT:
22  Strictly adhere to the following sequence when creating a pivot table:
23 
24  pPivot->SetColFields(aColArr, aColCount)
25  pPivot->SetRowFields(aRowArr, aRowCount)
26  pPivot->SetDataFields(aDataArr, aDataCount)
27  if (pPivot->CreateData())
28  {
29  pPivotDrawData();
30  pPivotReleaseData();
31  }
32 
33  Make sure that either ColArr or RowArr contains a PivotDataField entry.
34 */
35 
36 #ifndef INCLUDED_SC_INC_PIVOT_HXX
37 #define INCLUDED_SC_INC_PIVOT_HXX
38 
39 #include <rtl/ustring.hxx>
40 #include "types.hxx"
41 #include "scdllapi.h"
42 #include "dpglobal.hxx"
43 #include "calcmacros.hxx"
44 
45 #include <vector>
46 #include <memory>
47 
48 #include <com/sun/star/uno/Sequence.hxx>
49 #include <com/sun/star/sheet/DataPilotFieldReference.hpp>
50 #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp>
51 #include <com/sun/star/sheet/DataPilotFieldLayoutInfo.hpp>
52 #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp>
53 
54 #define PIVOT_DATA_FIELD (MAXCOLCOUNT)
55 
57 {
58  OUString maName;
59  OUString maLayoutName;
61 
62  ScDPName();
63  explicit ScDPName(const OUString& rName, const OUString& rLayoutName, sal_uInt8 nDupCount);
64 };
65 
67 {
68  OUString maName;
69  OUString maLayoutName;
70  OUString maSubtotalName;
74  sal_Int32 mnUsedHier;
75  sal_Int32 mnFlags;
77  bool mbShowAll:1;
78  bool mbIsValue:1;
79  bool mbDataLayout:1;
81 
82  struct Member
83  {
84  OUString maName;
85  OUString maLayoutName;
86  bool mbVisible;
88 
89  Member();
90 
96  SC_DLLPUBLIC OUString const & getDisplayName() const;
97  };
98  std::vector<Member> maMembers;
99  css::uno::Sequence<OUString> maHiers;
100  css::sheet::DataPilotFieldSortInfo maSortInfo;
101  css::sheet::DataPilotFieldLayoutInfo maLayoutInfo;
102  css::sheet::DataPilotFieldAutoShowInfo maShowInfo;
103 
104  ScDPLabelData();
105 
110  SC_DLLPUBLIC OUString const & getDisplayName() const;
111 };
112 
113 typedef std::vector< std::unique_ptr<ScDPLabelData> > ScDPLabelDataVector;
114 
116 {
117  css::sheet::DataPilotFieldReference maFieldRef;
118 
123 
124  explicit ScPivotField( SCCOL nNewCol = 0 );
125 
126  long getOriginalDim() const;
127 };
128 
129 typedef std::vector< ScPivotField > ScPivotFieldVector;
130 
132 {
136 
142 
147 
148  ScPivotParam();
149  ScPivotParam( const ScPivotParam& r );
150  ~ScPivotParam();
151 
152  ScPivotParam& operator= ( const ScPivotParam& r );
153  void SetLabelData(const ScDPLabelDataVector& r);
154 };
155 
157 {
158  css::sheet::DataPilotFieldReference maFieldRef;
159 
164 
165  explicit ScPivotFuncData( SCCOL nCol, PivotFunc nFuncMask );
166 
167 #if DEBUG_PIVOT_TABLE
168  void Dump() const;
169 #endif
170 };
171 
172 typedef std::vector<ScDPName> ScDPNameVec;
173 
174 #endif
175 
176 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScPivotFieldVector maDataFields
Definition: pivot.hxx:141
OUString maName
Original name of the dimension.
Definition: pivot.hxx:58
sal_uInt8 mnDupCount
Definition: pivot.hxx:76
std::vector< Member > maMembers
Definition: pivot.hxx:98
ScPivotFuncData(SCCOL nCol, PivotFunc nFuncMask)
Definition: pivot2.cxx:145
bool mbDataLayout
Definition: pivot.hxx:79
sal_Int32 mnUsedHier
Used hierarchy.
Definition: pivot.hxx:74
bool mbShowAll
true = Show all (also empty) results.
Definition: pivot.hxx:77
SCTAB nTab
Definition: pivot.hxx:135
bool mbIsValue
true = Sum or count in data field.
Definition: pivot.hxx:78
PivotFunc mnFuncMask
Definition: pivot.hxx:161
css::sheet::DataPilotFieldLayoutInfo maLayoutInfo
Layout info.
Definition: pivot.hxx:101
bool mbRepeatItemLabels
Definition: pivot.hxx:80
css::sheet::DataPilotFieldReference maFieldRef
Definition: pivot.hxx:158
long mnOriginalDim
>= 0 for duplicated field.
Definition: pivot.hxx:119
long mnOriginalDim
Definition: pivot.hxx:160
sal_Int32 mnFlags
Flags from the DataPilotSource dimension.
Definition: pivot.hxx:75
PivotFunc mnFuncMask
Page/Column/Row subtotal function.
Definition: pivot.hxx:73
PivotFunc
Definition: dpglobal.hxx:25
OUString maName
Original name of the dimension.
Definition: pivot.hxx:68
ScDPLabelDataVector maLabelArray
Definition: pivot.hxx:137
SC_DLLPUBLIC OUString const & getDisplayName() const
Definition: pivot2.cxx:45
sal_uInt8 mnDupCount
Definition: pivot.hxx:122
std::vector< ScDPName > ScDPNameVec
Definition: pivot.hxx:172
bool bMakeTotalCol
Definition: pivot.hxx:145
ScPivotFieldVector maColFields
Definition: pivot.hxx:139
sal_uInt8 mnDupCount
Definition: pivot.hxx:60
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Definition: pivot.hxx:113
std::vector< ScPivotField > ScPivotFieldVector
Definition: pivot.hxx:129
sal_Int16 SCCOL
Definition: types.hxx:22
long mnOriginalDim
original dimension index (>= 0 for duplicated dimension)
Definition: pivot.hxx:72
SC_DLLPUBLIC OUString const & getDisplayName() const
Definition: pivot2.cxx:66
css::sheet::DataPilotFieldReference maFieldRef
Definition: pivot.hxx:117
OUString maLayoutName
Definition: pivot.hxx:85
SCCOL nCol
Cursor Position /.
Definition: pivot.hxx:133
void SetLabelData(const ScDPLabelDataVector &r)
Definition: pivot2.cxx:113
ScPivotParam()
Definition: pivot2.cxx:90
PivotFunc nFuncMask
Definition: pivot.hxx:120
ScPivotParam & operator=(const ScPivotParam &r)
Definition: pivot2.cxx:124
bool bMakeTotalRow
Definition: pivot.hxx:146
OUString maLayoutName
Layout name (display name)
Definition: pivot.hxx:69
sal_Int32 SCROW
Definition: types.hxx:18
css::uno::Sequence< OUString > maHiers
Hierarchies.
Definition: pivot.hxx:99
unsigned char sal_uInt8
long getOriginalDim() const
Definition: pivot2.cxx:83
SCROW nRow
or start of destination area
Definition: pivot.hxx:134
css::sheet::DataPilotFieldSortInfo maSortInfo
Sorting info.
Definition: pivot.hxx:100
ScPivotFieldVector maRowFields
Definition: pivot.hxx:140
sal_uInt8 mnDupCount
Definition: pivot.hxx:163
ScPivotField(SCCOL nNewCol=0)
Definition: pivot2.cxx:76
bool bIgnoreEmptyRows
Definition: pivot.hxx:143
ScPivotFieldVector maPageFields
Definition: pivot.hxx:138
bool bDetectCategories
Definition: pivot.hxx:144
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
SCCOL nCol
0-based dimension index (not source column index)
Definition: pivot.hxx:121
OUString maSubtotalName
Definition: pivot.hxx:70
OUString maLayoutName
Layout name (display name)
Definition: pivot.hxx:59
sal_Int16 SCTAB
Definition: types.hxx:23
SCCOL mnCol
0-based field index (not the source column index)
Definition: pivot.hxx:71
css::sheet::DataPilotFieldAutoShowInfo maShowInfo
AutoShow info.
Definition: pivot.hxx:102