fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / filter / inc / eeparser.hxx
blobccd5e685d545e93243834712f51bdcdee6bbba5d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_EEPARSER_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_EEPARSER_HXX
23 #include <tools/gen.hxx>
24 #include <vcl/graph.hxx>
25 #include <svl/itemset.hxx>
26 #include <editeng/editdata.hxx>
27 #include <address.hxx>
28 #include <boost/ptr_container/ptr_vector.hpp>
29 #include <vector>
31 const sal_Char nHorizontal = 1;
32 const sal_Char nVertical = 2;
33 const sal_Char nHoriVerti = nHorizontal | nVertical;
35 struct ScHTMLImage
37 OUString aURL;
38 Size aSize;
39 Point aSpace;
40 OUString aFilterName;
41 Graphic* pGraphic; // wird von WriteToDocument uebernommen
42 sal_Char nDir; // 1==hori, 2==verti, 3==beides
44 ScHTMLImage() :
45 aSize( 0, 0 ), aSpace( 0, 0 ), pGraphic( NULL ),
46 nDir( nHorizontal )
49 ~ScHTMLImage() { delete pGraphic; }
52 struct ScEEParseEntry
54 SfxItemSet aItemSet;
55 ESelection aSel; // Selection in EditEngine
56 OUString* pValStr; // HTML evtl. SDVAL String
57 OUString* pNumStr; // HTML evtl. SDNUM String
58 OUString* pName; // HTML evtl. Anchor/RangeName
59 OUString aAltText; // HTML IMG ALT Text
60 boost::ptr_vector< ScHTMLImage > maImageList; // Grafiken in dieser Zelle
61 SCCOL nCol; // relativ zum Beginn des Parse
62 SCROW nRow;
63 sal_uInt16 nTab; // HTML TableInTable
64 sal_uInt16 nTwips; // RTF ColAdjust etc.
65 SCCOL nColOverlap; // merged cells wenn >1
66 SCROW nRowOverlap; // merged cells wenn >1
67 sal_uInt16 nOffset; // HTML PixelOffset
68 sal_uInt16 nWidth; // HTML PixelWidth
69 bool bHasGraphic:1; // HTML any image loaded
70 bool bEntirePara:1; // true = use entire paragraph, false = use selection
72 ScEEParseEntry( SfxItemPool* pPool ) :
73 aItemSet( *pPool ), pValStr( NULL ),
74 pNumStr( NULL ), pName( NULL ),
75 nCol(SCCOL_MAX), nRow(SCROW_MAX), nTab(0),
76 nTwips(0), nColOverlap(1), nRowOverlap(1),
77 nOffset(0), nWidth(0), bHasGraphic(false), bEntirePara(true)
80 ScEEParseEntry( const SfxItemSet& rItemSet ) :
81 aItemSet( rItemSet ), pValStr( NULL ),
82 pNumStr( NULL ), pName( NULL ),
83 nCol(SCCOL_MAX), nRow(SCROW_MAX), nTab(0),
84 nTwips(0), nColOverlap(1), nRowOverlap(1),
85 nOffset(0), nWidth(0), bHasGraphic(false), bEntirePara(true)
88 ~ScEEParseEntry()
90 delete pValStr;
91 delete pNumStr;
92 delete pName;
93 maImageList.clear();
97 class EditEngine;
99 typedef std::map<SCCOL, sal_uInt16> ColWidthsMap;
101 class ScEEParser
103 protected:
104 EditEngine* pEdit;
105 SfxItemPool* pPool;
106 SfxItemPool* pDocPool;
107 ::std::vector< ScEEParseEntry* > maList;
108 ScEEParseEntry* pActEntry;
109 ColWidthsMap maColWidths;
110 int nLastToken;
111 SCCOL nColCnt;
112 SCROW nRowCnt;
113 SCCOL nColMax;
114 SCROW nRowMax;
116 void NewActEntry( ScEEParseEntry* );
118 public:
119 ScEEParser( EditEngine* );
120 virtual ~ScEEParser();
122 virtual sal_uLong Read( SvStream&, const OUString& rBaseURL ) = 0;
124 const ColWidthsMap& GetColWidths() const { return maColWidths; }
125 ColWidthsMap& GetColWidths() { return maColWidths; }
126 void GetDimensions( SCCOL& nCols, SCROW& nRows ) const
127 { nCols = nColMax; nRows = nRowMax; }
129 inline size_t ListSize() const{ return maList.size(); }
130 ScEEParseEntry* ListEntry( size_t index ) { return maList[ index ]; }
131 const ScEEParseEntry* ListEntry( size_t index ) const { return maList[ index ]; }
134 #endif
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */