Bump version to 4.3-4
[LibreOffice.git] / sc / inc / consoli.hxx
blob8811f5b55b13b9b5f7e6dd90fe4a55797fb4bf78
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 struct ScReferenceEntry // without constructor !
30 SCCOL nCol;
31 SCROW nRow;
32 SCTAB nTab;
36 //! Use delta value for data?
38 class ScReferenceList // without constructor !
40 private:
41 SCSIZE nCount;
42 SCSIZE nFullSize; // incl. fill entries
43 ScReferenceEntry* pData;
45 public:
46 void Init() { nCount=0; nFullSize=0; pData=NULL; }
47 void Clear() { delete[] pData; }
49 SCSIZE GetCount() { return nCount; }
50 const ScReferenceEntry& GetEntry( SCSIZE nPos ) { return pData[nPos]; }
51 void SetFullSize( SCSIZE nNew ) { nFullSize = nNew; }
53 void AddEntry( SCCOL nCol, SCROW nRow, SCTAB nTab );
57 // Sequence:
58 // 1) create ScConsData
59 // 2) Parameter (Size/Flags)
60 // 3) AddFields for all areas (only needed for bColByName or bRowByName)
61 // 4) DoneFields ( " " )
62 // 5) AddData for all areas
63 // perhaps AddName after each area
64 // 6) OutputToDocument
67 //! Use structure ScDocument if a certain size is exceeded?
69 class ScConsData
71 private:
72 ScSubTotalFunc eFunction;
73 bool bReference;
74 bool bColByName;
75 bool bRowByName;
76 SCSIZE nColCount;
77 SCSIZE nRowCount;
78 bool** ppUsed;
79 double** ppSum;
80 double** ppCount;
81 double** ppSumSqr;
82 ScReferenceList** ppRefs;
83 ::std::vector<OUString> maColHeaders;
84 ::std::vector<OUString> maRowHeaders;
85 ::std::vector<OUString> maTitles;
86 SCSIZE nDataCount;
87 SCSIZE** ppTitlePos;
88 bool bCornerUsed;
89 OUString aCornerText; // only for bColByName && bRowByName
91 public:
92 ScConsData();
93 ~ScConsData();
95 void SetSize( SCCOL nCols, SCROW nRows );
96 void SetFlags( ScSubTotalFunc eFunc, bool bColName, bool bRowName, bool bRef );
98 void InitData();
99 void DeleteData();
101 void AddFields( ScDocument* pSrcDoc, SCTAB nTab,
102 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
103 void DoneFields();
105 void AddData( ScDocument* pSrcDoc, SCTAB nTab,
106 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
107 void AddName( const OUString& rName );
109 void OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, SCTAB nTab );
111 void GetSize( SCCOL& rCols, SCROW& rRows ) const;
112 SCROW GetInsertCount() const;
116 #endif
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */