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