1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
57 * For LWP filter architecture prototype - table object
59 /*************************************************************************
62 ************************************************************************/
63 #ifndef _LWPLAYOUTNUMERICSOVERRIDE_HXX_
64 #define _LWPLAYOUTNUMERICSOVERRIDE_HXX_
67 #include "lwpatomholder.hxx"
68 #include "lwpstory.hxx"
70 #include "xfilter/xfcell.hxx"
72 // temporily added for compile
81 class LwpCellList
: public LwpDLVList
84 LwpCellList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
85 virtual ~LwpCellList();
87 virtual void Parse(IXFStream
* pOutputStream
);
88 LwpObjectID
GetNextID(){return *GetNext();}
89 sal_uInt8
GetColumnID(){return cColumn
;}
90 virtual sal_Bool
IsFormula(){return sal_False
;}
91 LwpObjectID
GetValueID(){return cValue
;}
93 virtual void Convert(XFCell
* pCell
, LwpTableLayout
* pCellsMap
=NULL
);
105 class LwpRowList
: public LwpDLVList
108 LwpRowList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
111 void Parse(IXFStream
* pOutputStream
);
112 LwpObjectID
GetChildHeadID(){return *cChild
.GetHead();}
113 LwpObjectID
GetNextID(){return *GetNext();}
114 sal_uInt16
GetRowID(){return cRowID
;}
116 LwpDLVListHeadTail cChild
;
123 * VO_NUMERICVALUE object
125 class LwpNumericValue
: public LwpObject
128 LwpNumericValue(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
131 double GetValue(){return cNumber
;}
132 void Parse(IXFStream
* pOutputStream
);
135 //LwpContent m_TheContent;
139 ////////////////////////////////////////////////////////////////////////
142 * VO_TABLERANGE object
144 class LwpTableRange
: public LwpDLVList
147 LwpTableRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
150 void Parse(IXFStream
* pOutputStream
);
151 LwpObjectID
GetCellRangeID(){return cpCellRange
;}
152 LwpObjectID
GetTableID(){ return cqTable
;}
153 LwpTableRange
* GetNext() { return (LwpTableRange
*)(LwpDLVList::GetNext()->obj());}
156 LwpObjectID cpCellRange
;
161 * VO_CELLRANGE object
163 class LwpCellRange
: public LwpObject
166 LwpCellRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
169 void Parse(IXFStream
* pOutputStream
);
170 LwpObjectID
GetFolderID(){return cpFolder
;}
172 LwpObjectID cpFolder
;
179 class LwpFolder
: public LwpDLVList
182 LwpFolder(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
185 void Parse(IXFStream
* pOutputStream
);
186 LwpObjectID
GetChildHeadID(){ return *cChild
.GetHead();}
188 LwpDLVListHeadTail cChild
;
195 * VO_DEPENDENT object
197 class LwpDependent
: public LwpDLVList
200 LwpDependent(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
203 void Parse(IXFStream
* pOutputStream
);
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
221 ///////////////////////////////////////////////////////////////
226 class LwpRowColumnQualifier
229 LwpRowColumnQualifier(void);
230 ~LwpRowColumnQualifier(){}
232 inline void SetAbsolute(void);
233 inline void ClearAbsolute(void);
234 sal_Bool
IsAbsolute(void);
236 inline void SetAfter(void);
237 inline void ClearAfter(void);
238 sal_Bool
IsAfter(void);
240 void SetBad(sal_Bool Bad
);
241 sal_Bool
IsBad(void);
243 void QuickRead(LwpObjectStream
*pStrm
);
246 enum // cFlags bit definitions
256 LwpRowColumnQualifier::SetAbsolute(void)
258 cFlags
|= REF_ABSOLUTE
;
262 LwpRowColumnQualifier::ClearAbsolute(void)
264 cFlags
&= ~REF_ABSOLUTE
;
268 LwpRowColumnQualifier::SetAfter(void)
274 LwpRowColumnQualifier::ClearAfter(void)
276 cFlags
&= ~REF_AFTER
;
280 LwpRowColumnQualifier::LwpRowColumnQualifier()
286 LwpRowColumnQualifier::IsAfter()
288 return cFlags
& REF_AFTER
? sal_True
: sal_False
;
292 LwpRowColumnQualifier::IsBad()
294 return cFlags
& REF_BAD
? sal_True
: sal_False
;
298 LwpRowColumnQualifier::IsAbsolute()
300 return cFlags
& REF_ABSOLUTE
? sal_True
: sal_False
;
306 class LwpRowSpecifier
309 LwpRowSpecifier(void){}
312 void QuickRead(LwpObjectStream
*pStrm
);
313 String
ToString(USHORT nFormulaRow
);
315 USHORT
RowID(USHORT FormulaRow
);
318 void SetAbsolute(void);
319 void ClearAbsolute(void);
320 sal_Bool
IsAbsolute(void);
323 void ClearAfter(void);
324 sal_Bool
IsAfter(void);
326 void SetBad(sal_Bool Bad
);
327 sal_Bool
IsBad(void);
328 void SetRowDelta(USHORT ReferenceRowID
, USHORT FormulaRowID
);
332 LwpRowColumnQualifier cQualifier
;
336 LwpRowSpecifier::RowID(USHORT 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(sal_Bool Bad
)
395 cQualifier
.SetBad(Bad
);
399 LwpRowSpecifier::IsBad()
401 return cQualifier
.IsBad();
407 class LwpColumnSpecifier
410 LwpColumnSpecifier(void){};
411 ~LwpColumnSpecifier(){};
413 void QuickRead(LwpObjectStream
*pStrm
);
414 sal_uInt8
Column(){return cColumn
;}
415 String
ToString(sal_uInt8 nFormulaCol
);
417 sal_uInt8
ColumnID(sal_uInt8 FormulaColumn
);
418 void SetAbsolute(void);
419 void ClearAbsolute(void);
420 sal_Bool
IsAbsolute(void);
422 void ClearAfter(void);
423 sal_Bool
IsAfter(void);
424 void SetBad(sal_Bool Bad
);
425 sal_Bool
IsBad(void);
426 void SetColumnDelta(sal_uInt8 ReferenceColumnID
, sal_uInt8 FormulaColumnID
);
430 LwpRowColumnQualifier cQualifier
;
434 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn
)
436 if (cQualifier
.IsBad())
440 if (cQualifier
.IsAbsolute())
442 if (cQualifier
.IsAfter())
443 return FormulaColumn
+ cColumn
;
444 return FormulaColumn
- cColumn
;
448 LwpColumnSpecifier::SetAbsolute(void)
450 cQualifier
.SetAbsolute();
454 LwpColumnSpecifier::ClearAbsolute(void)
456 cQualifier
.ClearAbsolute();
460 LwpColumnSpecifier::IsAbsolute()
462 return cQualifier
.IsAbsolute();
466 LwpColumnSpecifier::SetAfter(void)
468 cQualifier
.SetAfter();
472 LwpColumnSpecifier::ClearAfter(void)
474 cQualifier
.ClearAfter();
478 LwpColumnSpecifier::IsAfter()
480 return cQualifier
.IsAfter();
484 LwpColumnSpecifier::SetBad(sal_Bool Bad
)
486 cQualifier
.SetBad(Bad
);
490 LwpColumnSpecifier::IsBad()
492 return cQualifier
.IsBad();