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: eeparser.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 ************************************************************************/
31 #ifndef SC_EEPARSER_HXX
32 #define SC_EEPARSER_HXX
34 #include <tools/string.hxx>
35 #include <tools/gen.hxx>
36 #include <vcl/graph.hxx>
37 #include <tools/table.hxx>
38 #include <svtools/itemset.hxx>
39 #include <svx/editdata.hxx>
40 #include <address.hxx>
42 const sal_Char nHorizontal
= 1;
43 const sal_Char nVertical
= 2;
44 const sal_Char nHoriVerti
= nHorizontal
| nVertical
;
52 Graphic
* pGraphic
; // wird von WriteToDocument uebernommen
53 sal_Char nDir
; // 1==hori, 2==verti, 3==beides
56 aSize( 0, 0 ), aSpace( 0, 0 ), pGraphic( NULL
),
60 { if ( pGraphic
) delete pGraphic
; }
62 DECLARE_LIST( ScHTMLImageList
, ScHTMLImage
* )
67 ESelection aSel
; // Selection in EditEngine
68 String
* pValStr
; // HTML evtl. SDVAL String
69 String
* pNumStr
; // HTML evtl. SDNUM String
70 String
* pName
; // HTML evtl. Anchor/RangeName
71 String aAltText
; // HTML IMG ALT Text
72 ScHTMLImageList
* pImageList
; // Grafiken in dieser Zelle
73 SCCOL nCol
; // relativ zum Beginn des Parse
75 USHORT nTab
; // HTML TableInTable
76 USHORT nTwips
; // RTF ColAdjust etc.
77 SCCOL nColOverlap
; // merged cells wenn >1
78 SCROW nRowOverlap
; // merged cells wenn >1
79 USHORT nOffset
; // HTML PixelOffset
80 USHORT nWidth
; // HTML PixelWidth
81 BOOL bHasGraphic
; // HTML any image loaded
82 bool bEntirePara
; // TRUE = use entire paragraph, false = use selection
84 ScEEParseEntry( SfxItemPool
* pPool
) :
85 aItemSet( *pPool
), pValStr( NULL
),
86 pNumStr( NULL
), pName( NULL
), pImageList( NULL
),
87 nCol(SCCOL_MAX
), nRow(SCROW_MAX
), nTab(0),
88 nColOverlap(1), nRowOverlap(1),
89 nOffset(0), nWidth(0), bHasGraphic(FALSE
), bEntirePara(true)
91 ScEEParseEntry( const SfxItemSet
& rItemSet
) :
92 aItemSet( rItemSet
), pValStr( NULL
),
93 pNumStr( NULL
), pName( NULL
), pImageList( NULL
),
94 nCol(SCCOL_MAX
), nRow(SCROW_MAX
), nTab(0),
95 nColOverlap(1), nRowOverlap(1),
96 nOffset(0), nWidth(0), bHasGraphic(FALSE
), bEntirePara(true)
108 for ( ScHTMLImage
* pI
= pImageList
->First();
109 pI
; pI
= pImageList
->Next() )
117 DECLARE_LIST( ScEEParseList
, ScEEParseEntry
* )
127 SfxItemPool
* pDocPool
;
128 ScEEParseList
* pList
;
129 ScEEParseEntry
* pActEntry
;
137 void NewActEntry( ScEEParseEntry
* );
140 ScEEParser( EditEngine
* );
141 virtual ~ScEEParser();
143 virtual ULONG
Read( SvStream
&, const String
& rBaseURL
) = 0;
145 void GetDimensions( SCCOL
& nCols
, SCROW
& nRows
) const
146 { nCols
= nColMax
; nRows
= nRowMax
; }
147 ULONG
Count() const { return pList
->Count(); }
148 ScEEParseEntry
* First() const { return pList
->First(); }
149 ScEEParseEntry
* Next() const { return pList
->Next(); }
150 Table
* GetColWidths() const { return pColWidths
; }