xref: /aoo41x/main/sc/inc/rechead.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef SC_RECHEAD_HXX
29*cdf0e10cSrcweir #define SC_RECHEAD_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <tools/stream.hxx>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir //		ID's fuer Dateien:
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #define SCID_SIZES			0x4200
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #define SCID_POOLS			0x4210
38*cdf0e10cSrcweir #define SCID_DOCPOOL		0x4211
39*cdf0e10cSrcweir #define SCID_STYLEPOOL		0x4212
40*cdf0e10cSrcweir #define SCID_NEWPOOLS		0x4213		// ID fuer SC 3.0a
41*cdf0e10cSrcweir #define SCID_EDITPOOL		0x4214
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir #define SCID_DOCUMENT		0x4220
44*cdf0e10cSrcweir #define SCID_DOCFLAGS		0x4221
45*cdf0e10cSrcweir #define SCID_TABLE			0x4222
46*cdf0e10cSrcweir #define SCID_DRAWING		0x4223
47*cdf0e10cSrcweir #define SCID_RANGENAME		0x4224
48*cdf0e10cSrcweir #define SCID_DBAREAS		0x4225
49*cdf0e10cSrcweir #define SCID_PIVOT			0x4226
50*cdf0e10cSrcweir #define SCID_CHARTS			0x4227
51*cdf0e10cSrcweir #define SCID_NUMFORMAT		0x4228
52*cdf0e10cSrcweir #define SCID_DOCOPTIONS		0x4229
53*cdf0e10cSrcweir #define SCID_VIEWOPTIONS	0x422a
54*cdf0e10cSrcweir #define SCID_PRINTSETUP		0x422b
55*cdf0e10cSrcweir #define SCID_CHARSET		0x422c
56*cdf0e10cSrcweir #define SCID_NEWDOCUMENT	0x422d		// ID fuer SC 3.0a
57*cdf0e10cSrcweir #define SCID_DDELINKS		0x422e
58*cdf0e10cSrcweir #define SCID_AREALINKS		0x422f
59*cdf0e10cSrcweir #define SCID_CONDFORMATS	0x4230
60*cdf0e10cSrcweir #define SCID_VALIDATION		0x4231
61*cdf0e10cSrcweir #define SCID_COLNAMERANGES	0x4232
62*cdf0e10cSrcweir #define SCID_ROWNAMERANGES	0x4233
63*cdf0e10cSrcweir #define SCID_DETOPLIST		0x4234
64*cdf0e10cSrcweir #define SCID_CONSOLIDATA	0x4235
65*cdf0e10cSrcweir #define SCID_CHANGETRACK	0x4236
66*cdf0e10cSrcweir #define SCID_CHGVIEWSET		0x4237
67*cdf0e10cSrcweir #define SCID_LINKUPMODE		0x4238
68*cdf0e10cSrcweir #define SCID_DATAPILOT		0x4239
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir #define SCID_COLUMNS		0x4240
71*cdf0e10cSrcweir #define SCID_COLROWFLAGS	0x4241
72*cdf0e10cSrcweir #define SCID_TABOPTIONS		0x4242
73*cdf0e10cSrcweir #define SCID_TABLINK		0x4243
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir #define SCID_COLDATA		0x4250
76*cdf0e10cSrcweir #define SCID_COLNOTES		0x4251
77*cdf0e10cSrcweir #define SCID_COLATTRIB		0x4252
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir #define SCID_DRAWPOOL		0x4260
80*cdf0e10cSrcweir #define SCID_DRAWMODEL		0x4261
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir //	Dateiversion
85*cdf0e10cSrcweir //	Falls das obere Byte inkrementiert wird, wird das Doc von
86*cdf0e10cSrcweir // 	aelteren SCs nicht mehr geladen!
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir #define	SC_INITIAL_VERSION	0x0001
89*cdf0e10cSrcweir #define	SC_FORMULA_LCLVER	0x0002			// Formalen mit lokaler VerNr
90*cdf0e10cSrcweir //--------------------------------
91*cdf0e10cSrcweir #define	SC_NEW_TOKEN_ARRAYS	0x0003			// neues TokenArray-Format
92*cdf0e10cSrcweir #define	SC_FORMULA_VALUES	0x0004			// Werte in Formelzellen
93*cdf0e10cSrcweir #define	SC_FORMULA_VALUES2	0x0005			// Werte in Formelzellen
94*cdf0e10cSrcweir #define	SC_DATABYTES		0x0006			// Datenbytes, kleine Tables
95*cdf0e10cSrcweir #define	SC_DATABYTES2   	0x0007			// Datenbytes, kleine Tables
96*cdf0e10cSrcweir #define	SC_NUMFMT		   	0x0008			// Zahlenformat an Formelzelle
97*cdf0e10cSrcweir #define	SC_NEWIF		   	0x0009			// neue Codierung von ocIf (komp.)
98*cdf0e10cSrcweir //--------------------------------
99*cdf0e10cSrcweir #define SC_RELATIVE_REFS	0x0010			// relative Referenzen
100*cdf0e10cSrcweir #define SC_SUBTOTAL_FLAG	0x0011			// bSubTotal der Formelzelle
101*cdf0e10cSrcweir #define SC_COLROWNAME_RANGEPAIR 0x0012		// ColRowNameRanges als ScRangePair
102*cdf0e10cSrcweir //--------------------------------
103*cdf0e10cSrcweir #define SC_31_EXPORT_VER	0x0012			// Version bei 3.1-Export
104*cdf0e10cSrcweir //-------------------------------- ab 4.0
105*cdf0e10cSrcweir #define SC_32K_ROWS			0x0100			// 32000 Zeilen - inkompatibel
106*cdf0e10cSrcweir #define SC_FONTCHARSET		0x0101			// Font-CharSets muessen stimmen
107*cdf0e10cSrcweir //--------------------------------
108*cdf0e10cSrcweir #define SC_40_EXPORT_VER	0x0101			// Version bei 4.0-Export
109*cdf0e10cSrcweir //-------------------------------- ab 5.0
110*cdf0e10cSrcweir #define SC_RECALC_MODE_BITS	0x0201			// TokenArray RecalcMode
111*cdf0e10cSrcweir #define SC_MATRIX_DOUBLEREF	0x0202			// DoubleRef implizite Schnittmenge
112*cdf0e10cSrcweir #define SC_VERSION_EDITPOOL	0x0203			// EditCells mit EditPool
113*cdf0e10cSrcweir #define SC_SUBTOTAL_BUGFIX	0x0204			// bSubTotal der Formelzelle wirklich
114*cdf0e10cSrcweir //-------------------------------- ab 5.2
115*cdf0e10cSrcweir #define SC_CONVERT_RECALC_ON_LOAD 0x0205	// #73616# CONVERT function recalculated on each load
116*cdf0e10cSrcweir //--------------------------------
117*cdf0e10cSrcweir #define SC_CURRENT_VERSION	0x0205
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir //	alles ueber SC_31_EXPORT_VER muss auch beim Speichern abgefragt werden,
121*cdf0e10cSrcweir //	weil 3.1-Export diese Versionsnummer schreibt.
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir // btw: 10 nach 09 ist kein Zaehlfehler sondern eine absichtliche Luecke,
124*cdf0e10cSrcweir // weil nicht klar war, wie lange die RelRefs Entwicklung dauern wuerde.. :)
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir class SvStream;
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir // -----------------------------------------------------------------------
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 		//	Header mit Groessenangaben fuer mehrere Objekte
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir class ScMultipleReadHeader
133*cdf0e10cSrcweir {
134*cdf0e10cSrcweir private:
135*cdf0e10cSrcweir 	SvStream&		rStream;
136*cdf0e10cSrcweir 	sal_uInt8*			pBuf;
137*cdf0e10cSrcweir 	SvMemoryStream*	pMemStream;
138*cdf0e10cSrcweir 	sal_uLong			nEndPos;
139*cdf0e10cSrcweir 	sal_uLong			nEntryEnd;
140*cdf0e10cSrcweir 	sal_uLong			nTotalEnd;
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir public:
143*cdf0e10cSrcweir 	ScMultipleReadHeader(SvStream& rNewStream);
144*cdf0e10cSrcweir 	~ScMultipleReadHeader();
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir 	void	StartEntry();
147*cdf0e10cSrcweir 	void	EndEntry();
148*cdf0e10cSrcweir 	sal_uLong	BytesLeft() const;
149*cdf0e10cSrcweir };
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir class ScMultipleWriteHeader
152*cdf0e10cSrcweir {
153*cdf0e10cSrcweir private:
154*cdf0e10cSrcweir 	SvStream&		rStream;
155*cdf0e10cSrcweir 	SvMemoryStream	aMemStream;
156*cdf0e10cSrcweir 	sal_uLong			nDataPos;
157*cdf0e10cSrcweir 	sal_uInt32		nDataSize;
158*cdf0e10cSrcweir 	sal_uLong			nEntryStart;
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir public:
161*cdf0e10cSrcweir 	ScMultipleWriteHeader(SvStream& rNewStream, sal_uInt32 nDefault = 0);
162*cdf0e10cSrcweir 	~ScMultipleWriteHeader();
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir 	void	StartEntry();
165*cdf0e10cSrcweir 	void	EndEntry();
166*cdf0e10cSrcweir };
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir #endif
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir 
171