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 <tools/long.hxx>
41 #include "types.hxx"
42 #include "scdllapi.h"
43 #include "dpglobal.hxx"
44 #include "calcmacros.hxx"
45 
46 #include <vector>
47 #include <memory>
48 
49 #include <com/sun/star/uno/Sequence.hxx>
50 #include <com/sun/star/sheet/DataPilotFieldReference.hpp>
51 #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp>
52 #include <com/sun/star/sheet/DataPilotFieldLayoutInfo.hpp>
53 #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp>
54 
55 #define PIVOT_DATA_FIELD (MAXCOLCOUNT)
56 
58 {
59  OUString maName;
60  OUString maLayoutName;
62 
63  ScDPName();
64  explicit ScDPName(const OUString& rName, const OUString& rLayoutName, sal_uInt8 nDupCount);
65 };
66 
68 {
69  OUString maName;
70  OUString maLayoutName;
71  OUString maSubtotalName;
75  sal_Int32 mnUsedHier;
76  sal_Int32 mnFlags;
78  bool mbShowAll:1;
79  bool mbIsValue:1;
80  bool mbDataLayout:1;
82 
83  struct Member
84  {
85  OUString maName;
86  OUString maLayoutName;
87  bool mbVisible;
89 
90  Member();
91 
97  SC_DLLPUBLIC OUString const & getDisplayName() const;
98  };
99  std::vector<Member> maMembers;
100  css::uno::Sequence<OUString> maHiers;
101  css::sheet::DataPilotFieldSortInfo maSortInfo;
102  css::sheet::DataPilotFieldLayoutInfo maLayoutInfo;
103  css::sheet::DataPilotFieldAutoShowInfo maShowInfo;
104 
105  ScDPLabelData();
106 
111  SC_DLLPUBLIC OUString const & getDisplayName() const;
112 };
113 
114 typedef std::vector< std::unique_ptr<ScDPLabelData> > ScDPLabelDataVector;
115 
117 {
118  css::sheet::DataPilotFieldReference maFieldRef;
119 
124 
125  explicit ScPivotField( SCCOL nNewCol = 0 );
126 
127  tools::Long getOriginalDim() const;
128 };
129 
130 typedef std::vector< ScPivotField > ScPivotFieldVector;
131 
133 {
137 
143 
148 
149  ScPivotParam();
150  ScPivotParam( const ScPivotParam& r );
151  ~ScPivotParam();
152 
153  ScPivotParam& operator= ( const ScPivotParam& r );
154  void SetLabelData(const ScDPLabelDataVector& r);
155 };
156 
158 {
159  css::sheet::DataPilotFieldReference maFieldRef;
160 
165 
166  explicit ScPivotFuncData( SCCOL nCol, PivotFunc nFuncMask );
167 
168 #if DEBUG_PIVOT_TABLE
169  void Dump() const;
170 #endif
171 };
172 
173 typedef std::vector<ScDPName> ScDPNameVec;
174 
175 #endif
176 
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScPivotFieldVector maDataFields
Definition: pivot.hxx:142
OUString maName
Original name of the dimension.
Definition: pivot.hxx:59
sal_uInt8 mnDupCount
Definition: pivot.hxx:77
std::vector< Member > maMembers
Definition: pivot.hxx:99
long Long
ScPivotFuncData(SCCOL nCol, PivotFunc nFuncMask)
Definition: pivot2.cxx:145
bool mbDataLayout
Definition: pivot.hxx:80
sal_Int32 mnUsedHier
Used hierarchy.
Definition: pivot.hxx:75
bool mbShowAll
true = Show all (also empty) results.
Definition: pivot.hxx:78
SCTAB nTab
Definition: pivot.hxx:136
bool mbIsValue
true = Sum or count in data field.
Definition: pivot.hxx:79
PivotFunc mnFuncMask
Definition: pivot.hxx:162
css::sheet::DataPilotFieldLayoutInfo maLayoutInfo
Layout info.
Definition: pivot.hxx:102
bool mbRepeatItemLabels
Definition: pivot.hxx:81
css::sheet::DataPilotFieldReference maFieldRef
Definition: pivot.hxx:159
sal_Int32 mnFlags
Flags from the DataPilotSource dimension.
Definition: pivot.hxx:76
PivotFunc mnFuncMask
Page/Column/Row subtotal function.
Definition: pivot.hxx:74
PivotFunc
Definition: dpglobal.hxx:25
OUString maName
Original name of the dimension.
Definition: pivot.hxx:69
ScDPLabelDataVector maLabelArray
Definition: pivot.hxx:138
SC_DLLPUBLIC OUString const & getDisplayName() const
Definition: pivot2.cxx:45
sal_uInt8 mnDupCount
Definition: pivot.hxx:123
std::vector< ScDPName > ScDPNameVec
Definition: pivot.hxx:173
bool bMakeTotalCol
Definition: pivot.hxx:146
ScPivotFieldVector maColFields
Definition: pivot.hxx:140
sal_uInt8 mnDupCount
Definition: pivot.hxx:61
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Definition: pivot.hxx:114
tools::Long mnOriginalDim
>= 0 for duplicated field.
Definition: pivot.hxx:120
std::vector< ScPivotField > ScPivotFieldVector
Definition: pivot.hxx:130
sal_Int16 SCCOL
Definition: types.hxx:22
SC_DLLPUBLIC OUString const & getDisplayName() const
Definition: pivot2.cxx:66
css::sheet::DataPilotFieldReference maFieldRef
Definition: pivot.hxx:118
OUString maLayoutName
Definition: pivot.hxx:86
SCCOL nCol
Cursor Position /.
Definition: pivot.hxx:134
void SetLabelData(const ScDPLabelDataVector &r)
Definition: pivot2.cxx:113
ScPivotParam()
Definition: pivot2.cxx:90
PivotFunc nFuncMask
Definition: pivot.hxx:121
ScPivotParam & operator=(const ScPivotParam &r)
Definition: pivot2.cxx:124
bool bMakeTotalRow
Definition: pivot.hxx:147
OUString maLayoutName
Layout name (display name)
Definition: pivot.hxx:70
sal_Int32 SCROW
Definition: types.hxx:18
css::uno::Sequence< OUString > maHiers
Hierarchies.
Definition: pivot.hxx:100
tools::Long mnOriginalDim
Definition: pivot.hxx:161
unsigned char sal_uInt8
SCROW nRow
or start of destination area
Definition: pivot.hxx:135
css::sheet::DataPilotFieldSortInfo maSortInfo
Sorting info.
Definition: pivot.hxx:101
ScPivotFieldVector maRowFields
Definition: pivot.hxx:141
sal_uInt8 mnDupCount
Definition: pivot.hxx:164
ScPivotField(SCCOL nNewCol=0)
Definition: pivot2.cxx:76
bool bIgnoreEmptyRows
Definition: pivot.hxx:144
ScPivotFieldVector maPageFields
Definition: pivot.hxx:139
bool bDetectCategories
Definition: pivot.hxx:145
tools::Long getOriginalDim() const
Definition: pivot2.cxx:83
tools::Long mnOriginalDim
original dimension index (>= 0 for duplicated dimension)
Definition: pivot.hxx:73
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
SCCOL nCol
0-based dimension index (not source column index)
Definition: pivot.hxx:122
OUString maSubtotalName
Definition: pivot.hxx:71
OUString maLayoutName
Layout name (display name)
Definition: pivot.hxx:60
sal_Int16 SCTAB
Definition: types.hxx:23
SCCOL mnCol
0-based field index (not the source column index)
Definition: pivot.hxx:72
css::sheet::DataPilotFieldAutoShowInfo maShowInfo
AutoShow info.
Definition: pivot.hxx:103