summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/editeng/editdbg.hxx91
-rw-r--r--svx/source/editeng/editstt2.hxx167
-rw-r--r--svx/source/editeng/eehtml.hxx153
-rw-r--r--svx/source/editeng/eeng_pch.cxx62
-rw-r--r--svx/source/editeng/eeng_pch.hxx76
-rw-r--r--svx/source/editeng/eertfpar.hxx168
6 files changed, 717 insertions, 0 deletions
diff --git a/svx/source/editeng/editdbg.hxx b/svx/source/editeng/editdbg.hxx
new file mode 100644
index 000000000000..ee7402b1a9b8
--- /dev/null
+++ b/svx/source/editeng/editdbg.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: editdbg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:01:13 $
+ *
+ * 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 _EDITDBG_HXX
+#define _EDITDBG_HXX
+
+#include <svtools/solar.hrc>
+#include <tools/string.hxx>
+#include <stdio.h>
+
+class EditEngine;
+class ParaPortion;
+class EditUndoList;
+class TextPortionList;
+class SfxItemSet;
+class SfxItemPool;
+class SfxPoolItem;
+
+ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem );
+void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL bShowALL );
+
+class EditDbg
+{
+public:
+ static void ShowEditEngineData( EditEngine* pEditEngine, BOOL bInfoBox = TRUE );
+ static void ShowPortionData( ParaPortion* pPortion );
+ static ByteString GetPortionInfo( ParaPortion* pPPortion );
+ static ByteString GetTextPortionInfo( TextPortionList& rPortions );
+ static ByteString GetUndoDebStr( EditUndoList* pUndoList );
+};
+
+
+#endif // _EDITDBG_HXX
diff --git a/svx/source/editeng/editstt2.hxx b/svx/source/editeng/editstt2.hxx
new file mode 100644
index 000000000000..68f14cd6b254
--- /dev/null
+++ b/svx/source/editeng/editstt2.hxx
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * $RCSfile: editstt2.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:01:14 $
+ *
+ * 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 _EDITSTT2_HXX
+#define _EDITSTT2_HXX
+
+#include <editstat.hxx>
+
+class InternalEditStatus : public EditStatus
+{
+
+public:
+ InternalEditStatus() { ; }
+
+ void TurnOnFlags( ULONG nFlags )
+ { nControlBits |= nFlags; }
+
+ void TurnOffFlags( ULONG nFlags )
+ { nControlBits &= ~nFlags; }
+
+ void TurnOnStatusBits( ULONG nBits )
+ { nStatusBits |= nBits; }
+
+ void TurnOffStatusBits( ULONG nBits )
+ { nStatusBits &= ~nBits; }
+
+
+ BOOL UseCharAttribs() const
+ { return ( ( nControlBits & EE_CNTRL_USECHARATTRIBS ) != 0 ); }
+
+ BOOL NotifyCursorMovements() const
+ { return ( ( nControlBits & EE_CNTRL_CRSRLEFTPARA ) != 0 ); }
+
+ BOOL UseIdleFormatter() const
+ { return ( ( nControlBits & EE_CNTRL_DOIDLEFORMAT) != 0 ); }
+
+ BOOL AllowPasteSpecial() const
+ { return ( ( nControlBits & EE_CNTRL_PASTESPECIAL ) != 0 ); }
+
+ BOOL DoAutoIndenting() const
+ { return ( ( nControlBits & EE_CNTRL_AUTOINDENTING ) != 0 ); }
+
+ BOOL DoUndoAttribs() const
+ { return ( ( nControlBits & EE_CNTRL_UNDOATTRIBS ) != 0 ); }
+
+ BOOL OneCharPerLine() const
+ { return ( ( nControlBits & EE_CNTRL_ONECHARPERLINE ) != 0 ); }
+
+ BOOL IsOutliner() const
+ { return ( ( nControlBits & EE_CNTRL_OUTLINER ) != 0 ); }
+
+ BOOL IsOutliner2() const
+ { return ( ( nControlBits & EE_CNTRL_OUTLINER2 ) != 0 ); }
+
+ BOOL IsAnyOutliner() const
+ { return IsOutliner() || IsOutliner2(); }
+
+ BOOL DoNotUseColors() const
+ { return ( ( nControlBits & EE_CNTRL_NOCOLORS ) != 0 ); }
+
+ BOOL AllowBigObjects() const
+ { return ( ( nControlBits & EE_CNTRL_ALLOWBIGOBJS ) != 0 ); }
+
+ BOOL DoOnlineSpelling() const
+ { return ( ( nControlBits & EE_CNTRL_ONLINESPELLING ) != 0 ); }
+
+ BOOL DoStretch() const
+ { return ( ( nControlBits & EE_CNTRL_STRETCHING ) != 0 ); }
+
+ BOOL AutoPageSize() const
+ { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZE ) != 0 ); }
+ BOOL AutoPageWidth() const
+ { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEX ) != 0 ); }
+ BOOL AutoPageHeight() const
+ { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEY ) != 0 ); }
+
+ BOOL MarkFields() const
+ { return ( ( nControlBits & EE_CNTRL_MARKFIELDS ) != 0 ); }
+
+ BOOL DoRestoreFont() const
+ { return ( ( nControlBits & EE_CNTRL_RESTOREFONT ) != 0 ); }
+
+ BOOL DoImportRTFStyleSheets() const
+ { return ( ( nControlBits & EE_CNTRL_RTFSTYLESHEETS ) != 0 ); }
+
+ BOOL DoDrawRedLines() const
+ { return ( ( nControlBits & EE_CNTRL_NOREDLINES ) == 0 ); }
+
+ BOOL DoAutoCorrect() const
+ { return ( ( nControlBits & EE_CNTRL_AUTOCORRECT ) != 0 ); }
+
+ BOOL DoAutoComplete() const
+ { return ( ( nControlBits & EE_CNTRL_AUTOCOMPLETE ) != 0 ); }
+
+ BOOL DoTabIndenting() const
+ { return ( ( nControlBits & EE_CNTRL_TABINDENTING ) != 0 ); }
+
+ BOOL DoFormat100() const
+ { return ( ( nControlBits & EE_CNTRL_FORMAT100 ) != 0 ); }
+
+ BOOL ULSpaceSummation() const
+ { return ( ( nControlBits & EE_CNTRL_ULSPACESUMMATION ) != 0 ); }
+
+ BOOL ULSpaceFirstParagraph() const
+ { return ( ( nControlBits & EE_CNTRL_ULSPACEFIRSTPARA ) != 0 ); }
+};
+
+#endif // _EDITSTT2_HXX
+
diff --git a/svx/source/editeng/eehtml.hxx b/svx/source/editeng/eehtml.hxx
new file mode 100644
index 000000000000..d3a570be3e4c
--- /dev/null
+++ b/svx/source/editeng/eehtml.hxx
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: eehtml.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:01:14 $
+ *
+ * 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 _EEHTML_HXX
+#define _EEHTML_HXX
+
+#ifndef _SVARRAY_HXX
+#include <svtools/svarray.hxx>
+#endif
+
+#include <editdoc.hxx>
+
+#ifndef _SFXHTML_HXX //autogen wg. SfxHTMLParser
+#include <sfx2/sfxhtml.hxx>
+#endif
+
+class ImpEditEngine;
+
+#define MAX_NUMBERLEVEL 10
+
+struct AnchorInfo
+{
+ String aHRef;
+ String aText;
+};
+
+#ifndef SVX_LIGHT
+
+class EditHTMLParser : public SfxHTMLParser
+{
+private:
+ EditSelection aCurSel;
+ ImpEditEngine* pImpEditEngine;
+ AnchorInfo* pCurAnchor;
+
+ BOOL bInPara;
+ BOOL bWasInPara; // bInPara vor HeadingStart merken, weil sonst hinterher weg
+ BOOL bFieldsInserted;
+ BYTE nInTable;
+ BYTE nInCell;
+
+ USHORT* pNumbers;
+ BYTE nDefListLevel;
+ BYTE nBulletLevel;
+ BYTE nNumberingLevel;
+
+ BYTE nLastAction;
+
+ void StartPara( BOOL bReal );
+ void EndPara( BOOL bReal );
+ void AnchorStart();
+ void AnchorEnd();
+ void HeadingStart( int nToken );
+ void HeadingEnd( int nToken );
+ void SkipGroup( int nEndToken );
+ BOOL ThrowAwayBlank();
+ BOOL HasTextInCurrentPara();
+ void ProcessUnknownControl( BOOL bOn );
+ inline USHORT* GetNumbers();
+
+ void ImpInsertParaBreak();
+ void ImpInsertText( const String& rText );
+ void ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSel = 0 );
+ void ImpSetStyleSheet( USHORT nHeadingLevel );
+
+protected:
+ virtual void NextToken( int nToken );
+
+public:
+ EditHTMLParser( SvStream& rIn, SvKeyValueIterator* pHTTPHeaderAttrs, int bReadNewDoc = TRUE );
+ ~EditHTMLParser();
+
+ virtual SvParserState CallParser( ImpEditEngine* pImpEE, const EditPaM& rPaM );
+
+ const EditSelection& GetCurSelection() const { return aCurSel; }
+};
+
+inline USHORT* EditHTMLParser::GetNumbers()
+{
+ if ( !pNumbers )
+ {
+ pNumbers = new USHORT[MAX_NUMBERLEVEL];
+ for ( USHORT n = 0; n < MAX_NUMBERLEVEL; n++ )
+ pNumbers[n] = 0;
+ }
+ return pNumbers;
+}
+
+
+SV_DECL_REF( EditHTMLParser );
+SV_IMPL_REF( EditHTMLParser );
+
+#endif
+
+#endif // _EEHTML_HXX
diff --git a/svx/source/editeng/eeng_pch.cxx b/svx/source/editeng/eeng_pch.cxx
new file mode 100644
index 000000000000..0313ef281362
--- /dev/null
+++ b/svx/source/editeng/eeng_pch.cxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * $RCSfile: eeng_pch.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:01:14 $
+ *
+ * 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): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include <eeng_pch.hxx>
+#pragma hdrstop
diff --git a/svx/source/editeng/eeng_pch.hxx b/svx/source/editeng/eeng_pch.hxx
new file mode 100644
index 000000000000..86b9682af4ec
--- /dev/null
+++ b/svx/source/editeng/eeng_pch.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * $RCSfile: eeng_pch.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:01:14 $
+ *
+ * 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): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define _STD_VAR_ARRAYS
+
+#include <vcl/wrkwin.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
+
+#include <svxids.hrc>
+#include <dialogs.hrc>
+
+#include <eeitemid.hxx>
+
+#ifndef SVX_LIGHT
+#include <thesdlg.hxx>
+#endif
+
diff --git a/svx/source/editeng/eertfpar.hxx b/svx/source/editeng/eertfpar.hxx
new file mode 100644
index 000000000000..fcc05af0c14a
--- /dev/null
+++ b/svx/source/editeng/eertfpar.hxx
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * $RCSfile: eertfpar.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 17:01:14 $
+ *
+ * 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 _EERTFPAR_HXX
+#define _EERTFPAR_HXX
+
+#include <svxrtf.hxx>
+
+#include <editdoc.hxx>
+#include <impedit.hxx>
+
+#ifndef SVX_LIGHT
+
+class EditNodeIdx : public SvxNodeIdx
+{
+private:
+ ContentNode* pNode;
+ ImpEditEngine* pImpEditEngine;
+
+public:
+ EditNodeIdx( ImpEditEngine* pIEE, ContentNode* pNd = 0)
+ { pImpEditEngine = pIEE; pNode = pNd; }
+ virtual ULONG GetIdx() const;
+ virtual SvxNodeIdx* Clone() const;
+ ContentNode* GetNode() { return pNode; }
+};
+
+class EditPosition : public SvxPosition
+{
+private:
+ EditSelection* pCurSel;
+ ImpEditEngine* pImpEditEngine;
+
+public:
+ EditPosition( ImpEditEngine* pIEE, EditSelection* pSel )
+ { pImpEditEngine = pIEE; pCurSel = pSel; }
+
+ virtual ULONG GetNodeIdx() const;
+ virtual USHORT GetCntIdx() const;
+
+ // erzeuge von sich selbst eine Kopie
+ virtual SvxPosition* Clone() const;
+
+ // erzeuge vom NodeIndex eine Kopie
+ virtual SvxNodeIdx* MakeNodeIdx() const;
+};
+
+#define ACTION_INSERTTEXT 1
+#define ACTION_INSERTPARABRK 2
+
+class EditRTFParser : public SvxRTFParser
+{
+private:
+ EditSelection aCurSel;
+ ImpEditEngine* pImpEditEngine;
+ CharSet eDestCharSet;
+ MapMode aRTFMapMode;
+ MapMode aEditMapMode;
+
+ USHORT nDefFont;
+ USHORT nDefTab;
+ USHORT nDefFontHeight;
+ BYTE nLastAction;
+
+protected:
+ virtual void InsertPara();
+ virtual void InsertText();
+ virtual void MovePos( int bForward = TRUE );
+ virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos,
+ USHORT& rCntPos );
+
+ virtual void UnknownAttrToken( int nToken, SfxItemSet* pSet );
+ virtual void NextToken( int nToken );
+ virtual void SetAttrInDoc( SvxRTFItemStackType &rSet );
+ inline long TwipsToLogic( long n );
+ virtual int IsEndPara( SvxNodeIdx* pNd, USHORT nCnt ) const;
+ virtual void CalcValue();
+ void CreateStyleSheets();
+ SfxStyleSheet* CreateStyleSheet( SvxRTFStyleType* pRTFStyle );
+ SvxRTFStyleType* FindStyleSheet( const String& rName );
+ void AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& rEnd );
+ void ReadField();
+
+public:
+ EditRTFParser( SvStream& rIn, EditSelection aCurSel, SfxItemPool& rAttrPool, ImpEditEngine* pImpEditEngine );
+ ~EditRTFParser();
+
+ virtual SvParserState CallParser();
+
+
+ void SetDestCharSet( CharSet eCharSet ) { eDestCharSet = eCharSet; }
+ CharSet GetDestCharSet() const { return eDestCharSet; }
+
+ USHORT GetDefTab() const { return nDefTab; }
+ Font GetDefFont() { return GetFont( nDefFont ); }
+
+ EditPaM GetCurPaM() const { return aCurSel.Max(); }
+};
+
+SV_DECL_REF( EditRTFParser );
+SV_IMPL_REF( EditRTFParser );
+
+inline long EditRTFParser::TwipsToLogic( long nTwps )
+{
+ Size aSz( nTwps, 0 );
+ aSz = pImpEditEngine->GetRefDevice()->LogicToLogic( aSz, &aRTFMapMode, &aEditMapMode );
+ return aSz.Width();
+}
+
+#endif // !SVX_LIGH
+#endif //_EERTFPAR_HXX