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#pragma once
37
38#include <rtl/ustring.hxx>
39#include <tools/long.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 (SCCOL(-1))
55
57{
58 OUString maName;
59 OUString maLayoutName;
61
62 ScDPName();
63 explicit ScDPName(OUString aName, OUString aLayoutName, sal_uInt8 nDupCount);
64};
65
67{
68 OUString maName;
69 OUString maLayoutName;
74 sal_Int32 mnUsedHier;
75 sal_Int32 mnFlags;
77 bool mbShowAll:1;
78 bool mbIsValue:1;
81
82 struct Member
83 {
84 OUString maName;
85 OUString maLayoutName;
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
105
110 SC_DLLPUBLIC OUString const & getDisplayName() const;
111};
112
113typedef std::vector< std::unique_ptr<ScDPLabelData> > ScDPLabelDataVector;
114
116{
117 css::sheet::DataPilotFieldReference maFieldRef;
118
123
124 explicit ScPivotField( SCCOL nNewCol = 0 );
125
127};
128
129typedef std::vector< ScPivotField > ScPivotFieldVector;
130
132{
136
142
147
148 ScPivotParam();
149 ScPivotParam( const ScPivotParam& r );
151
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
172typedef std::vector<ScDPName> ScDPNameVec;
173
174/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PivotFunc
Definition: dpglobal.hxx:24
long Long
std::vector< ScDPName > ScDPNameVec
Definition: pivot.hxx:172
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Definition: pivot.hxx:113
std::vector< ScPivotField > ScPivotFieldVector
Definition: pivot.hxx:129
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
SC_DLLPUBLIC OUString const & getDisplayName() const
Definition: pivot2.cxx:46
OUString maLayoutName
Definition: pivot.hxx:85
sal_Int32 mnUsedHier
Used hierarchy.
Definition: pivot.hxx:74
OUString maSubtotalName
Definition: pivot.hxx:70
css::sheet::DataPilotFieldAutoShowInfo maShowInfo
AutoShow info.
Definition: pivot.hxx:102
bool mbRepeatItemLabels
Definition: pivot.hxx:80
tools::Long mnOriginalDim
original dimension index (>= 0 for duplicated dimension)
Definition: pivot.hxx:72
bool mbIsValue
true = Sum or count in data field.
Definition: pivot.hxx:78
css::sheet::DataPilotFieldLayoutInfo maLayoutInfo
Layout info.
Definition: pivot.hxx:101
SCCOL mnCol
0-based field index (not the source column index)
Definition: pivot.hxx:71
OUString maName
Original name of the dimension.
Definition: pivot.hxx:68
bool mbDataLayout
Definition: pivot.hxx:79
bool mbShowAll
true = Show all (also empty) results.
Definition: pivot.hxx:77
css::uno::Sequence< OUString > maHiers
Hierarchies.
Definition: pivot.hxx:99
OUString maLayoutName
Layout name (display name)
Definition: pivot.hxx:69
sal_uInt8 mnDupCount
Definition: pivot.hxx:76
css::sheet::DataPilotFieldSortInfo maSortInfo
Sorting info.
Definition: pivot.hxx:100
PivotFunc mnFuncMask
Page/Column/Row subtotal function.
Definition: pivot.hxx:73
std::vector< Member > maMembers
Definition: pivot.hxx:98
SC_DLLPUBLIC OUString const & getDisplayName() const
Definition: pivot2.cxx:67
sal_Int32 mnFlags
Flags from the DataPilotSource dimension.
Definition: pivot.hxx:75
OUString maName
Original name of the dimension.
Definition: pivot.hxx:58
sal_uInt8 mnDupCount
Definition: pivot.hxx:60
OUString maLayoutName
Layout name (display name)
Definition: pivot.hxx:59
sal_uInt8 mnDupCount
Definition: pivot.hxx:122
SCCOL nCol
0-based dimension index (not source column index)
Definition: pivot.hxx:121
tools::Long getOriginalDim() const
Definition: pivot2.cxx:84
css::sheet::DataPilotFieldReference maFieldRef
Definition: pivot.hxx:117
ScPivotField(SCCOL nNewCol=0)
Definition: pivot2.cxx:77
tools::Long mnOriginalDim
>= 0 for duplicated field.
Definition: pivot.hxx:119
PivotFunc nFuncMask
Definition: pivot.hxx:120
css::sheet::DataPilotFieldReference maFieldRef
Definition: pivot.hxx:158
sal_uInt8 mnDupCount
Definition: pivot.hxx:163
ScPivotFuncData(SCCOL nCol, PivotFunc nFuncMask)
Definition: pivot2.cxx:146
tools::Long mnOriginalDim
Definition: pivot.hxx:160
PivotFunc mnFuncMask
Definition: pivot.hxx:161
bool bMakeTotalRow
Definition: pivot.hxx:146
ScDPLabelDataVector maLabelArray
Definition: pivot.hxx:137
ScPivotFieldVector maDataFields
Definition: pivot.hxx:141
ScPivotFieldVector maRowFields
Definition: pivot.hxx:140
SCTAB nTab
Definition: pivot.hxx:135
bool bDetectCategories
Definition: pivot.hxx:144
SCCOL nCol
Cursor Position /.
Definition: pivot.hxx:133
SCROW nRow
or start of destination area
Definition: pivot.hxx:134
bool bIgnoreEmptyRows
Definition: pivot.hxx:143
bool bMakeTotalCol
Definition: pivot.hxx:145
ScPivotFieldVector maColFields
Definition: pivot.hxx:139
ScPivotParam()
Definition: pivot2.cxx:91
ScPivotParam & operator=(const ScPivotParam &r)
Definition: pivot2.cxx:125
void SetLabelData(const ScDPLabelDataVector &r)
Definition: pivot2.cxx:114
ScPivotFieldVector maPageFields
Definition: pivot.hxx:138
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17