LibreOffice Module sc (master) 1
dpoutput.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#pragma once
21
22#include <com/sun/star/sheet/DataPilotOutputRangeType.hpp>
23#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
24#include <com/sun/star/uno/Sequence.hxx>
25
26#include <tools/long.hxx>
27
28#include "address.hxx"
29
30#include "dptypes.hxx"
31
32#include <memory>
33#include <vector>
34
35namespace com::sun::star::sheet {
36 struct DataPilotFieldFilter;
37 struct DataPilotTablePositionData;
38 struct DataResult;
39 struct MemberResult;
40 class XDimensionsSupplier;
41}
42namespace tools { class Rectangle; }
43class ScDocument;
44struct ScDPOutLevelData;
45
47{
48private:
50 css::uno::Reference< css::sheet::XDimensionsSupplier> xSource;
52 std::vector<ScDPOutLevelData> pColFields;
53 std::vector<ScDPOutLevelData> pRowFields;
54 std::vector<ScDPOutLevelData> pPageFields;
55 css::uno::Sequence< css::uno::Sequence< css::sheet::DataResult> > aData;
57
58 // Number format related parameters
59 std::unique_ptr<sal_uInt32[]>
61 std::unique_ptr<sal_uInt32[]>
63 sal_Int32 nColFmtCount;
64 sal_Int32 nRowFmtCount;
65 sal_uInt32 nSingleNumFmt;
66
67 // Output geometry related parameters
68 sal_Int32 nColCount;
69 sal_Int32 nRowCount;
70 sal_Int32 nHeaderSize;
79 bool bDoFilter:1;
83 bool mbHeaderLayout:1; // true : grid, false : standard
84
85 void DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
86 const css::sheet::DataResult& rData );
87 void HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
88 const css::sheet::MemberResult& rData,
89 bool bColHeader, tools::Long nLevel );
90
91 void FieldCell(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScDPOutLevelData& rData, bool bInTable);
92
93 void CalcSizes();
94
98 sal_Int32 GetPositionType(const ScAddress& rPos);
99
100public:
102 css::uno::Reference< css::sheet::XDimensionsSupplier> xSrc,
103 const ScAddress& rPos, bool bFilter );
104 ~ScDPOutput();
105
106 void SetPosition( const ScAddress& rPos );
107
108 void Output();
109 ScRange GetOutputRange( sal_Int32 nRegionType = css::sheet::DataPilotOutputRangeType::WHOLE );
110 sal_Int32 GetHeaderRows() const;
111 bool HasError(); // range overflow or exception from source
112
113 void GetPositionData(const ScAddress& rPos, css::sheet::DataPilotTablePositionData& rPosData);
114
117 bool GetDataResultPositionData(::std::vector< css::sheet::DataPilotFieldFilter >& rFilters, const ScAddress& rPos);
118
119 tools::Long GetHeaderDim( const ScAddress& rPos, css::sheet::DataPilotFieldOrientation& rOrient );
120 bool GetHeaderDrag(
121 const ScAddress& rPos, bool bMouseLeft, bool bMouseTop, tools::Long nDragDim,
122 tools::Rectangle& rPosRect, css::sheet::DataPilotFieldOrientation& rOrient, tools::Long& rDimPos );
123 bool IsFilterButton( const ScAddress& rPos );
124
125 void GetMemberResultNames(ScDPUniqueStringSet& rNames, tools::Long nDimension);
126
127 void SetHeaderLayout(bool bUseGrid);
128 bool GetHeaderLayout() const { return mbHeaderLayout;}
129
130 static void GetDataDimensionNames(
131 OUString& rSourceName, OUString& rGivenName,
132 const css::uno::Reference< css::uno::XInterface>& xDim );
133};
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetHeaderDrag(const ScAddress &rPos, bool bMouseLeft, bool bMouseTop, tools::Long nDragDim, tools::Rectangle &rPosRect, css::sheet::DataPilotFieldOrientation &rOrient, tools::Long &rDimPos)
Definition: dpoutput.cxx:1598
SCROW nTabStartRow
Definition: dpoutput.hxx:72
bool bResultsError
Definition: dpoutput.hxx:80
void HeaderCell(SCCOL nCol, SCROW nRow, SCTAB nTab, const css::sheet::MemberResult &rData, bool bColHeader, tools::Long nLevel)
Definition: dpoutput.cxx:745
void CalcSizes()
Definition: dpoutput.cxx:836
void Output()
Definition: dpoutput.cxx:932
bool bDoFilter
Definition: dpoutput.hxx:79
sal_Int32 nRowFmtCount
Definition: dpoutput.hxx:64
SCCOL nTabEndCol
Definition: dpoutput.hxx:77
bool GetHeaderLayout() const
Definition: dpoutput.hxx:128
SCROW nTabEndRow
Definition: dpoutput.hxx:78
SCCOL nMemberStartCol
Definition: dpoutput.hxx:73
ScRange GetOutputRange(sal_Int32 nRegionType=css::sheet::DataPilotOutputRangeType::WHOLE)
Refresh?
Definition: dpoutput.cxx:1127
sal_Int32 nRowCount
Definition: dpoutput.hxx:69
std::unique_ptr< sal_uInt32[]> pRowNumFmt
Definition: dpoutput.hxx:62
SCROW nMemberStartRow
Definition: dpoutput.hxx:74
void GetPositionData(const ScAddress &rPos, css::sheet::DataPilotTablePositionData &rPosData)
Definition: dpoutput.cxx:1287
void GetMemberResultNames(ScDPUniqueStringSet &rNames, tools::Long nDimension)
Definition: dpoutput.cxx:1171
css::uno::Sequence< css::uno::Sequence< css::sheet::DataResult > > aData
Definition: dpoutput.hxx:55
sal_Int32 nHeaderSize
Definition: dpoutput.hxx:70
ScAddress aStartPos
Definition: dpoutput.hxx:51
void SetPosition(const ScAddress &rPos)
Definition: dpoutput.cxx:687
css::uno::Reference< css::sheet::XDimensionsSupplier > xSource
Definition: dpoutput.hxx:50
bool mbHeaderLayout
Definition: dpoutput.hxx:83
bool bSizesValid
Definition: dpoutput.hxx:81
ScDocument * pDoc
Definition: dpoutput.hxx:49
bool GetDataResultPositionData(::std::vector< css::sheet::DataPilotFieldFilter > &rFilters, const ScAddress &rPos)
Get filtering criteria based on the position of the cell within data field region.
Definition: dpoutput.cxx:1394
void FieldCell(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScDPOutLevelData &rData, bool bInTable)
Definition: dpoutput.cxx:795
tools::Long GetHeaderDim(const ScAddress &rPos, css::sheet::DataPilotFieldOrientation &rOrient)
Definition: dpoutput.cxx:1552
std::vector< ScDPOutLevelData > pColFields
Definition: dpoutput.hxx:52
sal_Int32 nColFmtCount
Definition: dpoutput.hxx:63
SCROW nDataStartRow
Definition: dpoutput.hxx:76
bool IsFilterButton(const ScAddress &rPos)
Definition: dpoutput.cxx:1540
bool HasError()
Definition: dpoutput.cxx:1147
sal_uInt32 nSingleNumFmt
Definition: dpoutput.hxx:65
std::vector< ScDPOutLevelData > pPageFields
Definition: dpoutput.hxx:54
ScDPOutput(ScDocument *pD, css::uno::Reference< css::sheet::XDimensionsSupplier > xSrc, const ScAddress &rPos, bool bFilter)
Definition: dpoutput.cxx:506
SCCOL nTabStartCol
Definition: dpoutput.hxx:71
static void GetDataDimensionNames(OUString &rSourceName, OUString &rGivenName, const css::uno::Reference< css::uno::XInterface > &xDim)
Definition: dpoutput.cxx:1519
OUString aDataDescription
Definition: dpoutput.hxx:56
bool bSizeOverflow
Definition: dpoutput.hxx:82
std::unique_ptr< sal_uInt32[]> pColNumFmt
Definition: dpoutput.hxx:60
std::vector< ScDPOutLevelData > pRowFields
Definition: dpoutput.hxx:53
sal_Int32 GetHeaderRows() const
Definition: dpoutput.cxx:1154
void SetHeaderLayout(bool bUseGrid)
Definition: dpoutput.cxx:1197
SCCOL nDataStartCol
Definition: dpoutput.hxx:75
void DataCell(SCCOL nCol, SCROW nRow, SCTAB nTab, const css::sheet::DataResult &rData)
Definition: dpoutput.cxx:693
sal_Int32 nColCount
Definition: dpoutput.hxx:68
sal_Int32 GetPositionType(const ScAddress &rPos)
Query which sub-area of the table the cell is in.
Definition: dpoutput.cxx:889
std::unordered_set< OUString > ScDPUniqueStringSet
Definition: dptypes.hxx:16
long Long
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17