1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: eertfpar.hxx,v $
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 ************************************************************************/
35 #include <editdoc.hxx>
36 #include <impedit.hxx>
40 class EditNodeIdx
: public SvxNodeIdx
44 ImpEditEngine
* pImpEditEngine
;
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
57 EditSelection
* pCurSel
;
58 ImpEditEngine
* pImpEditEngine
;
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
80 EditSelection aCurSel
;
81 ImpEditEngine
* pImpEditEngine
;
88 USHORT nDefFontHeight
;
92 virtual void InsertPara();
93 virtual void InsertText();
94 virtual void MovePos( int bForward
= TRUE
);
95 virtual void SetEndPrevPara( SvxNodeIdx
*& rpNodePos
,
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
);
111 EditRTFParser( SvStream
& rIn
, EditSelection aCurSel
, SfxItemPool
& rAttrPool
, ImpEditEngine
* pImpEditEngine
);
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
);
131 #endif //_EERTFPAR_HXX