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
);
86 virtual ~LwpCellList();
88 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
89 LwpObjectID
GetNextID(){return *GetNext();}
90 sal_uInt8
GetColumnID(){return cColumn
;}
91 virtual bool IsFormula(){return false;}
92 LwpObjectID
GetValueID(){return cValue
;}
94 virtual void Convert(XFCell
* pCell
, LwpTableLayout
* pCellsMap
=NULL
);
99 void Read() SAL_OVERRIDE
;
106 class LwpRowList
: public LwpDLVList
109 LwpRowList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
110 virtual ~LwpRowList();
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
;
124 * VO_NUMERICVALUE object
126 class LwpNumericValue
: public LwpObject
129 LwpNumericValue(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
130 virtual ~LwpNumericValue();
132 double GetValue(){return cNumber
;}
133 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
136 //LwpContent m_TheContent;
137 void Read() SAL_OVERRIDE
;
142 * VO_TABLERANGE object
144 class LwpTableRange
: public LwpDLVList
147 LwpTableRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
148 virtual ~LwpTableRange();
150 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
151 LwpObjectID
GetCellRangeID(){return cpCellRange
;}
152 LwpObjectID
GetTableID(){ return cqTable
;}
153 LwpTableRange
* GetNext() { return (LwpTableRange
*)(LwpDLVList::GetNext()->obj());}
156 LwpObjectID cpCellRange
;
157 void Read() SAL_OVERRIDE
;
161 * VO_CELLRANGE object
163 class LwpCellRange
: public LwpObject
166 LwpCellRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
167 virtual ~LwpCellRange();
169 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
170 LwpObjectID
GetFolderID(){return cpFolder
;}
172 LwpObjectID cpFolder
;
173 void Read() SAL_OVERRIDE
;
179 class LwpFolder
: public LwpDLVList
182 LwpFolder(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
183 virtual ~LwpFolder();
185 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
186 LwpObjectID
GetChildHeadID(){ return *cChild
.GetHead();}
188 LwpDLVListHeadTail cChild
;
191 void Read() SAL_OVERRIDE
;
195 * VO_DEPENDENT object
197 class LwpDependent
: public LwpDLVList
200 LwpDependent(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
201 virtual ~LwpDependent();
203 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
205 void Read() SAL_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(void);
228 ~LwpRowColumnQualifier(){}
230 inline void SetAbsolute(void);
231 inline void ClearAbsolute(void);
232 bool IsAbsolute(void);
234 inline void SetAfter(void);
235 inline void ClearAfter(void);
238 void SetBad(bool Bad
);
241 void QuickRead(LwpObjectStream
*pStrm
);
244 enum // cFlags bit definitions
254 LwpRowColumnQualifier::SetAbsolute(void)
256 cFlags
|= REF_ABSOLUTE
;
260 LwpRowColumnQualifier::ClearAbsolute(void)
262 cFlags
&= ~REF_ABSOLUTE
;
266 LwpRowColumnQualifier::SetAfter(void)
272 LwpRowColumnQualifier::ClearAfter(void)
274 cFlags
&= ~REF_AFTER
;
278 LwpRowColumnQualifier::LwpRowColumnQualifier()
284 LwpRowColumnQualifier::IsAfter()
286 return cFlags
& REF_AFTER
? sal_True
: sal_False
;
290 LwpRowColumnQualifier::IsBad()
292 return cFlags
& REF_BAD
? sal_True
: sal_False
;
296 LwpRowColumnQualifier::IsAbsolute()
298 return cFlags
& REF_ABSOLUTE
? sal_True
: sal_False
;
304 class LwpRowSpecifier
307 LwpRowSpecifier(void)
312 void QuickRead(LwpObjectStream
*pStrm
);
313 OUString
ToString(sal_uInt16 nFormulaRow
);
315 sal_uInt16
RowID(sal_uInt16 FormulaRow
);
316 sal_uInt16
&Row(void);
318 void SetAbsolute(void);
319 void ClearAbsolute(void);
320 bool IsAbsolute(void);
323 void ClearAfter(void);
326 void SetBad(bool Bad
);
328 void SetRowDelta(sal_uInt16 ReferenceRowID
, sal_uInt16 FormulaRowID
);
332 LwpRowColumnQualifier cQualifier
;
336 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow
)
338 if (cQualifier
.IsBad())
342 if (cQualifier
.IsAbsolute())
345 if (cQualifier
.IsAfter())
346 return FormulaRow
+ cRow
;
347 return FormulaRow
- cRow
;
351 LwpRowSpecifier::Row()
357 LwpRowSpecifier::SetAbsolute(void)
359 cQualifier
.SetAbsolute();
363 LwpRowSpecifier::ClearAbsolute(void)
365 cQualifier
.ClearAbsolute();
369 LwpRowSpecifier::IsAbsolute()
371 return cQualifier
.IsAbsolute();
375 LwpRowSpecifier::SetAfter(void)
377 cQualifier
.SetAfter();
381 LwpRowSpecifier::ClearAfter(void)
383 cQualifier
.ClearAfter();
387 LwpRowSpecifier::IsAfter()
389 return cQualifier
.IsAfter();
393 LwpRowSpecifier::SetBad(bool Bad
)
395 cQualifier
.SetBad(Bad
);
399 LwpRowSpecifier::IsBad()
401 return cQualifier
.IsBad();
407 class LwpColumnSpecifier
410 LwpColumnSpecifier(void)
413 ~LwpColumnSpecifier()
416 void QuickRead(LwpObjectStream
*pStrm
);
417 sal_uInt8
Column(){return cColumn
;}
418 OUString
ToString(sal_uInt8 nFormulaCol
);
420 sal_uInt8
ColumnID(sal_uInt8 FormulaColumn
);
421 void SetAbsolute(void);
422 void ClearAbsolute(void);
423 bool IsAbsolute(void);
425 void ClearAfter(void);
427 void SetBad(bool Bad
);
429 void SetColumnDelta(sal_uInt8 ReferenceColumnID
, sal_uInt8 FormulaColumnID
);
433 LwpRowColumnQualifier cQualifier
;
437 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn
)
439 if (cQualifier
.IsBad())
443 if (cQualifier
.IsAbsolute())
445 if (cQualifier
.IsAfter())
446 return FormulaColumn
+ cColumn
;
447 return FormulaColumn
- cColumn
;
451 LwpColumnSpecifier::SetAbsolute(void)
453 cQualifier
.SetAbsolute();
457 LwpColumnSpecifier::ClearAbsolute(void)
459 cQualifier
.ClearAbsolute();
463 LwpColumnSpecifier::IsAbsolute()
465 return cQualifier
.IsAbsolute();
469 LwpColumnSpecifier::SetAfter(void)
471 cQualifier
.SetAfter();
475 LwpColumnSpecifier::ClearAfter(void)
477 cQualifier
.ClearAfter();
481 LwpColumnSpecifier::IsAfter()
483 return cQualifier
.IsAfter();
487 LwpColumnSpecifier::SetBad(bool Bad
)
489 cQualifier
.SetBad(Bad
);
493 LwpColumnSpecifier::IsBad()
495 return cQualifier
.IsBad();
499 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */