1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
58 * For LWP filter architecture prototype - table object
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
65 #include "lwpdlvlist.hxx"
67 #include <xfilter/xfcell.hxx>
69 // temporarily added for compile
78 class LwpCellList
: public LwpDLVList
81 LwpCellList(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
);
83 virtual void Parse(IXFStream
* pOutputStream
) override
;
84 LwpObjectID
const & GetNextID(){return GetNext();}
85 sal_uInt8
GetColumnID() const {return cColumn
;}
87 virtual void Convert(XFCell
* pCell
, LwpTableLayout
* pCellsMap
=nullptr);
89 virtual ~LwpCellList() override
;
101 class LwpRowList final
: public LwpDLVList
104 LwpRowList(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
);
106 void Parse(IXFStream
* pOutputStream
) override
;
107 LwpObjectID
const & GetChildHeadID(){return cChild
.GetHead();}
108 LwpObjectID
const & GetNextID(){return GetNext();}
109 sal_uInt16
GetRowID() const {return cRowID
;}
111 void Read() override
;
112 virtual ~LwpRowList() override
;
114 LwpDLVListHeadTail cChild
;
120 * VO_NUMERICVALUE object
122 class LwpNumericValue final
: public LwpObject
125 LwpNumericValue(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
);
127 double GetValue() const {return cNumber
;}
128 void Parse(IXFStream
* pOutputStream
) override
;
130 void Read() override
;
131 virtual ~LwpNumericValue() override
;
138 * VO_TABLERANGE object
140 class LwpTableRange final
: public LwpDLVList
143 LwpTableRange(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
);
145 void Parse(IXFStream
* pOutputStream
) override
;
146 const LwpObjectID
& GetCellRangeID() const {return cpCellRange
;}
147 const LwpObjectID
& GetTableID() const { return cqTable
;}
148 LwpTableRange
* GetNext() { return dynamic_cast<LwpTableRange
*>(LwpDLVList::GetNext().obj().get());}
150 void Read() override
;
151 virtual ~LwpTableRange() override
;
154 LwpObjectID cpCellRange
;
158 * VO_CELLRANGE object
160 class LwpCellRange final
: public LwpObject
163 LwpCellRange(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
);
165 void Parse(IXFStream
* pOutputStream
) override
;
166 const LwpObjectID
& GetFolderID() const {return cpFolder
;}
168 void Read() override
;
169 virtual ~LwpCellRange() override
;
171 LwpObjectID cpFolder
;
177 class LwpFolder final
: public LwpDLVList
180 LwpFolder(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
);
182 void Parse(IXFStream
* pOutputStream
) override
;
183 LwpObjectID
const & GetChildHeadID(){ return cChild
.GetHead();}
185 void Read() override
;
186 virtual ~LwpFolder() override
;
188 LwpDLVListHeadTail cChild
;
194 * VO_DEPENDENT object
196 class LwpDependent final
: public LwpDLVList
199 LwpDependent(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
);
201 void Parse(IXFStream
* pOutputStream
) override
;
203 void Read() override
;
204 virtual ~LwpDependent() override
;
206 LwpObjectID cFormulaInfo
;
207 sal_uInt16 cReferenceOffset
; // Used to fix dependent formula when we're
216 sal_uInt8 cFlags
; // Used to fix dependent formula when we're
224 class LwpRowColumnQualifier
227 LwpRowColumnQualifier();
229 bool IsAbsolute() const;
231 bool IsAfter() const;
235 void QuickRead(LwpObjectStream
*pStrm
);
238 enum // cFlags bit definitions
248 LwpRowColumnQualifier::LwpRowColumnQualifier() : cFlags(0)
253 LwpRowColumnQualifier::IsAfter() const
255 return (cFlags
& REF_AFTER
) != 0;
259 LwpRowColumnQualifier::IsBad() const
261 return (cFlags
& REF_BAD
) != 0;
265 LwpRowColumnQualifier::IsAbsolute() const
267 return (cFlags
& REF_ABSOLUTE
) != 0;
273 class LwpRowSpecifier
280 void QuickRead(LwpObjectStream
*pStrm
);
282 sal_uInt16
RowID(sal_uInt16 FormulaRow
);
286 LwpRowColumnQualifier cQualifier
;
290 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow
)
292 if (cQualifier
.IsBad())
296 if (cQualifier
.IsAbsolute())
299 if (cQualifier
.IsAfter())
300 return FormulaRow
+ cRow
;
301 return FormulaRow
- cRow
;
308 class LwpColumnSpecifier
315 void QuickRead(LwpObjectStream
*pStrm
);
317 sal_uInt8
ColumnID(sal_uInt8 FormulaColumn
);
321 LwpRowColumnQualifier cQualifier
;
325 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn
)
327 if (cQualifier
.IsBad())
331 if (cQualifier
.IsAbsolute())
333 if (cQualifier
.IsAfter())
334 return FormulaColumn
+ cColumn
;
335 return FormulaColumn
- cColumn
;
340 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */