update dev300-m58
[ooovba.git] / svx / source / editeng / eertfpar.hxx
blob6969fa62fe064e8ab0183c884ae9d706d3827300
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: eertfpar.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _EERTFPAR_HXX
31 #define _EERTFPAR_HXX
33 #include <svxrtf.hxx>
35 #include <editdoc.hxx>
36 #include <impedit.hxx>
38 #ifndef SVX_LIGHT
40 class EditNodeIdx : public SvxNodeIdx
42 private:
43 ContentNode* pNode;
44 ImpEditEngine* pImpEditEngine;
46 public:
47 EditNodeIdx( ImpEditEngine* pIEE, ContentNode* pNd = 0)
48 { pImpEditEngine = pIEE; pNode = pNd; }
49 virtual ULONG GetIdx() const;
50 virtual SvxNodeIdx* Clone() const;
51 ContentNode* GetNode() { return pNode; }
54 class EditPosition : public SvxPosition
56 private:
57 EditSelection* pCurSel;
58 ImpEditEngine* pImpEditEngine;
60 public:
61 EditPosition( ImpEditEngine* pIEE, EditSelection* pSel )
62 { pImpEditEngine = pIEE; pCurSel = pSel; }
64 virtual ULONG GetNodeIdx() const;
65 virtual USHORT GetCntIdx() const;
67 // erzeuge von sich selbst eine Kopie
68 virtual SvxPosition* Clone() const;
70 // erzeuge vom NodeIndex eine Kopie
71 virtual SvxNodeIdx* MakeNodeIdx() const;
74 #define ACTION_INSERTTEXT 1
75 #define ACTION_INSERTPARABRK 2
77 class EditRTFParser : public SvxRTFParser
79 private:
80 EditSelection aCurSel;
81 ImpEditEngine* pImpEditEngine;
82 CharSet eDestCharSet;
83 MapMode aRTFMapMode;
84 MapMode aEditMapMode;
86 USHORT nDefFont;
87 USHORT nDefTab;
88 USHORT nDefFontHeight;
89 BYTE nLastAction;
91 protected:
92 virtual void InsertPara();
93 virtual void InsertText();
94 virtual void MovePos( int bForward = TRUE );
95 virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos,
96 USHORT& rCntPos );
98 virtual void UnknownAttrToken( int nToken, SfxItemSet* pSet );
99 virtual void NextToken( int nToken );
100 virtual void SetAttrInDoc( SvxRTFItemStackType &rSet );
101 virtual int IsEndPara( SvxNodeIdx* pNd, USHORT nCnt ) const;
102 virtual void CalcValue();
103 void CreateStyleSheets();
104 SfxStyleSheet* CreateStyleSheet( SvxRTFStyleType* pRTFStyle );
105 SvxRTFStyleType* FindStyleSheet( const String& rName );
106 void AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& rEnd );
107 void ReadField();
108 void SkipGroup();
110 public:
111 EditRTFParser( SvStream& rIn, EditSelection aCurSel, SfxItemPool& rAttrPool, ImpEditEngine* pImpEditEngine );
112 ~EditRTFParser();
114 virtual SvParserState CallParser();
117 void SetDestCharSet( CharSet eCharSet ) { eDestCharSet = eCharSet; }
118 CharSet GetDestCharSet() const { return eDestCharSet; }
120 USHORT GetDefTab() const { return nDefTab; }
121 Font GetDefFont() { return GetFont( nDefFont ); }
123 EditPaM GetCurPaM() const { return aCurSel.Max(); }
126 SV_DECL_REF( EditRTFParser )
127 SV_IMPL_REF( EditRTFParser );
130 #endif // !SVX_LIGH
131 #endif //_EERTFPAR_HXX