LOK: tilebench improvements
[LibreOffice.git] / sc / inc / consoli.hxx
blob015245cd18957c5a5851427bc1a536be8afc0f2e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_INC_CONSOLI_HXX
21 #define INCLUDED_SC_INC_CONSOLI_HXX
23 #include "global.hxx"
24 #include "address.hxx"
26 class ScDocument;
28 // Sequence:
29 // 1) create ScConsData
30 // 2) Parameter (Size/Flags)
31 // 3) AddFields for all areas (only needed for bColByName or bRowByName)
32 // 4) DoneFields ( " " )
33 // 5) AddData for all areas
34 // perhaps AddName after each area
35 // 6) OutputToDocument
37 //! Use structure ScDocument if a certain size is exceeded?
39 class ScConsData
41 private:
42 struct ScReferenceEntry // without constructor !
44 SCCOL nCol;
45 SCROW nRow;
46 SCTAB nTab;
48 typedef std::vector<ScReferenceEntry> ScReferenceList;
49 ScSubTotalFunc eFunction;
50 bool bReference;
51 bool bColByName;
52 bool bRowByName;
53 SCSIZE nColCount;
54 SCSIZE nRowCount;
55 bool** ppUsed;
56 double** ppSum;
57 double** ppCount;
58 double** ppSumSqr;
59 ScReferenceList** ppRefs;
60 ::std::vector<OUString> maColHeaders;
61 ::std::vector<OUString> maRowHeaders;
62 ::std::vector<OUString> maTitles;
63 SCSIZE nDataCount;
64 SCSIZE** ppTitlePos;
65 bool bCornerUsed;
66 OUString aCornerText; // only for bColByName && bRowByName
68 public:
69 ScConsData();
70 ~ScConsData();
72 void SetSize( SCCOL nCols, SCROW nRows );
73 void SetFlags( ScSubTotalFunc eFunc, bool bColName, bool bRowName, bool bRef );
75 void InitData();
76 void DeleteData();
78 void AddFields( const ScDocument* pSrcDoc, SCTAB nTab,
79 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
80 void DoneFields();
82 void AddData( ScDocument* pSrcDoc, SCTAB nTab,
83 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
84 void AddName( const OUString& rName );
86 void OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, SCTAB nTab );
88 void GetSize( SCCOL& rCols, SCROW& rRows ) const;
89 SCROW GetInsertCount() const;
92 #endif
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */