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: eehtml.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 ************************************************************************/
34 #include <svtools/svarray.hxx>
36 #include <editdoc.hxx>
37 #include <sfx2/sfxhtml.hxx>
41 #define MAX_NUMBERLEVEL 10
51 class EditHTMLParser
: public SfxHTMLParser
53 using HTMLParser::CallParser
;
55 EditSelection aCurSel
;
57 ImpEditEngine
* pImpEditEngine
;
58 AnchorInfo
* pCurAnchor
;
61 BOOL bWasInPara
; // bInPara vor HeadingStart merken, weil sonst hinterher weg
72 void StartPara( BOOL bReal
);
73 void EndPara( BOOL bReal
);
76 void HeadingStart( int nToken
);
77 void HeadingEnd( int nToken
);
78 void SkipGroup( int nEndToken
);
79 BOOL
ThrowAwayBlank();
80 BOOL
HasTextInCurrentPara();
81 void ProcessUnknownControl( BOOL bOn
);
83 void ImpInsertParaBreak();
84 void ImpInsertText( const String
& rText
);
85 void ImpSetAttribs( const SfxItemSet
& rItems
, EditSelection
* pSel
= 0 );
86 void ImpSetStyleSheet( USHORT nHeadingLevel
);
89 virtual void NextToken( int nToken
);
92 EditHTMLParser( SvStream
& rIn
, const String
& rBaseURL
, SvKeyValueIterator
* pHTTPHeaderAttrs
);
95 virtual SvParserState
CallParser( ImpEditEngine
* pImpEE
, const EditPaM
& rPaM
);
97 const EditSelection
& GetCurSelection() const { return aCurSel
; }
100 SV_DECL_REF( EditHTMLParser
)
101 SV_IMPL_REF( EditHTMLParser
);
105 #endif // _EEHTML_HXX