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
60 /*************************************************************************
63 ************************************************************************/
64 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
65 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
68 #include "lwpatomholder.hxx"
69 #include "lwpstory.hxx"
71 #include "xfilter/xfcell.hxx"
73 // temporily added for compile
82 class LwpCellList
: public LwpDLVList
85 LwpCellList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
87 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
88 LwpObjectID
GetNextID(){return GetNext();}
89 sal_uInt8
GetColumnID(){return cColumn
;}
90 virtual bool IsFormula(){return false;}
91 LwpObjectID
GetValueID(){return cValue
;}
93 virtual void Convert(XFCell
* pCell
, LwpTableLayout
* pCellsMap
=NULL
);
95 virtual ~LwpCellList();
100 void Read() SAL_OVERRIDE
;
107 class LwpRowList
: public LwpDLVList
110 LwpRowList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
112 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
113 LwpObjectID
GetChildHeadID(){return cChild
.GetHead();}
114 LwpObjectID
GetNextID(){return GetNext();}
115 sal_uInt16
GetRowID(){return cRowID
;}
117 LwpDLVListHeadTail cChild
;
120 void Read() SAL_OVERRIDE
;
122 virtual ~LwpRowList();
126 * VO_NUMERICVALUE object
128 class LwpNumericValue
: public LwpObject
131 LwpNumericValue(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
133 double GetValue(){return cNumber
;}
134 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
137 //LwpContent m_TheContent;
138 void Read() SAL_OVERRIDE
;
140 virtual ~LwpNumericValue();
145 * VO_TABLERANGE object
147 class LwpTableRange
: public LwpDLVList
150 LwpTableRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
152 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
153 LwpObjectID
GetCellRangeID(){return cpCellRange
;}
154 LwpObjectID
GetTableID(){ return cqTable
;}
155 LwpTableRange
* GetNext() { return static_cast<LwpTableRange
*>(LwpDLVList::GetNext().obj().get());}
158 LwpObjectID cpCellRange
;
159 void Read() SAL_OVERRIDE
;
161 virtual ~LwpTableRange();
165 * VO_CELLRANGE object
167 class LwpCellRange
: public LwpObject
170 LwpCellRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
172 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
173 LwpObjectID
GetFolderID(){return cpFolder
;}
175 LwpObjectID cpFolder
;
176 void Read() SAL_OVERRIDE
;
178 virtual ~LwpCellRange();
184 class LwpFolder
: public LwpDLVList
187 LwpFolder(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
189 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
190 LwpObjectID
GetChildHeadID(){ return cChild
.GetHead();}
192 LwpDLVListHeadTail cChild
;
195 void Read() SAL_OVERRIDE
;
197 virtual ~LwpFolder();
201 * VO_DEPENDENT object
203 class LwpDependent
: public LwpDLVList
206 LwpDependent(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
208 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
210 void Read() SAL_OVERRIDE
;
211 LwpObjectID cFormulaInfo
;
212 sal_uInt16 cReferenceOffset
; // Used to fix dependent formula when we're
221 sal_uInt8 cFlags
; // Used to fix dependent formula when we're
224 virtual ~LwpDependent();
231 class LwpRowColumnQualifier
234 LwpRowColumnQualifier();
235 ~LwpRowColumnQualifier(){}
237 inline void SetAbsolute();
238 inline void ClearAbsolute();
241 inline void SetAfter();
242 inline void ClearAfter();
245 void SetBad(bool Bad
);
248 void QuickRead(LwpObjectStream
*pStrm
);
251 enum // cFlags bit definitions
261 LwpRowColumnQualifier::SetAbsolute()
263 cFlags
|= REF_ABSOLUTE
;
267 LwpRowColumnQualifier::ClearAbsolute()
269 cFlags
&= ~REF_ABSOLUTE
;
273 LwpRowColumnQualifier::SetAfter()
279 LwpRowColumnQualifier::ClearAfter()
281 cFlags
&= ~REF_AFTER
;
285 LwpRowColumnQualifier::LwpRowColumnQualifier()
291 LwpRowColumnQualifier::IsAfter()
293 return (cFlags
& REF_AFTER
) != 0;
297 LwpRowColumnQualifier::IsBad()
299 return (cFlags
& REF_BAD
) != 0;
303 LwpRowColumnQualifier::IsAbsolute()
305 return (cFlags
& REF_ABSOLUTE
) != 0;
311 class LwpRowSpecifier
319 void QuickRead(LwpObjectStream
*pStrm
);
320 OUString
ToString(sal_uInt16 nFormulaRow
);
322 sal_uInt16
RowID(sal_uInt16 FormulaRow
);
326 void ClearAbsolute();
333 void SetBad(bool Bad
);
335 void SetRowDelta(sal_uInt16 ReferenceRowID
, sal_uInt16 FormulaRowID
);
339 LwpRowColumnQualifier cQualifier
;
343 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow
)
345 if (cQualifier
.IsBad())
349 if (cQualifier
.IsAbsolute())
352 if (cQualifier
.IsAfter())
353 return FormulaRow
+ cRow
;
354 return FormulaRow
- cRow
;
358 LwpRowSpecifier::Row()
364 LwpRowSpecifier::SetAbsolute()
366 cQualifier
.SetAbsolute();
370 LwpRowSpecifier::ClearAbsolute()
372 cQualifier
.ClearAbsolute();
376 LwpRowSpecifier::IsAbsolute()
378 return cQualifier
.IsAbsolute();
382 LwpRowSpecifier::SetAfter()
384 cQualifier
.SetAfter();
388 LwpRowSpecifier::ClearAfter()
390 cQualifier
.ClearAfter();
394 LwpRowSpecifier::IsAfter()
396 return cQualifier
.IsAfter();
400 LwpRowSpecifier::SetBad(bool Bad
)
402 cQualifier
.SetBad(Bad
);
406 LwpRowSpecifier::IsBad()
408 return cQualifier
.IsBad();
414 class LwpColumnSpecifier
420 ~LwpColumnSpecifier()
423 void QuickRead(LwpObjectStream
*pStrm
);
424 sal_uInt8
Column(){return cColumn
;}
425 OUString
ToString(sal_uInt8 nFormulaCol
);
427 sal_uInt8
ColumnID(sal_uInt8 FormulaColumn
);
429 void ClearAbsolute();
434 void SetBad(bool Bad
);
436 void SetColumnDelta(sal_uInt8 ReferenceColumnID
, sal_uInt8 FormulaColumnID
);
440 LwpRowColumnQualifier cQualifier
;
444 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn
)
446 if (cQualifier
.IsBad())
450 if (cQualifier
.IsAbsolute())
452 if (cQualifier
.IsAfter())
453 return FormulaColumn
+ cColumn
;
454 return FormulaColumn
- cColumn
;
458 LwpColumnSpecifier::SetAbsolute()
460 cQualifier
.SetAbsolute();
464 LwpColumnSpecifier::ClearAbsolute()
466 cQualifier
.ClearAbsolute();
470 LwpColumnSpecifier::IsAbsolute()
472 return cQualifier
.IsAbsolute();
476 LwpColumnSpecifier::SetAfter()
478 cQualifier
.SetAfter();
482 LwpColumnSpecifier::ClearAfter()
484 cQualifier
.ClearAfter();
488 LwpColumnSpecifier::IsAfter()
490 return cQualifier
.IsAfter();
494 LwpColumnSpecifier::SetBad(bool Bad
)
496 cQualifier
.SetBad(Bad
);
500 LwpColumnSpecifier::IsBad()
502 return cQualifier
.IsBad();
506 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */