merge the formfield patch from ooo-build
[ooovba.git] / svx / source / editeng / eehtml.hxx
blob1396a8930778d523d12afdb5b1dd542cadaf2c1e
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: eehtml.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 ************************************************************************/
31 #ifndef _EEHTML_HXX
32 #define _EEHTML_HXX
34 #include <svtools/svarray.hxx>
36 #include <editdoc.hxx>
37 #include <sfx2/sfxhtml.hxx>
39 class ImpEditEngine;
41 #define MAX_NUMBERLEVEL 10
43 struct AnchorInfo
45 String aHRef;
46 String aText;
49 #ifndef SVX_LIGHT
51 class EditHTMLParser : public SfxHTMLParser
53 using HTMLParser::CallParser;
54 private:
55 EditSelection aCurSel;
56 String aBaseURL;
57 ImpEditEngine* pImpEditEngine;
58 AnchorInfo* pCurAnchor;
60 BOOL bInPara;
61 BOOL bWasInPara; // bInPara vor HeadingStart merken, weil sonst hinterher weg
62 BOOL bFieldsInserted;
63 BYTE nInTable;
64 BYTE nInCell;
66 BYTE nDefListLevel;
67 BYTE nBulletLevel;
68 BYTE nNumberingLevel;
70 BYTE nLastAction;
72 void StartPara( BOOL bReal );
73 void EndPara( BOOL bReal );
74 void AnchorStart();
75 void AnchorEnd();
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 );
88 protected:
89 virtual void NextToken( int nToken );
91 public:
92 EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValueIterator* pHTTPHeaderAttrs );
93 ~EditHTMLParser();
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 );
103 #endif
105 #endif // _EEHTML_HXX