xref: /aoo4110/main/sc/source/filter/inc/scflt.hxx (revision b1cdbd2c)
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_SCFLT_HXX
25 #define SC_SCFLT_HXX
26 
27 #include "viewopti.hxx"
28 #include "collect.hxx"
29 #include <tools/solar.h>
30 
31 // FehlerNummern
32 #define errUnknownFormat	1
33 #define errUnknownID		2
34 #define errOutOfMemory		3
35 
36 // Identifiers im FileFormat
37 #define ColWidthID			1
38 #define ColAttrID			2
39 #define RowHeightID			3
40 #define RowAttrID			4
41 #define FontID				5
42 #define NameID				6
43 #define TableID				7
44 #define ObjectID			8
45 #define PatternID			9
46 #define DataBaseID			10
47 
48 // Zeilen/Spalten Flags
49 #define crfSoftBreak		1
50 #define crfHardBreak		2
51 #define crfHidden			4
52 
53 // Zelltypen
54 #define ctValue				1
55 #define ctString			2
56 #define ctFormula			3
57 #define ctNote				4
58 
59 // FontStyles
60 #define ffDontCare			0x00
61 #define ffRoman				0x10
62 #define ffSwiss				0x20
63 #define ffModern			0x30
64 #define ffScript			0x40
65 #define ffDecorative		0x50
66 
67 // FontWeight
68 #define fwNormal			400
69 
70 // FontAttribute
71 #define atNone				0
72 #define atBold				1
73 #define atItalic			2
74 #define atUnderline			4
75 #define atStrikeOut			8
76 
77 // Horizontale Ausrichtung
78 #define hjNone				0
79 #define hjLeft				1
80 #define hjCenter			2
81 #define hjRight				3
82 
83 // Vertikale Ausrichtung
84 #define vjNone				0
85 #define vjTop				1
86 #define vjCenter			2
87 #define vjBottom			3
88 
89 // AusrichtungsFlags
90 #define ojWordBreak			0x01
91 #define ojBottomTop			0x02
92 #define ojTopBottom			0x04
93 
94 // ZellRaster
95 #define raNone				0
96 #define raGray12			1
97 #define raGray25			2
98 #define raGray50			3
99 #define raGray75			4
100 #define raGray100			5
101 
102 // Zellschutz
103 #define paProtect			1
104 #define paHideFormula		2
105 #define paHideAll			4
106 #define paHidePrint			8
107 
108 // ZahlenFormatFlags
109 #define vfStandard			0
110 #define vfMoney				1
111 #define vfThousend			2
112 #define vfPercent			3
113 #define vfExponent			4
114 #define vfZerro				5
115 #define vfDate				6
116 #define vfTime				7
117 #define vfBoolean			8
118 #define vfStandardRed		9
119 #define vfMoneyRed			10
120 #define vfThousendRed		11
121 #define vfPercentRed		12
122 #define vfExponentRed		13
123 #define vfFormula			14
124 #define vfString			15
125 #define vfNone				16
126 
127 // DatumsFormatFlags
128 #define df_NDMY_Long		0
129 #define df_DMY_Long			1
130 #define df_MY_Long			2
131 #define df_NDM_Long			3
132 #define df_DM_Long			4
133 #define df_M_Long			5
134 #define df_NDMY_Short		6
135 #define df_DMY_Short		7
136 #define df_MY_Short			8
137 #define df_NDM_Short		9
138 #define df_DM_Short			10
139 #define df_M_Short			11
140 #define df_Q_Long			12
141 #define df_Q_Short			13
142 
143 // ZeitFormatFlags
144 #define tf_HMS_Long			0
145 #define tf_HM_Long			1
146 #define tf_HMS_Short		2
147 #define tf_HM_Short			3
148 
149 // Attribute fuer FormatVorlage
150 #define pfValue				0x01
151 #define pfFont				0x02
152 #define pfJustify			0x04
153 #define pfFrame				0x08
154 #define pfRaster			0x10
155 #define pfProtection		0x20
156 
157 // Displayflags fuer die Tabelle
158 #define dfFormula			0x0001		// Formeln
159 #define dfZerro				0x0002		// Nullwerte
160 #define dfGrid				0x0004		// Gitternetz
161 #define dfPageBreak			0x0008		// Seitenumbruch
162 #define dfColRowBar         0x0010      // Zeilen/Spalten Koepfe (Dummy)
163 #define dfSyntax			0x0020		// Syntax Highlighting
164 #define dfPrintPage			0x0040		// Druckbildansicht (Dummy)
165 #define dfObjectAll			0x0080		// Objekte anzeigen
166 #define dfObjectFrame		0x0100		// Objekte als Platzhalter
167 #define dfObjectNone		0x0200		// Objekte nicht anzeigen
168 #define dfNoteMark			0x0400		// Notizanzeiger
169 #define dfProtectMark		0x0800		// Schutzanzeiger
170 
171 // Objekt Typen
172 #define otNone				0			// s.u.
173 #define otOle				1
174 #define otImage				2
175 #define otChart				3
176 
177 // Grafik Typen
178 #define gtNone				0			// Kann nicht vorkommen
179 #define gtOle				1			// Ole 1.0 Objekt
180 #define gtImage				2			// Image (Bitmap oder Metafile)
181 #define gtChart				3			// Chart
182 
183 // Datum/Uhrzeit
184 struct Sc10DateTime
185 {
186 	sal_uInt16		Year;
187 	sal_uInt16		Month;
188 	sal_uInt16		Day;
189 	sal_uInt16		Hour;
190 	sal_uInt16		Min;
191 	sal_uInt16		Sec;
192 };
193 
194 // ZahlenFormate
195 struct Sc10ValueFormat
196 {
197 	sal_uInt8		Format;			// Zahl, Waehrung, Prozent etc.
198 	sal_uInt8		Info;			// Anzahl Nachkommastellen, Anzahl Stellen, bzw. Datums/Zeitformat
199 };
200 
201 // Fontbeschreibung
202 struct Sc10LogFont
203 {
204 	sal_Int16		lfHeight;
205 	sal_Int16		lfWidth;
206 	sal_Int16		lfEscapement;
207 	sal_Int16		lfOrientation;
208 	sal_Int16		lfWeight;
209 	sal_uInt8		lfItalic;
210 	sal_uInt8		lfUnderline;
211 	sal_uInt8		lfStrikeOut;
212 	sal_uInt8		lfCharSet;
213 	sal_uInt8		lfOutPrecision;
214 	sal_uInt8		lfClipPrecision;
215 	sal_uInt8		lfQuality;
216 	sal_uInt8		lfPitchAndFamily;
217 	sal_Char	lfFaceName[32];
218 
219 	int operator==( const Sc10LogFont& rData ) const;
220 };
221 
222 // RGB-Frabwerte
223 struct Sc10Color
224 {
225 	sal_uInt8		Dummy;
226 	sal_uInt8		Blue;
227 	sal_uInt8		Green;
228 	sal_uInt8		Red;
229 	int operator==( const Sc10Color& rColor ) const;
230 };
231 
232 // Blockbeschreibung
233 struct Sc10BlockRect
234 {
235 	sal_Int16		x1;
236 	sal_Int16		y1;
237 	sal_Int16		x2;
238 	sal_Int16		y2;
239 };
240 
241 // Datenbank-Bereich
242 struct Sc10DataBaseRec
243 {
244 	sal_Char		Name[32];
245 	sal_Int16			Tab;
246 	Sc10BlockRect	Block;
247 	sal_uInt8			RowHeader;
248 	sal_Int16			SortField0;
249 	sal_uInt8			SortUpOrder0;
250 	sal_Int16			SortField1;
251 	sal_uInt8			SortUpOrder1;
252 	sal_Int16			SortField2;
253 	sal_uInt8			SortUpOrder2;
254 	sal_uInt8			IncludeFormat;
255 	sal_Int16			QueryField0;
256 	sal_Int16			QueryOp0;
257 	sal_uInt8			QueryByString0;
258 	sal_Char		QueryString0[64];
259 	double			QueryValue0;
260 	sal_Int16			QueryConnect1;
261 	sal_Int16			QueryField1;
262 	sal_Int16			QueryOp1;
263 	sal_uInt8			QueryByString1;
264 	sal_Char		QueryString1[64];
265 	double   		QueryValue1;
266 	sal_Int16			QueryConnect2;
267 	sal_Int16			QueryField2;
268 	sal_Int16			QueryOp2;
269 	sal_uInt8			QueryByString2;
270 	sal_Char		QueryString2[64];
271 	double   		QueryValue2;
272 };
273 
274 // Kopf/Fusszeilen-Beschreibung
275 struct Sc10HeadFootLine
276 {
277 	sal_Char		Title[128];
278 	Sc10LogFont		LogFont;
279 	sal_uInt8			HorJustify;
280 	sal_uInt8			VerJustify;
281 	sal_uInt16			Raster;
282 	sal_uInt16			Frame;
283 	Sc10Color		TextColor;
284 	Sc10Color		BackColor;
285 	Sc10Color		RasterColor;
286 	sal_uInt16			FrameColor; // Nibble Codierte Farben link oben rechts unten
287 	sal_uInt16			Reserved;
288 
289 	int operator==( const Sc10HeadFootLine& rData ) const;
290 };
291 
292 // Seitenformat
293 struct Sc10PageFormat
294 {
295 	Sc10HeadFootLine	HeadLine;
296 	Sc10HeadFootLine	FootLine;
297 	sal_Int16				Orientation;
298 	sal_Int16				Width;
299 	sal_Int16				Height;
300 	sal_Int16				NonPrintableX;
301 	sal_Int16				NonPrintableY;
302 	sal_Int16				Left;
303 	sal_Int16				Top;
304 	sal_Int16				Right;
305 	sal_Int16				Bottom;
306 	sal_Int16				Head;
307 	sal_Int16				Foot;
308 	sal_uInt8				HorCenter;
309 	sal_uInt8				VerCenter;
310 	sal_uInt8				PrintGrid;
311 	sal_uInt8				PrintColRow;
312 	sal_uInt8				PrintNote;
313 	sal_uInt8				TopBottomDir;
314 	sal_Char			PrintAreaName[32];
315 	Sc10BlockRect		PrintArea;
316 	sal_Char			PrnZoom[6]; // Pascal 6 Byte Realzahl
317 	sal_uInt16				FirstPageNo;
318 	sal_Int16				RowRepeatStart;
319 	sal_Int16				RowRepeatEnd;
320 	sal_Int16				ColRepeatStart;
321 	sal_Int16				ColRepeatEnd;
322 	sal_Char			Reserved[26];
323 
324 	int operator==( const Sc10PageFormat& rData ) const;
325 };
326 
327 // Tabellenschutz
328 struct Sc10TableProtect
329 {
330 	sal_Char	PassWord[16];
331 	sal_uInt16		Flags;
332 	sal_uInt8		Protect;
333 };
334 
335 // Documentschutz
336 struct Sc10SheetProtect
337 {
338 	sal_Char	PassWord[16];
339 	sal_uInt16		Flags;
340 	sal_uInt8		Protect;
341 };
342 
343 // Dateikopf StarCalc 1.0 Datei
344 struct Sc10FileHeader
345 {
346 	sal_Char	CopyRight[30];
347 	sal_uInt16		Version;
348 	sal_Char	Reserved[32];
349 };
350 
351 // Benutzer-Definierte Datei-Beschreibung
352 struct Sc10FileInfo
353 {
354 	sal_Char		Title[64];
355 	sal_Char		Thema[64];
356 	sal_Char		Keys[64];
357 	sal_Char		Note[256];
358 	sal_Char		InfoLabel0[16];
359 	sal_Char		InfoLabel1[16];
360 	sal_Char		InfoLabel2[16];
361 	sal_Char		InfoLabel3[16];
362 	sal_Char		Info0[32];
363 	sal_Char		Info1[32];
364 	sal_Char		Info2[32];
365 	sal_Char		Info3[32];
366 	sal_Char		CreateAuthor[64];
367 	sal_Char		ChangeAuthor[64];
368 	sal_Char		PrintAuthor[64];
369 	Sc10DateTime	CreateDate;
370 	Sc10DateTime	ChangeDate;
371 	Sc10DateTime	PrintDate;
372 	sal_uInt32		PageCount;
373 	sal_uInt32		ChartCount;
374 	sal_uInt32		PictureCount;
375 	sal_uInt32		GraphCount;
376 	sal_uInt32		OleCount;
377 	sal_uInt32		NoteCount;
378 	sal_uInt32		TextCellCount;
379 	sal_uInt32		ValueCellCount;
380 	sal_uInt32		FormulaCellCount;
381 	sal_uInt32		CellCount;
382 	sal_Char		Reserved[52];
383 };
384 
385 // Letze Cursorposition
386 struct Sc10EditStateInfo
387 {
388 	// Cursor Position
389 	sal_uInt16		CarretX;
390 	sal_uInt16		CarretY;
391 	sal_uInt16		CarretZ;
392 	// Linke obere Ecke der Tabelle im Fenster
393 	sal_uInt16		DeltaX;
394 	sal_uInt16		DeltaY;
395 	sal_uInt16		DeltaZ;
396 	// Ueberfluessig in StarCalc 3.0
397 	sal_uInt8		DataBaseMode;
398 	sal_Char	Reserved[51];
399 };
400 
401 // Attribut-Eintrag
402 struct Sc10ColData
403 {
404 	sal_uInt16		Row;
405 	sal_uInt16		Value;
406 };
407 
408 // ZellAttribut-Beschreibung
409 struct Sc10ColAttr
410 {
411 	sal_uInt16			Count;
412 	Sc10ColData*	pData;
413 
Sc10ColAttrSc10ColAttr414 	Sc10ColAttr() : pData(NULL) {}
~Sc10ColAttrSc10ColAttr415     ~Sc10ColAttr() { delete [] pData; }
416 };
417 
418 // GraphHeader
419 struct Sc10GraphHeader
420 {
421 	sal_uInt8		Typ;			// Typ der Grafik (Ole-Objekt, Image (Bitmap oder MetaFile), Chart-Object)
422 	sal_Int16		CarretX;		// ZellPosition der Grafik
423 	sal_Int16		CarretY;
424 	sal_Int16		CarretZ;
425 	sal_Int32		x;				// x,y Abstand zum Zellrand in Pixel (Pixel weil ich Grafiken in Fenstern ablege)
426 	sal_Int32		y;
427 	sal_Int32		w;				// w,h Breite und Hoehe in Pixel
428 	sal_Int32		h;
429 	sal_uInt8		IsRelPos;		// Ist die Position relativ zur Zelle oder absolute in der Tabelle
430 	sal_uInt8		DoPrint;		// Soll die Grafik ausgedruckt werden
431 	sal_uInt16		FrameType;		// Art der Umrandung um die Grafik (Keine, Einfach, Doppelt, Einfach Dick, Doppelt Dick)
432 	sal_uInt8		IsTransparent;	// Soll der Hintergrund gezeichnet werden
433 	Sc10Color	FrameColor;		// Umrandungsfarbe als RGB-Wert
434 	Sc10Color	BackColor;		// Hintergrundfarbe als RGB-Wert
435 	sal_Char	Reserved[32];	// Na was wohl
436 };
437 
438 // ImageHeader
439 struct Sc10ImageHeader
440 {
441     sal_Char    FileName[128];  // Dateiname des urspruenglich eingefuegten Bildes
442 	sal_Int16	Typ;				// Typ der Grafik (Bitmap oder Metafile)
443 	sal_uInt8	Linked;				// Kann nicht vorkommen
444 	sal_Int16	x1;					// Urspruengliche Groesse der Grafik (nur fuer Metafiles)
445 	sal_Int16	y1;
446 	sal_Int16	x2;
447 	sal_Int16	y2;
448 	sal_uInt32 Size;				// Groesse der Grafik in BYTES
449 };
450 
451 // ChartHeader
452 struct Sc10ChartHeader
453 {
454 	sal_Int16	MM;					// Meatfile Struktur MapMode, Breite, Hoehe
455 	sal_Int16	xExt;
456 	sal_Int16	yExt;
457 	sal_uInt32 Size;				// Groesse der Grafik in BYTES
458 };
459 
460 // ChartSheetData
461 struct Sc10ChartSheetData
462 {
463 	sal_uInt8		HasTitle;		// Hat das Chart Daten aus der Tabell fuer einen Titel
464 	sal_Int16		TitleX;			// Zellposition des Titels
465 	sal_Int16		TitleY;
466 	sal_uInt8		HasSubTitle;	// Hat das Chart Daten aus der Tabell fuer einen Untertitel
467 	sal_Int16		SubTitleX;		// Zellposition des Untertitels
468 	sal_Int16		SubTitleY;
469 	sal_uInt8		HasLeftTitle;	// Hat das Chart Daten aus der Tabelle fuer einen Linken-Titel
470 	sal_Int16		LeftTitleX;		// Zellposition des Linken-Titels
471 	sal_Int16		LeftTitleY;
472 	sal_uInt8		HasLegend;		// Hat das Chart Daten aus der Tabelle fuer eine Legende
473 	sal_Int16		LegendX1;		// Zellen der Legende
474 	sal_Int16		LegendY1;
475 	sal_Int16		LegendX2;
476 	sal_Int16		LegendY2;
477 	sal_uInt8		HasLabel;		// Hat das Chart Daten aus der Tabelle fuer die Achsbeschriftung
478 	sal_Int16		LabelX1;		// Zellen der Achsbeschriftung
479 	sal_Int16		LabelY1;
480 	sal_Int16		LabelX2;
481 	sal_Int16		LabelY2;
482 	sal_Int16		DataX1;			// Zellen der Daten
483 	sal_Int16		DataY1;
484 	sal_Int16		DataX2;
485 	sal_Int16		DataY2;
486 	sal_Char	Reserved[64];
487 };
488 
489 #define AGPie2D		1			// Pie Chart 2D
490 #define AGPie3D		2			// Pie Chart 3D
491 #define AGBar2D		3			// Bar Chart 2D
492 #define AGBar3D		4			// Bar Chart 3D
493 #define AGGantt		5			// Gantt Diagramm
494 #define AGLine		6			// Line Chart
495 #define AGLogLine	7			// Logarythmic-Coordinate Chart
496 #define AGArea		8			// Area Chart
497 #define AGHLC		11			// High-Low-Close Chart
498 #define AGPolar		10			// Polar-Coordinate Chart
499 
500 typedef sal_Char Sc10ChartText[30];
501 
502 struct Sc10ChartTypeData
503 {
504 	sal_Int16			NumSets;
505 	sal_Int16			NumPoints;
506 	sal_Int16			DrawMode;
507 	sal_Int16			GraphType;
508 	sal_Int16			GraphStyle;
509 	sal_Char		GraphTitle[80];
510 	sal_Char		BottomTitle[80];
511 	sal_Int16			SymbolData[256];
512 	sal_Int16			ColorData[256];
513 	sal_Int16			ThickLines[256];
514 	sal_Int16			PatternData[256];
515 	sal_Int16			LinePatternData[256];
516 	sal_Int16			NumGraphStyles[11];
517 	sal_Int16			ShowLegend;
518 	Sc10ChartText	LegendText[256];
519 	sal_Int16			ExplodePie;
520 	sal_Int16			FontUse;
521 	sal_Int16			FontFamily[5];
522 	sal_Int16			FontStyle[5];
523 	sal_Int16			FontSize[5];
524 	sal_Int16			GridStyle;
525 	sal_Int16			Labels;
526 	sal_Int16			LabelEvery;
527 	Sc10ChartText	LabelText[50];
528 	sal_Char		LeftTitle[80];
529 	sal_Char		Reserved[4646];
530 };
531 
532 
533 // FontAttribut
534 class Sc10FontData : public ScDataObject
535 {
536 public:
537 	sal_Int16				Height;
538 	sal_uInt8				CharSet;
539 	sal_uInt8				PitchAndFamily;
540 	sal_Char			FaceName[32];
541 
Sc10FontData(const Sc10FontData & rData)542 						Sc10FontData( const Sc10FontData& rData ) :
543                             ScDataObject( rData ),
544 							Height( rData.Height ),
545 							CharSet( rData.CharSet ),
546 							PitchAndFamily( rData.PitchAndFamily )
547                                 {
548                                     strncpy( FaceName, rData.FaceName, sizeof(FaceName) );
549                                     FaceName[sizeof(FaceName)-1] = 0;
550                                 }
551 						Sc10FontData( SvStream& rStream );
Clone() const552 	virtual ScDataObject*	Clone() const { return new Sc10FontData(*this); }
553 };
554 
555 
556 // Font-Collection
557 class Sc10FontCollection : public ScCollection
558 {
559 protected:
560 	sal_uLong nError;
561 public:
562 						Sc10FontCollection( SvStream& rStream );
GetError()563 	sal_uLong				GetError() { return nError; }
At(sal_uInt16 nIndex)564 	Sc10FontData*		At(sal_uInt16 nIndex) { return (Sc10FontData*)ScCollection::At(nIndex); }
565 private:
566     using               ScCollection::At;
567 };
568 
569 
570 //BereichsDaten
571 class Sc10NameData : public ScDataObject
572 {
573 public :
574 	sal_Char			Name[32];
575 	sal_Char			Reference[64];
576 	sal_Char			Reserved[12];
577 
Sc10NameData(const Sc10NameData & rData)578                         Sc10NameData(const Sc10NameData& rData) :
579                             ScDataObject( rData )
580 						{
581 							strncpy(Name, rData.Name, sizeof(Name));
582                             Name[sizeof(Name)-1] = 0;
583 							strncpy(Reference, rData.Reference, sizeof(Reference));
584                             Reference[sizeof(Reference)-1] = 0;
585 							memcpy(Reserved, rData.Reserved, sizeof(Reserved));
586 						}
587 						Sc10NameData(SvStream& rStream);
Clone() const588 	virtual ScDataObject*	Clone() const { return new Sc10NameData(*this); }
589 };
590 
591 
592 // Bereichs-Collection
593 class Sc10NameCollection : public ScCollection
594 {
595 protected:
596 	sal_uLong				nError;
597 public:
598 						Sc10NameCollection(SvStream& rStream);
GetError()599 sal_uLong					GetError() { return nError; }
At(sal_uInt16 nIndex)600 Sc10NameData*			At(sal_uInt16 nIndex) { return (Sc10NameData*)ScCollection::At(nIndex); }
601 private:
602     using               ScCollection::At;
603 };
604 
605 
606 // Vorlage-Daten
607 class Sc10PatternData : public ScDataObject
608 {
609 public:
610 	sal_Char			Name[32];
611 	Sc10ValueFormat		ValueFormat;
612 	Sc10LogFont			LogFont;
613 	sal_uInt16				Attr;
614 	sal_uInt16				Justify;
615 	sal_uInt16				Frame;
616 	sal_uInt16				Raster;
617 	sal_uInt16				nColor;
618 	sal_uInt16				FrameColor;
619 	sal_uInt16				Flags;
620 	sal_uInt16				FormatFlags;
621 	sal_Char			Reserved[8];
622 
Sc10PatternData(const Sc10PatternData & rData)623                         Sc10PatternData(const Sc10PatternData& rData) :
624                             ScDataObject( rData )
625 						{
626 							strncpy(Name, rData.Name, sizeof(Name));
627                             Name[sizeof(Name)-1] = 0;
628 							memcpy(&ValueFormat, &rData.ValueFormat, sizeof(ValueFormat));
629 							memcpy(&LogFont, &rData.LogFont, sizeof(LogFont));
630 							Attr = rData.Attr;
631 							Justify = rData.Justify;
632 							Frame = rData.Frame;
633 							Raster = rData.Raster;
634 							nColor = rData.nColor;
635 							FrameColor = rData.FrameColor;
636 							Flags = rData.Flags;
637 							FormatFlags = rData.FormatFlags;
638 							memcpy(Reserved, rData.Reserved, sizeof(Reserved));
639 						}
640 						Sc10PatternData(SvStream& rStream);
Clone() const641 virtual ScDataObject*		Clone() const { return new Sc10PatternData(*this); }
642 };
643 
644 
645 // Vorlage-Collection
646 class Sc10PatternCollection : public ScCollection
647 {
648 protected:
649 	sal_uLong				nError;
650 public:
651 						Sc10PatternCollection(SvStream& rStream);
GetError()652 	sal_uLong				GetError() { return nError; }
At(sal_uInt16 nIndex)653 	Sc10PatternData*	At(sal_uInt16 nIndex) { return (Sc10PatternData*)ScCollection::At(nIndex); }
654 private:
655     using               ScCollection::At;
656 };
657 
658 
659 // DatenBank-Daten
660 class Sc10DataBaseData : public ScDataObject
661 {
662 public:
663 	Sc10DataBaseRec		DataBaseRec;
664 
Sc10DataBaseData(const Sc10DataBaseData & rData)665                         Sc10DataBaseData(const Sc10DataBaseData& rData) :
666                             ScDataObject( rData )
667 						{
668 							memcpy(&DataBaseRec, &rData.DataBaseRec, sizeof(DataBaseRec));
669 						}
670 						Sc10DataBaseData(SvStream& rStream);
Clone() const671 virtual ScDataObject*		Clone() const { return new Sc10DataBaseData(*this); }
672 };
673 
674 
675 // DatenBank-Collection
676 class Sc10DataBaseCollection : public ScCollection
677 {
678 protected:
679 	sal_uLong				nError;
680 	sal_Char			ActName[32];
681 public:
682 						Sc10DataBaseCollection(SvStream& rStream);
GetError()683 	sal_uLong				GetError() { return nError; }
At(sal_uInt16 nIndex)684 	Sc10DataBaseData*	At(sal_uInt16 nIndex) { return (Sc10DataBaseData*)ScCollection::At(nIndex); }
685 private:
686     using               ScCollection::At;
687 };
688 
689 
690 class Sc10PageData : public ScDataObject
691 {
692 public:
693 	Sc10PageFormat		aPageFormat;
Sc10PageData(const Sc10PageFormat & rFormat)694 						Sc10PageData( const Sc10PageFormat& rFormat ) : aPageFormat(rFormat) {}
operator ==(const Sc10PageData & rData) const695 	int					operator==( const Sc10PageData& rData ) const
696 							{ return aPageFormat == rData.aPageFormat; }
697 	virtual ScDataObject*	Clone() const;
698 };
699 
700 // Seitenformat-Collection
701 class Sc10PageCollection : public ScCollection
702 {
703 public:
Sc10PageCollection()704 						Sc10PageCollection() : ScCollection(1,1) {};
At(sal_uInt16 nIndex)705 	Sc10PageData*		At(sal_uInt16 nIndex) { return (Sc10PageData*)ScCollection::At(nIndex); }
706     sal_uInt16              InsertFormat( const Sc10PageFormat& rData );
707 	void				PutToDoc( ScDocument* pDoc );
708 private:
709     using               ScCollection::At;
710 };
711 
712 
713 class ScfStreamProgressBar;
714 
715 // Import-Klasse
716 class Sc10Import
717 {
718 	SvStream&				rStream;
719 	ScDocument*				pDoc;
720 	Sc10Color				TextPalette[16];
721 	Sc10Color				BackPalette[16];
722 	Sc10Color				RasterPalette[16];
723 	Sc10Color				FramePalette[16];
724 	Sc10SheetProtect		SheetProtect;
725 	Sc10FontCollection*		pFontCollection;
726 	Sc10NameCollection*		pNameCollection;
727 	Sc10PatternCollection*	pPatternCollection;
728 	Sc10DataBaseCollection*	pDataBaseCollection;
729     sal_uLong                   nError;
730 	sal_Int16					TabCount;
731 	SCTAB					nShowTab;
732 	ScViewOptions			aSc30ViewOpt;
733     ScfStreamProgressBar*   pPrgrsBar;
734 
735 public:
736 							  Sc10Import( SvStream& rStr, ScDocument* pDocument );
737 							  ~Sc10Import();
738 
739 	sal_uLong					Import();
740 	void					LoadFileHeader();
741 	void					LoadFileInfo();
742 	void					LoadEditStateInfo();
743 	void					LoadProtect();
744 	void					LoadViewColRowBar();
745 	void					LoadScrZoom();
746 	void					LoadPalette();
747 	void					LoadFontCollection();
748 	void					LoadNameCollection();
749 	void					ImportNameCollection();
750 	void					LoadPatternCollection();
751 	void					LoadDataBaseCollection();
752 	void					LoadTables();
753 	void					LoadCol(SCCOL Col, SCTAB Tab);
754 	void					LoadColAttr(SCCOL Col, SCTAB Tab);
755 	void					LoadAttr(Sc10ColAttr& rAttr);
756 	void					ChangeFormat(sal_uInt16 nFormat, sal_uInt16 nInfo, sal_uLong& nKey);
757 	void					LoadObjects();
758 };
759 
760 #endif
761 
762