summaryrefslogtreecommitdiff
path: root/sw/source/filter/inc
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2000-09-18 16:15:01 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2000-09-18 16:15:01 +0000
commit7b0b5cdfeed656b279bc32cd929630d5fc25878b (patch)
tree5b89fb8497d7329d26c43f109bb014c54ffb0e8c /sw/source/filter/inc
parentd791366863cf9659a01b171ce0e727bfe2f28cdf (diff)
initial import
Diffstat (limited to 'sw/source/filter/inc')
-rw-r--r--sw/source/filter/inc/fltbase.hxx166
-rw-r--r--sw/source/filter/inc/fltglbls.hxx218
-rw-r--r--sw/source/filter/inc/fltini.hxx219
-rw-r--r--sw/source/filter/inc/fltshell.hxx675
-rw-r--r--sw/source/filter/inc/makefile.mk61
-rw-r--r--sw/source/filter/inc/rtf.hxx168
-rw-r--r--sw/source/filter/inc/wrt_fn.hxx103
-rw-r--r--sw/source/filter/inc/wrtswtbl.hxx375
8 files changed, 1985 insertions, 0 deletions
diff --git a/sw/source/filter/inc/fltbase.hxx b/sw/source/filter/inc/fltbase.hxx
new file mode 100644
index 000000000000..b739718d7b42
--- /dev/null
+++ b/sw/source/filter/inc/fltbase.hxx
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: fltbase.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:14:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef __FLTBASE_HXX__
+#define __FLTBASE_HXX__
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+class SwFilterBase
+{
+protected:
+ SvStream *pIn;
+ sal_Char *pReadBuff; // Groessenangabe
+ INT32 nBytesLeft; // noch zu lesende Bytes des aktuelle Records
+
+ CharSet eQuellChar; // Quell-Zeichensatz (interner Zeichensatz)
+// CharSet eZielChar; // Ziel-Zeichensatz
+
+ USHORT nTab; // z.Zt. bearbeitete Tabelle
+ USHORT nReadBuffSize;// temporaerer Lesepuffer mit
+
+ // ----------------------------------------------------------
+ inline void ReadChar( char &rC );
+ inline void ReadByte( BYTE &rN );
+ inline void Read( short &rN );
+ inline void ReadUnicode( sal_Unicode &rU );
+ inline void Read( BYTE &rN0, USHORT &rN1, USHORT &rN2 );
+ inline void Read( USHORT &rN );
+ inline void Read( USHORT &rN1, USHORT &rN2 );
+ inline void Read( USHORT &rN1, USHORT &rN2, USHORT &rN3, USHORT &rN4 );
+ inline void Read( double &rF );
+ void Read( String &rS ); // liest 0-terminierten C-String!
+ inline void ClearBytesLeft( void );
+};
+
+
+inline void SwFilterBase::ReadChar( char &rC )
+ {
+ *pIn >> rC;
+ nBytesLeft--;
+ }
+
+inline void SwFilterBase::ReadByte( BYTE &rN )
+ {
+ *pIn >> rN;
+ nBytesLeft--;
+ }
+
+inline void SwFilterBase::ReadUnicode( sal_Unicode &rU )
+{
+ {
+ sal_Char cC;
+ *pIn >> cC;
+ rU = ByteString::ConvertToUnicode(cC, eQuellChar);
+ nBytesLeft--;
+ }
+}
+
+inline void SwFilterBase::Read( short &rN )
+ {
+ *pIn >> rN;
+ nBytesLeft -= 2;
+ }
+
+inline void SwFilterBase::Read( BYTE &rN0, USHORT &rN1, USHORT &rN2 )
+ {
+ *pIn >> rN0 >> rN1 >> rN2;
+ nBytesLeft -= 5;
+ }
+
+inline void SwFilterBase::Read( USHORT &rN )
+ {
+ *pIn >> rN;
+ nBytesLeft -= 2;
+ }
+
+inline void SwFilterBase::Read( USHORT &rN1, USHORT &rN2 )
+ {
+ *pIn >> rN1 >> rN2;
+ nBytesLeft -= 4;
+ }
+
+inline void SwFilterBase::Read( USHORT &rN1, USHORT &rN2, USHORT &rN3, USHORT &rN4 )
+ {
+ *pIn >> rN1 >> rN2 >> rN3 >> rN4;
+ nBytesLeft -= 8;
+ }
+
+inline void SwFilterBase::Read( double &rF )
+ {
+ *pIn >> rF;
+ nBytesLeft -= 8;
+ }
+
+inline void SwFilterBase::ClearBytesLeft( void )
+ {
+ pIn->SeekRel( nBytesLeft );
+ nBytesLeft = 0;
+ }
+
+
+#endif
+
diff --git a/sw/source/filter/inc/fltglbls.hxx b/sw/source/filter/inc/fltglbls.hxx
new file mode 100644
index 000000000000..e0d1f2f80dc4
--- /dev/null
+++ b/sw/source/filter/inc/fltglbls.hxx
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * $RCSfile: fltglbls.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:14:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _FLTGLBS_HXX
+#define _FLTGLBS_HXX
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _LANG_HXX //autogen
+#include <tools/lang.hxx>
+#endif
+#ifndef _SVARRAY_HXX //autogen
+#include <svtools/svarray.hxx>
+#endif
+
+
+class SfxPoolItem;
+class SwDoc;
+class SwPaM;
+class SwTable;
+
+class XF_Buffer;
+class ColorBuffer;
+class FontBuffer;
+class SvNumberFormatter;
+
+
+class ExcGlob;
+extern ExcGlob *pExcGlob;
+
+class LotGlob;
+extern LotGlob *pLotGlob;
+
+// ----- Basis-Klasse ----------------------------------------------------
+class FilterGlobals
+{
+protected:
+ SvPtrarr aTblFmts;
+ USHORT nColStart;
+ USHORT nColEnd;
+ USHORT nRowStart;
+ USHORT nRowEnd;
+ USHORT nAnzCols;
+ USHORT nAnzRows;
+
+public:
+ FilterGlobals( SwDoc& rDoc, const SwPaM& rPam );
+ ~FilterGlobals();
+
+ SwDoc *pD;
+ SwPaM *pPam;
+ const SwTable *pTable;
+
+ SvNumberFormatter *pNumFormatter;
+ LanguageType eDefLanguage;
+ String aStandard; // fuer Excel-Standard-Format
+ ULONG nStandard;
+ ULONG nDefFormat; // = 0xFFFFFFFF
+
+ void SetRange( USHORT nCS, USHORT nCE, USHORT nRS, USHORT nRE );
+
+ BOOL IsInColRange( USHORT nCol )
+ { return ( nCol >= nColStart && nCol <= nColEnd ); }
+ BOOL IsInRowRange( USHORT nRow )
+ { return ( nRow >= nRowStart && nRow <= nRowEnd ); }
+ BOOL IsInRange( USHORT nCol, USHORT nRow )
+ { return IsInRowRange(nRow) && IsInColRange(nCol); }
+
+ void NormalizeCol( USHORT &rCol ) { rCol -= nColStart; }
+ void NormalizeRow( USHORT &rRow ) { rRow -= nRowStart; }
+ void Normalize( USHORT &rCol, USHORT &rRow )
+ { NormalizeCol( rCol ); NormalizeRow( rRow ); }
+
+ USHORT AnzCols() const { return nAnzCols; }
+ USHORT AnzRows() const { return nAnzRows; }
+
+ BOOL ColRangeLimitter( USHORT &rCS, USHORT &rCE );
+
+ void InsertText( USHORT nCol, USHORT nRow, const String& rStr );
+ void CreateTable();
+ void InsertAttr( const SfxPoolItem& rItem );
+
+ inline void ColLimitter( USHORT &rCol );
+ inline void RowLimitter( USHORT &rRow );
+#ifdef USED
+// inline BOOL RowRangeLimitter( USHORT &rRS, USHORT &rRE );
+#endif
+};
+
+
+
+
+
+// ----- for Excel-Import only -------------------------------------------
+
+enum ExcelRecordTypes { ERT_Biff2, ERT_Biff3, ERT_Biff4, ERT_Biff5 };
+
+class ExcGlob : public FilterGlobals
+{
+public:
+ ExcGlob( SwDoc& rDoc, const SwPaM& rPam );
+ ~ExcGlob();
+
+ XF_Buffer *pXF_Buff;
+ FontBuffer *pFontBuff;
+ ColorBuffer *pColorBuff;
+ ExcelRecordTypes eHauptDateiTyp;
+};
+
+// ----- for Lotus-Import only -------------------------------------------
+class LotGlob : public FilterGlobals
+{
+public:
+ LotGlob( SwDoc& rDoc, const SwPaM& rPam )
+ : FilterGlobals( rDoc, rPam ) {}
+};
+
+
+
+
+inline void FilterGlobals::ColLimitter( USHORT &rCol )
+{
+ if( rCol < nColStart )
+ rCol = nColStart;
+ else if( rCol > nColEnd )
+ rCol = nColEnd;
+}
+
+inline void FilterGlobals::RowLimitter( USHORT &rRow )
+{
+ if( rRow < nRowStart )
+ rRow = nRowStart;
+ else if( rRow > nRowEnd )
+ rRow = nRowEnd;
+}
+
+#ifdef USED
+
+inline BOOL FilterGlobals::RowRangeLimitter( USHORT &rRS, USHORT &rRE )
+ {
+ // PREC / POST: analog zu ColRangeLimitter
+ BOOL bRet;
+ DBG_ASSERT( rRS <= rRE,
+ "-FilterGlobals::RowRangeLimitter(): Startzeile > Endzeile!" );
+ if( rRS > nRowEnd || rRE < nRowStart )
+ bRet = FALSE;
+ else
+ {
+ bRet = TRUE;
+ if( rRS < nRowStart ) rRS = nRowStart;
+ if( rRE > nRowEnd ) rRE = nRowEnd;
+ }
+ return bRet;
+ }
+
+#endif
+
+
+#endif
+
diff --git a/sw/source/filter/inc/fltini.hxx b/sw/source/filter/inc/fltini.hxx
new file mode 100644
index 000000000000..05abeedfe43c
--- /dev/null
+++ b/sw/source/filter/inc/fltini.hxx
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * $RCSfile: fltini.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:14:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _FLTINI_HXX
+#define _FLTINI_HXX
+
+
+#ifndef _SHELLIO_HXX
+#include <shellio.hxx>
+#endif
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
+#endif
+
+class SwNumRuleTbl;
+class SwDoc;
+class SwTxtNode;
+class SwNodeNum;
+class SwNumRule;
+class SwNodeIndex;
+
+
+// die speziellen Reader
+
+class Sw6Reader: public Reader
+{
+ virtual ULONG Read( SwDoc &,SwPaM &,const String &);
+};
+
+class W4WReader: public StgReader
+{
+ String sVersion;
+ USHORT nFilter;
+ BOOL bStorageFlag;
+ virtual ULONG Read(SwDoc &,SwPaM &,const String &);
+ // wir wollen die Streams / Storages nicht geoeffnet haben
+ virtual int SetStrmStgPtr();
+public:
+ W4WReader() : StgReader(), nFilter(0), bStorageFlag(FALSE) {}
+ virtual int GetReaderType();
+ virtual void SetFltName( const String& rFltName );
+
+ USHORT GetFilter() const { return nFilter; }
+ const String& GetVersion() const { return sVersion; }
+};
+
+#ifdef DEBUG_SH
+
+class Internal_W4WReader: public W4WReader
+{
+ virtual ULONG Read(SwDoc &,SwPaM &,const String &);
+};
+
+#endif
+
+class ExcelReader : public StgReader
+{
+ virtual ULONG Read(SwDoc &,SwPaM &,const String &);
+public:
+ virtual int GetReaderType();
+};
+
+class LotusReader : public Reader
+{
+ CharSet eCodeSet;
+ virtual ULONG Read(SwDoc &,SwPaM &,const String &);
+public:
+ virtual void SetFltName( const String& rFltNm );
+};
+
+class HTMLReader: public Reader
+{
+ // wir wollen die Streams / Storages nicht geoeffnet haben
+ virtual int SetStrmStgPtr();
+ virtual ULONG Read(SwDoc &,SwPaM &,const String &);
+public:
+ HTMLReader();
+};
+
+class WW1Reader : public Reader
+{
+ virtual ULONG Read(SwDoc &,SwPaM &,const String &);
+};
+
+class WW8Reader : public StgReader
+{
+ virtual ULONG Read(SwDoc &,SwPaM &,const String &);
+public:
+ virtual int GetReaderType();
+
+ virtual BOOL HasGlossaries() const;
+ virtual BOOL ReadGlossaries( SwTextBlocks&, BOOL bSaveRelFiles ) const;
+};
+
+class XMLReader : public Reader
+{
+ virtual ULONG Read(SwDoc &,SwPaM &,const String &);
+public:
+ XMLReader();
+};
+
+// die speziellen Writer
+
+#if 0
+WriterRef GetW4WWriter( const String& );
+WriterRef GetStgWriter( const String& );
+WriterRef GetWWWriter( const String& );
+WriterRef GetWW8Writer( const String& );
+#if !( defined(PRODUCT) || defined(MAC) || defined(PM2) )
+WriterRef GetDebugWriter( const String& );
+WriterRef GetUndoWriter( const String& );
+#endif
+#else
+void GetW4WWriter( const String&, WriterRef& );
+void GetStgWriter( const String&, WriterRef& );
+void GetWWWriter( const String&, WriterRef& );
+void GetWW8Writer( const String&, WriterRef& );
+#if !( defined(PRODUCT) || defined(MAC) || defined(PM2) )
+void GetDebugWriter( const String&, WriterRef& );
+void GetUndoWriter( const String&, WriterRef& );
+#endif
+#endif
+
+// Zugriff auf die Ini-Datei
+ULONG ReadFilterFlags( const sal_Char* pName, const sal_Char* pAltName = 0 );
+
+// JP 17.03.99 - 63049
+// Umsetzen der LRSpaces im aktuell importierten Doc. Die Fremd-Filter
+// liefern immer absolute Werte fuer die Ebenen einer NumRule. Wir
+// verarbeiten jetzt aber relative Werte bezogen auf das LR-Space-Item.
+// Das hat zur Folge, das bei allen Absaetzen die EInzuege der NumRule vom
+// Absatz-Einzug abgezogen werden muss.
+class SwRelNumRuleSpaces
+{
+ SwNumRuleTbl* pNumRuleTbl; // Liste aller benannten NumRules
+ BOOL bNewDoc;
+
+ void SetNumLSpace( SwTxtNode& rNd, const SwNumRule& rRule );
+
+public:
+ SwRelNumRuleSpaces( SwDoc& rDoc, BOOL bNewDoc );
+ ~SwRelNumRuleSpaces();
+
+ void SetNumRelSpaces( SwDoc& rDoc );
+ void SetOultineRelSpaces( const SwNodeIndex& rStt,
+ const SwNodeIndex& rEnd );
+};
+
+#define SW_SV_BRUSH_25 0
+#define SW_SV_BRUSH_50 1
+#define SW_SV_BRUSH_75 2
+#define SW_SV_BRUSH_NULL 3
+#define SW_SV_BRUSH_SOLID 4
+#define SW_SV_BRUSH_INVALID 5
+
+Color ConvertBrushStyle(const Color& rCol, const Color& rFillCol, BYTE nStyle);
+
+// Get size of fly (if 'automatic' in WW) and check if not too small
+void CalculateFlySize( SfxItemSet& rFlySet, SwNodeIndex& rAnchor,
+ SwTwips nPageWidth );
+
+#endif _FLTINI_HXX
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
new file mode 100644
index 000000000000..7b1379928320
--- /dev/null
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -0,0 +1,675 @@
+/*************************************************************************
+ *
+ * $RCSfile: fltshell.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:14:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _FLTSHELL_HXX
+#define _FLTSHELL_HXX
+
+#ifndef _HINTIDS_HXX
+#include <hintids.hxx>
+#endif
+
+#ifndef _KEYCOD_HXX //autogen
+#include <vcl/keycod.hxx>
+#endif
+#ifndef _DATETIME_HXX //autogen
+#include <tools/datetime.hxx>
+#endif
+#ifndef _SVX_BRKITEM_HXX //autogen
+#include <svx/brkitem.hxx>
+#endif
+
+
+#ifndef _FMTCOL_HXX
+#include <fmtcol.hxx>
+#endif
+#ifndef _DOC_HXX
+#include <doc.hxx>
+#endif
+#ifndef _PAM_HXX
+#include <pam.hxx>
+#endif
+#ifndef _POOLFMT_HXX
+#include <poolfmt.hxx>
+#endif
+#ifndef _FMTORNT_HXX //autogen
+#include <fmtornt.hxx>
+#endif
+#ifndef _FRMATR_HXX
+#include <frmatr.hxx>
+#endif
+
+class SwFlyFrmFmt;
+class SwTOXBase;
+class SwNumRule;
+class SwFltShell;
+class SwFmtFld;
+class SwField;
+class Graphic;
+class SwTableLines;
+class SwTableBoxes;
+class SwTableBox;
+class SwTableLine;
+class International;
+class DateTime;
+
+
+inline void SwFltClearFlag(ULONG& rFieldFlags, int no)
+ { rFieldFlags &= ~(1L << no); }
+
+inline void SwFltSetFlag(ULONG& rFieldFlags, int no)
+ { rFieldFlags |= 1L << no; }
+
+inline BOOL SwFltGetFlag(ULONG nFieldFlags, int no)
+ { return (nFieldFlags & (1L << no)) != 0; }
+
+// Stack-Eintrag fuer die Attribute Es werden immer Pointer auf neue Attribute uebergeben.
+class SwFltStackEntry
+{
+public:
+ SwNodeIndex nMkNode;
+ SwNodeIndex nPtNode;
+ SfxPoolItem * pAttr;// Format Attribute
+ long nHandle; // fuer verschachtelte Attrs, z.B. Bookmarks
+ xub_StrLen nMkCntnt;// Nachbildung von Mark()
+ xub_StrLen nPtCntnt;// Nachbildung von GetPoint()
+
+ BOOL bOld; // to mark Attributes *before* skipping field results
+ BOOL bLocked;
+ BOOL bCopied;
+
+ SwFltStackEntry(const SwPosition & rStartPos, SfxPoolItem* pHt );
+ SwFltStackEntry(const SwFltStackEntry& rEntry);
+ ~SwFltStackEntry();
+
+ void SetStartPos(const SwPosition & rStartPos);
+ void SetEndPos( const SwPosition & rEndPos);
+ BOOL MakeRegion(SwDoc* pDoc, SwPaM& rRegion, BOOL bCheck );
+};
+
+// ein Stack fuer die gesamten Text-Attribute
+typedef SwFltStackEntry* SwFltStackEntryPtr;
+
+SV_DECL_PTRARR(SwFltControlStackEntries,SwFltStackEntryPtr,5,10)
+
+class SwFltControlStack : public SwFltControlStackEntries
+{
+ friend SwFltShell;
+
+ ULONG nFieldFlags;
+ KeyCode aEmptyKeyCode; // fuer Bookmarks
+
+ BOOL IsAttrOpen(USHORT nAttrId);
+
+ void MoveAttrs( const SwPosition& rPos );
+
+protected:
+ SwDoc* pDoc;
+ BOOL bIsEndStack;
+
+ virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pEntry);
+
+public:
+ enum Flags
+ {
+ HYPO,
+ TAGS_DO_ID,
+ TAGS_VISIBLE,
+ BOOK_TO_VAR_REF,
+ BOOK_AND_REF,
+ TAGS_IN_TEXT,
+ ALLOW_FLD_CR,
+ NO_FLD_CR,
+ DONT_HARD_PROTECT
+ };
+
+ SwFltControlStack(SwDoc* pDo, ULONG nFieldFl);
+ ~SwFltControlStack();
+
+ BOOL IsFlagSet(Flags no) const { return ::SwFltGetFlag(nFieldFlags, no);}
+
+ void NewAttr(const SwPosition& rPos, const SfxPoolItem & rAttr );
+// BOOL SetAttr(const SwPosition& rPos, USHORT nAttrId=0, BOOL bTstEnde=TRUE);
+ // SetAttr mit Handle fuer verschachtelte Attrs, z.B. Bookmarks
+ BOOL SetAttr(const SwPosition& rPos, USHORT nAttrId=0, BOOL bTstEnde=TRUE,
+ long nHand = LONG_MAX);
+
+ void StealAttr(const SwPosition* pPos, USHORT nAttrId = 0);
+ void MoveAttrsToNextNode( const SwNodeIndex& rNdIdx );
+ void MarkAllAttrsOld();
+ void KillUnlockedAttrs(const SwPosition& pPos);
+ SfxPoolItem* GetFmtStackAttr(USHORT nWhich, USHORT * pPos = 0);
+ const SfxPoolItem* GetOpenStackAttr(const SwPosition& rPos, USHORT nWhich);
+ const SfxPoolItem* GetFmtAttr(const SwPosition& rPos, USHORT nWhich);
+};
+
+class SwFltAnchor : public SfxPoolItem
+{
+ SwFrmFmt* pFrmFmt;
+public:
+ SwFltAnchor(SwFrmFmt* pFlyFmt);
+ SwFltAnchor(const SwFltAnchor&);
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==(const SfxPoolItem&) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
+ const SwFrmFmt* GetFrmFmt() const { return pFrmFmt; }
+ SwFrmFmt* GetFrmFmt() { return pFrmFmt; }
+};
+
+class SwFltRedline : public SfxPoolItem
+{
+public:
+ DateTime aStamp;
+ DateTime aStampPrev;
+ SwRedlineType eType;
+ SwRedlineType eTypePrev;
+ USHORT nAutorNo;
+ USHORT nAutorNoPrev;
+
+ SwFltRedline(SwRedlineType eType_,
+ USHORT nAutorNo_,
+ const DateTime& rStamp_,
+ SwRedlineType eTypePrev_ = REDLINE_INSERT,
+ USHORT nAutorNoPrev_ = USHRT_MAX,
+ const DateTime* pStampPrev_ = 0)
+ : eType( eType_ ), nAutorNo( nAutorNo_ ), aStamp( rStamp_ ),
+ eTypePrev( eTypePrev_ ), nAutorNoPrev( nAutorNoPrev_ )
+ {
+ if( pStampPrev_ )
+ aStampPrev = *pStampPrev_;
+ }
+
+ SwFltRedline(const SwFltRedline& rCpy):
+ SfxPoolItem(RES_FLTR_REDLINE),
+ eType( rCpy.eType ),
+ nAutorNo( rCpy.nAutorNo ),
+ aStamp( rCpy.aStamp ),
+ eTypePrev( rCpy.eTypePrev ),
+ nAutorNoPrev( rCpy.nAutorNoPrev ),
+ aStampPrev( rCpy.aStampPrev )
+ {}
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==(const SfxPoolItem& rItem) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
+};
+
+class SwFltBookmark : public SfxPoolItem
+{
+friend class SwFltShell; // darf aName und aVal uebersetzen
+ long nHandle;
+ String aName;
+ String aVal;
+ BOOL bOnlyRef; // "FRAGE"-Feld, Ref/Seitenrf oder nichts
+ BOOL bRef;
+ BOOL bPgRef;
+public:
+ SwFltBookmark( const String& rNa, const String& rVa,
+ long nHand, BOOL bOnlyR );
+ SwFltBookmark( const SwFltBookmark& );
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==(const SfxPoolItem&) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
+ const String& GetName() const { return aName; }
+ const String& GetValSys() const { return aVal; }
+ BOOL IsOnlyRef() const { return bOnlyRef; }
+ BOOL IsRef() const { return bRef; }
+ void SetRef(BOOL b = TRUE) { bRef = b; }
+ BOOL IsPgRef() const { return bPgRef; }
+ void SetPgRef(BOOL b = TRUE) { bPgRef = b; }
+ long GetHandle() const { return nHandle; }
+};
+
+class SwFltTOX : public SfxPoolItem
+{
+ SwTOXBase* pTOXBase;
+ USHORT nCols;
+ BOOL bHadBreakItem; // there was a break item BEFORE insertion of the TOX
+ BOOL bHadPageDescItem; // ...
+public:
+ SwFltTOX(SwTOXBase* pBase, USHORT _nCols = 0);
+ SwFltTOX(const SwFltTOX&);
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==(const SfxPoolItem&) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
+ SwTOXBase* GetBase() { return pTOXBase; }
+ USHORT GetCols() const { return nCols; }
+ void SetHadBreakItem( BOOL bVal ) { bHadBreakItem = bVal; }
+ void SetHadPageDescItem( BOOL bVal ) { bHadPageDescItem = bVal; }
+ BOOL HadBreakItem() const { return bHadBreakItem; }
+ BOOL HadPageDescItem() const { return bHadPageDescItem; }
+};
+
+class SwFltSection : public SfxPoolItem
+{
+ SwSection* pSection;
+public:
+ SwFltSection( SwSection* pSect );
+ SwFltSection( const SwFltSection& );
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==(const SfxPoolItem&) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
+ SwSection* GetSection() { return pSection; }
+};
+// Der WWEndStack verhaelt sich wie der WWControlStck, nur dass die Attribute
+// auf ihm bis ans Ende des Dokuments gehortet werden, falls auf sie noch
+// zugegriffen werden muss (z.B. Book/RefMarks, Index u.s.w.)
+class SwFltEndStack : public SwFltControlStack
+{
+public:
+ SwFltEndStack(SwDoc* pDo, ULONG nFieldFl)
+ :SwFltControlStack(pDo, nFieldFl)
+ {
+ bIsEndStack = TRUE;
+ }
+
+ void SetBookRef( const String& rName, BOOL bPgRef = FALSE );
+};
+
+///////////////////////////////////////////////////////////////////////////////////////////
+//
+// hier beginnen die fuer ww1-filter neu erstellten klassen. diese
+// sollen eine simple oberflaeche fuer die komplexen strukturen des
+// writers speziell fuer filter sein. soll etwas in den writer gegeben
+// werden, soll ein << reichen. hierfuer sind neue typen erzeugt
+// worden. ausserdem soll moeglich sein das objekt nach vielen
+// zustaenden der momentanen formatierung zu fragen, sodasz diese der
+// filter nicht selbst verwalten musz.
+//
+// den anfang macht eine vorlagen-oberklasse, die einfachen umgang mit
+// formatvorlagen ermoeglicht:
+//
+
+class SwFltOutBase
+{
+ SwDoc& rDoc;
+protected:
+ RndStdIds eFlyAnchor;
+ BOOL bFlyAbsPos;
+
+ SwDoc& GetDoc() { return rDoc; }
+ SfxItemSet* NewFlyDefaults();
+
+ SwFltOutBase(SwDoc& rDocu)
+ : rDoc(rDocu), bFlyAbsPos(FALSE), eFlyAnchor(FLY_AT_CNTNT)
+ {}
+
+public:
+ virtual SwFltOutBase& operator << (const SfxPoolItem& rItem) = 0;
+
+ virtual const SfxPoolItem& GetAttr(USHORT nWhich) = 0;
+ virtual const SfxPoolItem& GetNodeOrStyAttr(USHORT nWhich) = 0;
+
+ virtual const SfxPoolItem& GetCellAttr(USHORT nWhich);
+ virtual BOOL BeginTable();
+ virtual void NextTableCell();
+ virtual void NextTableRow();
+ virtual void SetTableWidth(SwTwips nW);
+ virtual void SetTableOrient(SwHoriOrient eOri);
+ virtual void SetCellWidth(SwTwips nWidth, USHORT nCell);
+ virtual void SetCellHeight(SwTwips nH);
+ virtual void SetCellBorder(const SvxBoxItem& rFmtBox, USHORT nCell);
+ virtual void SetCellSpace(USHORT nSp);
+ virtual void DeleteCell(USHORT nCell);
+ virtual void EndTable();
+
+ virtual BOOL IsInFly() = 0;
+ virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr) = 0;
+ virtual const SfxPoolItem& GetFlyFrmAttr(USHORT nWhich) = 0;
+ virtual BOOL BeginFly( RndStdIds eAnchor, BOOL bAbsolutePos,
+ const SfxItemSet* pMoreAttrs = 0 );
+ virtual void SetFlyAnchor( RndStdIds eAnchor );
+ virtual void EndFly();
+};
+
+class SwFltOutDoc : public SwFltOutBase
+{
+ SwFltControlStack& rStack;
+ SwFltEndStack& rEndStack;
+ SwPaM* pPaM;
+ SwFrmFmt* pFly;
+// table items:
+ const SwTable* pTable;
+ SwPosition* pTabSavedPos; // set when in table
+ SwPosition* pFlySavedPos; // set when in fly
+ SwTwips nTableWidth;
+ USHORT usTableX;
+ USHORT usTableY;
+ BOOL bReadNoTbl; // Keine Tabellen
+
+ SwTableBox* GetBox(USHORT ny, USHORT nx = USHRT_MAX);
+ BOOL SeekCell( short nRow, short nCol, BOOL bPam );
+ void SplitTable();
+public:
+ SwFltOutDoc(SwDoc& rDocu, SwPaM* pP, SwFltControlStack& rStk, SwFltEndStack& rEStk)
+ :SwFltOutBase(rDocu), pPaM(pP), rStack(rStk), rEndStack(rEStk),
+ pFly(0), pTable(0), pTabSavedPos(0), pFlySavedPos(0),
+ nTableWidth(0), bReadNoTbl(FALSE)
+ {}
+
+ void SetReadNoTable() { bReadNoTbl = TRUE; }
+ BOOL IsTableWidthSet() const { return 0 != nTableWidth; }
+
+ virtual SwFltOutBase& operator << (const SfxPoolItem& rItem);
+
+ virtual const SfxPoolItem& GetAttr(USHORT nWhich);
+ virtual const SfxPoolItem& GetNodeOrStyAttr(USHORT nWhich);
+
+ BOOL IsInTable();
+ virtual const SfxPoolItem& GetCellAttr(USHORT nWhich);
+ virtual BOOL BeginTable();
+ virtual void NextTableCell();
+ virtual void NextTableRow();
+ virtual void SetTableWidth(SwTwips nW);
+ virtual void SetTableOrient(SwHoriOrient eOri);
+ virtual void SetCellWidth(SwTwips nWidth, USHORT nCell);
+ virtual void SetCellHeight(SwTwips nH);
+ virtual void SetCellBorder(const SvxBoxItem& rFmtBox, USHORT nCell);
+ virtual void SetCellSpace(USHORT nSp);
+ virtual void DeleteCell(USHORT nCell);
+ virtual void EndTable();
+
+ SwFrmFmt* MakeFly( RndStdIds eAnchor, SfxItemSet* pSet );
+ virtual BOOL IsInFly();
+ virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr);
+ virtual const SfxPoolItem& GetFlyFrmAttr(USHORT nWhich);
+ virtual BOOL BeginFly( RndStdIds eAnchor, BOOL bAbsolutePos,
+ const SfxItemSet* pMoreAttrs = 0 );
+ virtual void EndFly();
+};
+
+class SwFltFormatCollection : public SwFltOutBase
+{
+ SwTxtFmtColl* pColl;
+ SfxItemSet* pFlyAttrs; // Simulation der Flys in Styles
+ BOOL bHasFly;
+public:
+ SwFltFormatCollection(SwDoc&, RES_POOL_COLLFMT_TYPE nType);
+ SwFltFormatCollection(SwDoc&, const String& rName );
+ ~SwFltFormatCollection() { if( pFlyAttrs ) delete pFlyAttrs; }
+
+ void Reset()
+ {
+ pColl->ResetAllAttr();
+ pColl->SetAuto(FALSE); // nach Empfehlung JP
+ }
+ void Derived(SwTxtFmtColl* pBase)
+ { pColl->SetDerivedFrom(pBase); }
+
+// SwTxtFmtColl* Search(String, CharSet eSrc);
+ SwTxtFmtColl* GetColl() { return pColl; }
+ void SetHasFly() { bHasFly = TRUE; }
+ SfxItemSet* GetpFlyAttrs() { return pFlyAttrs; }
+
+ virtual SwFltOutBase& operator << (const SfxPoolItem& rItem);
+ virtual const SfxPoolItem& GetAttr(USHORT nWhich);
+ virtual const SfxPoolItem& GetNodeOrStyAttr(USHORT nWhich);
+
+ virtual BOOL IsInFly();
+ virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr);
+ virtual const SfxPoolItem& GetFlyFrmAttr(USHORT nWhich);
+ virtual BOOL BeginFly( RndStdIds eAnchor, BOOL bAbsolutePos,
+ const SfxItemSet* pMoreAttrs = 0 );
+ BOOL BeginStyleFly( SwFltOutDoc* pOutDoc );
+ virtual void EndFly();
+};
+
+//
+// dies nun ist die zauberhafteklasse: intention: alle eins nach dem
+// andern hinein'pipe'n. wird eine besondere struktur eingelesen, wird
+// eine klammer geoeffnet (BeginXxx) und nach beendigung geschlossen
+// (EndXxx), wobei Xxx zB fuer Fusznoten, Kopf/Fuszzeilen oder
+// Tabellen steht. Styles funktionieren auch so, haben aber den
+// unterschied, keine buchstaben zu akzeptieren.
+// beginnt ein neuer absatz oder aehnliches, wird NextXxx genutzt.
+// hier ist moeglich, Tab, Zeilenumbruch, Absatzende, Seitenumbruch
+// und Sektionsende einzufuegen.
+//
+class SwFltShell
+{
+ SwFltOutDoc* pOutDoc;
+ SwFltFormatCollection* pColls[256];
+ SwFltOutBase* pOut;
+
+// SwFltFormatCollection* pFormat; // set when in style-mode
+ SwPageDesc* pCurrentPageDesc;
+ SwPosition* pSavedPos; // set, when in footnote or header/footer -mode
+#ifdef None
+#undef None
+#endif
+ enum SubModes {
+ None,
+ Header,
+ Footer,
+ Footnote,
+ Table,
+ Fly,
+ Style,
+ Max
+ } eSubMode;
+
+// Fly items:
+ USHORT nAktStyle; // zur Indizierung pStyleFlyTable
+//
+ SwFltControlStack aStack;
+ SwFltEndStack aEndStack;
+ SwPaM* pPaM;
+//
+ USHORT nPageDescOffset; // fuers update der pagedescs
+ CharSet eSrcCharSet; // charset der quelle
+ friend SwFltControlStack;
+ BOOL bNewDoc;
+ BOOL bStdPD;
+ BOOL bProtect;
+
+public:
+ SwFltShell(SwDoc* , SwPaM& , BOOL bNew, ULONG = 0);
+ ~SwFltShell();
+
+ SwDoc& GetDoc() { return *aStack.pDoc; }
+
+ CharSet SetCharSet(CharSet eNew) { CharSet eOld = eSrcCharSet;
+ eSrcCharSet = eNew;
+ return eOld;
+ }
+ void SetUseStdPageDesc() { bStdPD = TRUE; }
+ void SetProtect() { bProtect = TRUE; }
+ SwPageDesc* MakePageDesc(SwPageDesc* pFirstPageDesc = NULL);
+ SwPageDesc& GetPageDesc() { return *pCurrentPageDesc; }
+ void NextTab() { (*this) << BYTE(0x09); }
+ void NextLine() { (*this) << BYTE(0x0a); }
+ void NextParagraph() { GetDoc().AppendTxtNode(*pPaM->GetPoint()); }
+ void NextPage() { NextParagraph();
+ GetDoc().Insert(*pPaM,
+ SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE));
+ }
+ void NextSection() { pCurrentPageDesc = MakePageDesc(); }
+
+ SwFltShell& AddGraphic( const String& rPicName );
+ SwFltShell& AddError( const sal_Char* pErr );
+ SwFltShell& AddLinkedSection( const String& rFileName );
+ SwFltShell& EndItem( USHORT nId );
+ SwFltShell& SetStyle( USHORT nStyle );
+
+ SwFltShell& operator << ( Graphic& );
+ SwFltShell& operator << ( SwFltBookmark& aBook );
+ void SetBookEnd(long nHandle);
+ SwFltShell& operator << ( const SwFltTOX& );
+ SwFltShell& operator << ( const String& ); // Vorsicht: CHARSET_ANSI
+ SwFltShell& operator << ( const sal_Unicode );
+ SwFltShell& operator << ( const SwField& );
+ SwFltShell& operator << ( const SfxPoolItem& rItem )
+ { *pOut << rItem; return *this; }
+
+// SwFltShell& operator >> (SfxPoolItem&);
+// methode zum beenden einer sub-sektion, zB Fusznote etc
+ void End() { eSubMode = None; }
+// methoden zur verwaltung von Header/Footer
+ void BeginHeader(SwPageDesc* =NULL);
+ void BeginFooter(SwPageDesc* =NULL);
+ void EndHeaderFooter();
+// methoden zur verwaltung von FootNotes
+ void BeginFootnote();
+ void EndFootnote();
+// methoden zur verwaltung von Tabellen
+ BOOL IsInTable() {
+ return ( pOut == pOutDoc ) ? pOutDoc->IsInTable() : 0; }
+ const SfxPoolItem& GetCellAttr(USHORT nWhich) {
+ return pOut->GetCellAttr(nWhich); }
+ BOOL BeginTable() {
+ BOOL b = pOut->BeginTable();
+ if(b) eSubMode = Table;
+ return b; }
+ void NextTableCell() {
+ pOut->NextTableCell(); }
+ void NextTableRow() {
+ pOut->NextTableRow(); }
+ void SetTableWidth(SwTwips nW) {
+ pOut->SetTableWidth(nW); }
+ BOOL IsTableWidthSet() {
+ return pOutDoc->IsTableWidthSet(); }
+ void SetTableOrient(SwHoriOrient eOri) {
+ pOut->SetTableOrient(eOri); }
+ void SetCellWidth(SwTwips nWidth, USHORT nCell = USHRT_MAX ) {
+ pOut->SetCellWidth(nWidth, nCell); }
+ void SetCellHeight(SwTwips nH) {
+ pOut->SetCellHeight(nH); }
+ void SetCellBorder(const SvxBoxItem& rFmtBox, USHORT nCell = USHRT_MAX ){
+ pOut->SetCellBorder(rFmtBox, nCell); }
+ void SetCellSpace(USHORT nSp) {
+ pOut->SetCellSpace(nSp); }
+ void DeleteCell(USHORT nCell = USHRT_MAX) {
+ pOut->DeleteCell(nCell); }
+ void EndTable() {
+ pOut->EndTable(); }
+// methoden zur verwaltung von Flys
+ BOOL IsInFly() { return pOut->IsInFly(); }
+ BOOL BeginFly( RndStdIds eAnchor = FLY_AT_CNTNT, BOOL bAbsolutePos = FALSE );
+ void SetFlyAnchor( RndStdIds eAnchor )
+ { pOut->SetFlyAnchor( eAnchor ); }
+ void SetFlyXPos( short nXPos,SwRelationOrient eHRel = FRAME,
+ SwHoriOrient eHAlign = HORI_NONE );
+ void SetFlyYPos( short nYPos, SwRelationOrient eVRel = FRAME,
+ SwVertOrient eVAlign = VERT_NONE );
+ void SetFlyFrmAttr(const SfxPoolItem& rAttr){
+ pOut->SetFlyFrmAttr( rAttr ); }
+ void EndFly();
+// methoden zur verwaltung von styles:
+ void BeginStyle(USHORT nUserCode, RES_POOL_COLLFMT_TYPE aType)
+ {
+ ASSERT(nUserCode<sizeof(pColls)/sizeof(*pColls), "code out of bounds");
+ ASSERT(pColls[nUserCode] == NULL, "user codes dublicate");
+ if (eSubMode == Style)
+ EndStyle();
+ pOut = pColls[nUserCode] = new SwFltFormatCollection(GetDoc(), aType);
+ nAktStyle = nUserCode;
+ eSubMode = Style;
+ }
+ void BeginStyle( USHORT nUserCode, const String& rName )
+ {
+ ASSERT(nUserCode<sizeof(pColls)/sizeof(*pColls), "code out of bounds");
+ ASSERT(pColls[nUserCode] == NULL, "user codes dublicate");
+ if (eSubMode == Style)
+ EndStyle();
+ pOut = pColls[nUserCode] = new SwFltFormatCollection(GetDoc(), rName );
+ nAktStyle = nUserCode;
+ eSubMode = Style;
+ }
+ BOOL IsStyleImported(USHORT nUserCode)
+ { return pColls[nUserCode] != 0; }
+ void BaseStyle(USHORT nBased)
+ {
+ ASSERT(eSubMode == Style, "wrong state for style");
+ ASSERT(pColls[nBased], "Style based on noexistent style" );
+ if( eSubMode == Style && pColls[nBased]->GetColl() )
+ ((SwFltFormatCollection*)pOut)->Derived(pColls[nBased]->GetColl());
+ }
+ void NextStyle(USHORT nWhich, USHORT nNext);
+
+ void EndStyle()
+ {
+// ASSERT(eSubMode == Style, "wrong state for style");
+ nAktStyle = 0;
+ pOut = pOutDoc;
+ eSubMode = None;
+ }
+
+ BOOL IsFlagSet(SwFltControlStack::Flags no) const
+ { return aStack.IsFlagSet(no); }
+ void ConvertUStr( String& rInOut );
+ void ConvertLStr( String& rInOut );
+ String QuoteStr( const String& rIn );
+// folgende status kann die shell verwalten:
+ const SfxPoolItem& GetNodeOrStyAttr(USHORT nWhich)
+ { return pOut->GetNodeOrStyAttr( nWhich ); }
+ const SfxPoolItem& GetAttr(USHORT nWhich)
+ { return pOut->GetAttr( nWhich ); }
+ const SfxPoolItem& GetFlyFrmAttr(USHORT nWhich)
+ { return pOut->GetFlyFrmAttr( nWhich ); }
+ SwFieldType *GetSysFldType(USHORT eWhich)
+ { return GetDoc().GetSysFldType(eWhich); }
+ BOOL GetWeightBold();
+ BOOL GetPostureItalic();
+ BOOL GetCrossedOut();
+ BOOL GetContour();
+ BOOL GetCaseKapitaelchen();
+ BOOL GetCaseVersalien();
+};
+
+
+#endif
diff --git a/sw/source/filter/inc/makefile.mk b/sw/source/filter/inc/makefile.mk
new file mode 100644
index 000000000000..c6cdee2c9c09
--- /dev/null
+++ b/sw/source/filter/inc/makefile.mk
@@ -0,0 +1,61 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 17:14:53 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
diff --git a/sw/source/filter/inc/rtf.hxx b/sw/source/filter/inc/rtf.hxx
new file mode 100644
index 000000000000..fc310f45398e
--- /dev/null
+++ b/sw/source/filter/inc/rtf.hxx
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * $RCSfile: rtf.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:14:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _RTF_HXX
+#define _RTF_HXX
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+// Umsetzung einiger FlyFrame-Attribute
+class RTFVertOrient
+{
+ union {
+ struct {
+ USHORT nOrient : 4;
+ USHORT nRelOrient : 1;
+ } Flags;
+ USHORT nVal;
+ } Value;
+
+public:
+ RTFVertOrient( USHORT nValue ) { Value.nVal = nValue; }
+
+ RTFVertOrient( USHORT nOrient, USHORT nRelOrient ) {
+ Value.Flags.nOrient = nOrient;
+ Value.Flags.nRelOrient = nRelOrient;
+ }
+
+ USHORT GetOrient() const { return Value.Flags.nOrient; }
+ USHORT GetRelation() const { return Value.Flags.nRelOrient; }
+ USHORT GetValue() const { return Value.nVal; }
+};
+
+
+class RTFHoriOrient
+{
+ union {
+ struct {
+ USHORT nOrient : 4;
+ USHORT nRelAnchor : 4;
+ USHORT nRelOrient : 1;
+ } Flags;
+ USHORT nVal;
+ } Value;
+
+public:
+ RTFHoriOrient( USHORT nValue ) { Value.nVal = nValue; }
+
+ RTFHoriOrient( USHORT nOrient, USHORT nRelOrient ) {
+ Value.Flags.nOrient = nOrient;
+ Value.Flags.nRelOrient = nRelOrient;
+ Value.Flags.nRelAnchor = 0;
+ }
+
+ USHORT GetOrient() const { return Value.Flags.nOrient; }
+ USHORT GetRelation() const { return Value.Flags.nRelOrient; }
+ USHORT GetValue() const { return Value.nVal; }
+};
+
+class RTFProtect
+{
+ union {
+ struct {
+ BOOL bCntnt : 1;
+ BOOL bSize : 1;
+ BOOL bPos : 1;
+ } Flags;
+ BYTE nVal;
+ } Value;
+public:
+ RTFProtect( BYTE nValue ) { Value.nVal = nValue; }
+
+ RTFProtect( BOOL bCntnt, BOOL bSize, BOOL bPos ) {
+ Value.Flags.bCntnt = bCntnt;
+ Value.Flags.bSize = bSize;
+ Value.Flags.bPos = bPos;
+ }
+
+ BOOL GetCntnt() const { return Value.Flags.bCntnt; }
+ BOOL GetSize() const { return Value.Flags.bSize; }
+ BOOL GetPos() const { return Value.Flags.bPos; }
+ USHORT GetValue() const { return Value.nVal; }
+};
+
+
+class RTFSurround
+{
+ union {
+ struct {
+ USHORT nGoldCut : 1;
+ USHORT nOrder : 4;
+ } Flags;
+ BYTE nVal;
+ } Value;
+public:
+ RTFSurround( BYTE nValue ) { Value.nVal = nValue; }
+
+ RTFSurround( BOOL bGoldCut, BYTE nOrder ) {
+ Value.Flags.nOrder = nOrder;
+ Value.Flags.nGoldCut = bGoldCut;
+ }
+
+ BYTE GetOrder() const { return (BYTE)Value.Flags.nOrder; }
+ BOOL GetGoldCut() const { return (BOOL)Value.Flags.nGoldCut; }
+ USHORT GetValue() const { return Value.nVal; }
+};
+
+#endif // _RTF_HXX
+
+
diff --git a/sw/source/filter/inc/wrt_fn.hxx b/sw/source/filter/inc/wrt_fn.hxx
new file mode 100644
index 000000000000..fe6f000083e7
--- /dev/null
+++ b/sw/source/filter/inc/wrt_fn.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: wrt_fn.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:14:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _WRT_FN_HXX
+#define _WRT_FN_HXX
+
+#include "hintids.hxx" // fuer die Konstanten
+
+// einige Forward-Deklarationen
+class SwFmt;
+class SwNode;
+class SwCntntNode;
+class Writer;
+class SfxPoolItem;
+class SfxItemSet;
+
+
+/* Funktionspointer auf die Attribut-Write-Funktionen */
+typedef Writer& (*FnAttrOut)( Writer&, const SfxPoolItem& );
+typedef FnAttrOut SwAttrFnTab[ POOLATTR_END - POOLATTR_BEGIN ];
+
+Writer& Out( const SwAttrFnTab, const SfxPoolItem&, Writer& );
+Writer& Out_SfxItemSet( const SwAttrFnTab, Writer&, const SfxItemSet&,
+ BOOL bDeep, BOOL bTstForDefault = TRUE );
+
+
+/* Funktionspointer auf die Node-Write-Funktionen */
+
+enum RES_NODE
+{
+RES_NODE_BEGIN = 0,
+ RES_TXTNODE = RES_NODE_BEGIN,
+ RES_GRFNODE,
+ RES_OLENODE,
+RES_NODE_END
+};
+
+typedef Writer& (*FnNodeOut)( Writer&, SwCntntNode& );
+typedef FnNodeOut SwNodeFnTab[ RES_NODE_END - RES_NODE_BEGIN ];
+
+Writer& Out( const SwNodeFnTab, SwNode&, Writer & rWrt );
+
+
+
+
+#endif // _WRT_FN_HXX
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
new file mode 100644
index 000000000000..e0330140aca9
--- /dev/null
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -0,0 +1,375 @@
+/*************************************************************************
+ *
+ * $RCSfile: wrtswtbl.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:14:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _WRTSWTBL_HXX
+#define _WRTSWTBL_HXX
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
+#endif
+#ifndef _SVARRAY_HXX
+#include <svtools/svarray.hxx>
+#endif
+
+#ifndef _ORNTENUM_HXX
+#include <orntenum.hxx>
+#endif
+#ifndef _HORIORNT_HXX
+#include <horiornt.hxx>
+#endif
+
+class Color;
+class SwTableBox;
+class SwTableBoxes;
+class SwTableLine;
+class SwTableLines;
+class SwTable;
+class SwFrmFmt;
+class SwHTMLTableLayout;
+class SvxBrushItem;
+class SvxBoxItem;
+class SvxBorderLine;
+
+
+//---------------------------------------------------------------------------
+// Code aus dem HTML-Filter fuers schreiben von Tabellen
+//---------------------------------------------------------------------------
+
+#define COLFUZZY 20
+#define ROWFUZZY 20
+#define COL_DFLT_WIDTH ((2*COLFUZZY)+1)
+#define ROW_DFLT_HEIGHT (2*ROWFUZZY)+1
+
+
+//-----------------------------------------------------------------------
+
+class SwWriteTableCell
+{
+ const SwTableBox *pBox; // SwTableBox der Zelle
+ const SvxBrushItem *pBackground; // geerbter Hintergrund einer Zeile
+
+ long nHeight; // fixe/Mindest-Hoehe der Zeile
+
+ USHORT nWidthOpt; // Breite aus Option;
+
+ USHORT nRow; // Start-Zeile
+ USHORT nCol; // Start-Spalte
+
+ USHORT nRowSpan; // ueberspannte Zeilen
+ USHORT nColSpan; // ueberspannte Spalten
+
+
+ BOOL bPrcWidthOpt;
+
+public:
+
+ SwWriteTableCell( const SwTableBox *pB, USHORT nR, USHORT nC,
+ USHORT nRSpan, USHORT nCSpan, long nHght,
+ const SvxBrushItem *pBGround ) :
+ pBox( pB ),
+ nRow( nR ), nCol( nC ),
+ nRowSpan( nRSpan ), nColSpan( nCSpan ),
+ nHeight( nHght ), pBackground( pBGround ),
+ nWidthOpt( 0 ), bPrcWidthOpt( FALSE )
+ {}
+
+ const SwTableBox *GetBox() const { return pBox; }
+
+ USHORT GetRow() const { return nRow; }
+ USHORT GetCol() const { return nCol; }
+
+ USHORT GetRowSpan() const { return nRowSpan; }
+ USHORT GetColSpan() const { return nColSpan; }
+
+ long GetHeight() const { return nHeight; }
+ SwVertOrient GetVertOri() const;
+
+ const SvxBrushItem *GetBackground() const { return pBackground; }
+
+ void SetWidthOpt( USHORT nWidth, BOOL bPrc )
+ {
+ nWidthOpt = nWidth; bPrcWidthOpt = bPrc;
+ }
+
+ USHORT GetWidthOpt() const { return nWidthOpt; }
+ BOOL HasPrcWidthOpt() const { return bPrcWidthOpt; }
+};
+
+typedef SwWriteTableCell *SwWriteTableCellPtr;
+SV_DECL_PTRARR_DEL( SwWriteTableCells, SwWriteTableCellPtr, 5, 5 )
+
+
+//-----------------------------------------------------------------------
+
+class SwWriteTableRow
+{
+ SwWriteTableCells aCells; // Alle Zellen der Rows
+
+ const SvxBrushItem *pBackground;// Hintergrund
+
+ long nPos; // End-Position (twips) der Zeile
+
+public:
+
+ USHORT nTopBorder; // Dicke der oberen/unteren Umrandugen
+ USHORT nBottomBorder;
+
+ BOOL bTopBorder : 1; // Welche Umrandungen sind da?
+ BOOL bBottomBorder : 1;
+
+ SwWriteTableRow( long nPos );
+
+ SwWriteTableCell *AddCell( const SwTableBox *pBox,
+ USHORT nRow, USHORT nCol,
+ USHORT nRowSpan, USHORT nColSpan,
+ long nHeight,
+ const SvxBrushItem *pBackground );
+
+ void SetBackground( const SvxBrushItem *pBGround )
+ {
+ pBackground = pBGround;
+ }
+ const SvxBrushItem *GetBackground() const { return pBackground; }
+
+ BOOL HasTopBorder() const { return bTopBorder; }
+ BOOL HasBottomBorder() const { return bBottomBorder; }
+
+ long GetPos() const { return nPos; }
+ const SwWriteTableCells& GetCells() const { return aCells; }
+
+ inline int operator==( const SwWriteTableRow& rRow ) const;
+ inline int operator<( const SwWriteTableRow& rRow2 ) const;
+};
+
+inline int SwWriteTableRow::operator==( const SwWriteTableRow& rRow ) const
+{
+ // etwas Unschaerfe zulassen
+ return (nPos >= rRow.nPos ? nPos - rRow.nPos
+ : rRow.nPos - nPos ) <= ROWFUZZY;
+}
+
+inline int SwWriteTableRow::operator<( const SwWriteTableRow& rRow ) const
+{
+ // Da wir hier nur die Wahrheits-Grade 0 und 1 kennen, lassen wir lieber
+ // auch nicht zu, dass x==y und x<y gleichzeitig gilt ;-)
+ return nPos < rRow.nPos - ROWFUZZY;
+}
+
+typedef SwWriteTableRow *SwWriteTableRowPtr;
+SV_DECL_PTRARR_SORT_DEL( SwWriteTableRows, SwWriteTableRowPtr, 5, 5 )
+
+
+//-----------------------------------------------------------------------
+
+class SwWriteTableCol
+{
+ USHORT nPos; // End Position der Spalte
+
+ USHORT nWidthOpt;
+
+ BOOL bRelWidthOpt : 1;
+ BOOL bOutWidth : 1; // Spaltenbreite ausgeben?
+
+public:
+ BOOL bLeftBorder : 1; // Welche Umrandungen sind da?
+ BOOL bRightBorder : 1;
+
+ SwWriteTableCol( USHORT nPosition );
+
+ USHORT GetPos() const { return nPos; }
+
+ void SetLeftBorder( BOOL bBorder ) { bLeftBorder = bBorder; }
+ BOOL HasLeftBorder() const { return bLeftBorder; }
+
+ void SetRightBorder( BOOL bBorder ) { bRightBorder = bBorder; }
+ BOOL HasRightBorder() const { return bRightBorder; }
+
+ void SetOutWidth( BOOL bSet ) { bOutWidth = bSet; }
+ BOOL GetOutWidth() const { return bOutWidth; }
+
+ inline int operator==( const SwWriteTableCol& rCol ) const;
+ inline int operator<( const SwWriteTableCol& rCol ) const;
+
+ void SetWidthOpt( USHORT nWidth, BOOL bRel )
+ {
+ nWidthOpt = nWidth; bRelWidthOpt = bRel;
+ }
+ USHORT GetWidthOpt() const { return nWidthOpt; }
+ BOOL HasRelWidthOpt() const { return bRelWidthOpt; }
+};
+
+inline int SwWriteTableCol::operator==( const SwWriteTableCol& rCol ) const
+{
+ // etwas Unschaerfe zulassen
+ return (nPos >= rCol.nPos ? nPos - rCol.nPos
+ : rCol.nPos - nPos ) <= COLFUZZY;
+}
+
+inline int SwWriteTableCol::operator<( const SwWriteTableCol& rCol ) const
+{
+ // Da wir hier nur die Wahrheits-Grade 0 und 1 kennen, lassen wir lieber
+ // auch nicht zu, dass x==y und x<y gleichzeitig gilt ;-)
+ return nPos < rCol.nPos - COLFUZZY;
+}
+
+
+typedef SwWriteTableCol *SwWriteTableColPtr;
+SV_DECL_PTRARR_SORT_DEL( SwWriteTableCols, SwWriteTableColPtr, 5, 5 )
+
+//-----------------------------------------------------------------------
+
+class SwWriteTable
+{
+protected:
+ SwWriteTableCols aCols; // alle Spalten
+ SwWriteTableRows aRows; // alle Zellen
+
+ UINT32 nBorderColor; // Umrandungsfarbe
+
+ USHORT nCellSpacing; // Dicke der inneren Umrandung
+ USHORT nCellPadding; // Absatnd Umrandung-Inhalt
+
+ USHORT nBorder; // Dicke der ausseren Umrandung
+ USHORT nInnerBorder; // Dicke der inneren Umrandung
+ USHORT nBaseWidth; // Bezugsgroesse fur Breiten SwFmtFrmSize
+
+ USHORT nHeadEndRow; // letzte Zeile des Tabellen-Kopfes
+
+ USHORT nLeftSub;
+ USHORT nRightSub;
+
+ long nTabWidth; // Absolute/Relative Breite der Tabelle
+
+ BOOL bRelWidths : 1; // Breiten relativ ausgeben?
+ BOOL bUseLayoutHeights : 1; // Layout zur Hoehenbestimmung nehmen?
+#ifndef PRODUCT
+ BOOL bGetLineHeightCalled : 1;
+#endif
+
+ BOOL bColsOption : 1;
+ BOOL bColTags : 1;
+ BOOL bLayoutExport : 1;
+ BOOL bCollectBorderWidth : 1;
+
+ virtual BOOL ShouldExpandSub( const SwTableBox *pBox,
+ BOOL bExpandedBefore, USHORT nDepth ) const;
+
+ void CollectTableRowsCols( long nStartRPos, USHORT nStartCPos,
+ long nParentLineHeight,
+ USHORT nParentLineWidth,
+ const SwTableLines& rLines,
+ USHORT nDepth );
+
+ void FillTableRowsCols( long nStartRPos, USHORT nStartRow,
+ USHORT nStartCPos, USHORT nStartCol,
+ long nParentLineHeight,
+ USHORT nParentLineWidth,
+ const SwTableLines& rLines,
+ const SvxBrushItem* pLineBrush,
+ USHORT nDepth );
+
+ void MergeBorders( const SvxBorderLine* pBorderLine, BOOL bTable );
+
+ USHORT MergeBoxBorders( const SwTableBox *pBox, USHORT nRow, USHORT nCol,
+ USHORT nRowSpan, USHORT nColSpan,
+ USHORT &rTopBorder, USHORT &rBottomBorder );
+
+ USHORT GetBaseWidth() const { return nBaseWidth; }
+
+ BOOL HasRelWidths() const { return bRelWidths; }
+
+public:
+ static long GetBoxWidth( const SwTableBox *pBox );
+protected:
+
+ long GetLineHeight( const SwTableLine *pLine );
+ long GetLineHeight( const SwTableBox *pBox ) const;
+ const SvxBrushItem *GetLineBrush( const SwTableBox *pBox,
+ SwWriteTableRow *pRow );
+
+ USHORT GetLeftSpace( USHORT nCol ) const;
+ USHORT GetRightSpace( USHORT nCol, USHORT nColSpan ) const;
+
+ USHORT GetRawWidth( USHORT nCol, USHORT nColSpan ) const;
+ USHORT GetAbsWidth( USHORT nCol, USHORT nColSpan ) const;
+ USHORT GetRelWidth( USHORT nCol, USHORT nColSpan ) const;
+ USHORT GetPrcWidth( USHORT nCol, USHORT nColSpan ) const;
+
+ long GetAbsHeight( long nRawWidth, USHORT nRow, USHORT nRowSpan ) const;
+
+public:
+ SwWriteTable( const SwTableLines& rLines, long nWidth, USHORT nBWidth,
+ BOOL bRel, USHORT nMaxDepth = USHRT_MAX,
+ USHORT nLeftSub=0, USHORT nRightSub=0 );
+ SwWriteTable( const SwHTMLTableLayout *pLayoutInfo );
+
+ const SwWriteTableCols& GetCols() const { return aCols; }
+ const SwWriteTableRows& GetRows() const { return aRows; }
+};
+
+
+
+
+#endif
+