merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / inc / consoli.hxx
blob4eb30b12c4328850e29c732c4b792a6ed4c01874
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SC_CONSOLI_HXX
29 #define SC_CONSOLI_HXX
31 #include "global.hxx"
32 #include "address.hxx"
34 class ScDocument;
36 // -----------------------------------------------------------------------
38 struct ScReferenceEntry // ohne Constructor !
40 SCCOL nCol;
41 SCROW nRow;
42 SCTAB nTab;
46 //! Delta-Wert fuer Daten benutzen?
48 class ScReferenceList // ohne Constructor !
50 private:
51 SCSIZE nCount;
52 SCSIZE nFullSize; // inkl. Fuell-Eintraege
53 ScReferenceEntry* pData;
55 public:
56 void Init() { nCount=0; nFullSize=0; pData=NULL; }
57 void Clear() { delete[] pData; }
59 SCSIZE GetCount() { return nCount; }
60 const ScReferenceEntry& GetEntry( SCSIZE nPos ) { return pData[nPos]; }
61 void SetFullSize( SCSIZE nNew ) { nFullSize = nNew; }
63 void AddEntry( SCCOL nCol, SCROW nRow, SCTAB nTab );
66 // -----------------------------------------------------------------------
70 // Reihenfolge:
71 // 1) ScConsData anlegen
72 // 2) Parameter (Size/Flags)
73 // 3) AddFields fuer alle Bereiche (nur noetig bei bColByName oder bRowByName)
74 // 4) DoneFields ( " " )
75 // 5) AddData fuer alle Bereiche
76 // evtl. AddName nach jedem Bereich
77 // 6) OutputToDocument
80 //! ab bestimmter Groesse ScDocument Struktur benutzen?
83 class ScConsData
85 private:
86 ScSubTotalFunc eFunction;
87 BOOL bReference;
88 BOOL bColByName;
89 BOOL bRowByName;
90 BOOL bSubTitles;
91 SCSIZE nColCount;
92 SCSIZE nRowCount;
93 BOOL** ppUsed;
94 double** ppSum;
95 double** ppCount;
96 double** ppSumSqr;
97 ScReferenceList** ppRefs;
98 String** ppColHeaders;
99 String** ppRowHeaders;
100 SCSIZE nDataCount;
101 SCSIZE nTitleCount;
102 String** ppTitles;
103 SCSIZE** ppTitlePos;
104 BOOL bCornerUsed;
105 String aCornerText; // nur bei bColByName && bRowByName
107 public:
108 ScConsData();
109 ~ScConsData();
111 void SetSize( SCCOL nCols, SCROW nRows );
112 void SetFlags( ScSubTotalFunc eFunc, BOOL bColName, BOOL bRowName, BOOL bRef );
114 void InitData(BOOL bDelete=TRUE);
115 void DeleteData();
117 void AddFields( ScDocument* pSrcDoc, SCTAB nTab,
118 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
119 void DoneFields();
121 void AddData( ScDocument* pSrcDoc, SCTAB nTab,
122 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
123 void AddName( const String& rName );
125 void OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, SCTAB nTab );
127 void GetSize( SCCOL& rCols, SCROW& rRows ) const;
128 SCROW GetInsertCount() const;
132 #endif