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