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 _LWPLAYOUTNUMERICSOVERRIDE_HXX_
65 #define _LWPLAYOUTNUMERICSOVERRIDE_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
);
89 LwpObjectID
GetNextID(){return *GetNext();}
90 sal_uInt8
GetColumnID(){return cColumn
;}
91 virtual sal_Bool
IsFormula(){return sal_False
;}
92 LwpObjectID
GetValueID(){return cValue
;}
94 virtual void Convert(XFCell
* pCell
, LwpTableLayout
* pCellsMap
=NULL
);
106 class LwpRowList
: public LwpDLVList
109 LwpRowList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
112 void Parse(IXFStream
* pOutputStream
);
113 LwpObjectID
GetChildHeadID(){return *cChild
.GetHead();}
114 LwpObjectID
GetNextID(){return *GetNext();}
115 sal_uInt16
GetRowID(){return cRowID
;}
117 LwpDLVListHeadTail cChild
;
124 * VO_NUMERICVALUE object
126 class LwpNumericValue
: public LwpObject
129 LwpNumericValue(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
132 double GetValue(){return cNumber
;}
133 void Parse(IXFStream
* pOutputStream
);
136 //LwpContent m_TheContent;
140 ////////////////////////////////////////////////////////////////////////
143 * VO_TABLERANGE object
145 class LwpTableRange
: public LwpDLVList
148 LwpTableRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
151 void Parse(IXFStream
* pOutputStream
);
152 LwpObjectID
GetCellRangeID(){return cpCellRange
;}
153 LwpObjectID
GetTableID(){ return cqTable
;}
154 LwpTableRange
* GetNext() { return (LwpTableRange
*)(LwpDLVList::GetNext()->obj());}
157 LwpObjectID cpCellRange
;
162 * VO_CELLRANGE object
164 class LwpCellRange
: public LwpObject
167 LwpCellRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
170 void Parse(IXFStream
* pOutputStream
);
171 LwpObjectID
GetFolderID(){return cpFolder
;}
173 LwpObjectID cpFolder
;
180 class LwpFolder
: public LwpDLVList
183 LwpFolder(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
186 void Parse(IXFStream
* pOutputStream
);
187 LwpObjectID
GetChildHeadID(){ return *cChild
.GetHead();}
189 LwpDLVListHeadTail cChild
;
196 * VO_DEPENDENT object
198 class LwpDependent
: public LwpDLVList
201 LwpDependent(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
204 void Parse(IXFStream
* pOutputStream
);
207 LwpObjectID cFormulaInfo
;
208 sal_uInt16 cReferenceOffset
; // Used to fix dependent formula when we're
217 sal_uInt8 cFlags
; // Used to fix dependent formula when we're
222 ///////////////////////////////////////////////////////////////
227 class LwpRowColumnQualifier
230 LwpRowColumnQualifier(void);
231 ~LwpRowColumnQualifier(){}
233 inline void SetAbsolute(void);
234 inline void ClearAbsolute(void);
235 sal_Bool
IsAbsolute(void);
237 inline void SetAfter(void);
238 inline void ClearAfter(void);
239 sal_Bool
IsAfter(void);
241 void SetBad(sal_Bool Bad
);
242 sal_Bool
IsBad(void);
244 void QuickRead(LwpObjectStream
*pStrm
);
247 enum // cFlags bit definitions
257 LwpRowColumnQualifier::SetAbsolute(void)
259 cFlags
|= REF_ABSOLUTE
;
263 LwpRowColumnQualifier::ClearAbsolute(void)
265 cFlags
&= ~REF_ABSOLUTE
;
269 LwpRowColumnQualifier::SetAfter(void)
275 LwpRowColumnQualifier::ClearAfter(void)
277 cFlags
&= ~REF_AFTER
;
281 LwpRowColumnQualifier::LwpRowColumnQualifier()
287 LwpRowColumnQualifier::IsAfter()
289 return cFlags
& REF_AFTER
? sal_True
: sal_False
;
293 LwpRowColumnQualifier::IsBad()
295 return cFlags
& REF_BAD
? sal_True
: sal_False
;
299 LwpRowColumnQualifier::IsAbsolute()
301 return cFlags
& REF_ABSOLUTE
? sal_True
: sal_False
;
307 class LwpRowSpecifier
310 LwpRowSpecifier(void){}
313 void QuickRead(LwpObjectStream
*pStrm
);
314 String
ToString(sal_uInt16 nFormulaRow
);
316 sal_uInt16
RowID(sal_uInt16 FormulaRow
);
317 sal_uInt16
&Row(void);
319 void SetAbsolute(void);
320 void ClearAbsolute(void);
321 sal_Bool
IsAbsolute(void);
324 void ClearAfter(void);
325 sal_Bool
IsAfter(void);
327 void SetBad(sal_Bool Bad
);
328 sal_Bool
IsBad(void);
329 void SetRowDelta(sal_uInt16 ReferenceRowID
, sal_uInt16 FormulaRowID
);
333 LwpRowColumnQualifier cQualifier
;
337 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow
)
339 if (cQualifier
.IsBad())
343 if (cQualifier
.IsAbsolute())
346 if (cQualifier
.IsAfter())
347 return FormulaRow
+ cRow
;
348 return FormulaRow
- cRow
;
352 LwpRowSpecifier::Row()
358 LwpRowSpecifier::SetAbsolute(void)
360 cQualifier
.SetAbsolute();
364 LwpRowSpecifier::ClearAbsolute(void)
366 cQualifier
.ClearAbsolute();
370 LwpRowSpecifier::IsAbsolute()
372 return cQualifier
.IsAbsolute();
376 LwpRowSpecifier::SetAfter(void)
378 cQualifier
.SetAfter();
382 LwpRowSpecifier::ClearAfter(void)
384 cQualifier
.ClearAfter();
388 LwpRowSpecifier::IsAfter()
390 return cQualifier
.IsAfter();
394 LwpRowSpecifier::SetBad(sal_Bool Bad
)
396 cQualifier
.SetBad(Bad
);
400 LwpRowSpecifier::IsBad()
402 return cQualifier
.IsBad();
408 class LwpColumnSpecifier
411 LwpColumnSpecifier(void){}
412 ~LwpColumnSpecifier(){}
414 void QuickRead(LwpObjectStream
*pStrm
);
415 sal_uInt8
Column(){return cColumn
;}
416 String
ToString(sal_uInt8 nFormulaCol
);
418 sal_uInt8
ColumnID(sal_uInt8 FormulaColumn
);
419 void SetAbsolute(void);
420 void ClearAbsolute(void);
421 sal_Bool
IsAbsolute(void);
423 void ClearAfter(void);
424 sal_Bool
IsAfter(void);
425 void SetBad(sal_Bool Bad
);
426 sal_Bool
IsBad(void);
427 void SetColumnDelta(sal_uInt8 ReferenceColumnID
, sal_uInt8 FormulaColumnID
);
431 LwpRowColumnQualifier cQualifier
;
435 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn
)
437 if (cQualifier
.IsBad())
441 if (cQualifier
.IsAbsolute())
443 if (cQualifier
.IsAfter())
444 return FormulaColumn
+ cColumn
;
445 return FormulaColumn
- cColumn
;
449 LwpColumnSpecifier::SetAbsolute(void)
451 cQualifier
.SetAbsolute();
455 LwpColumnSpecifier::ClearAbsolute(void)
457 cQualifier
.ClearAbsolute();
461 LwpColumnSpecifier::IsAbsolute()
463 return cQualifier
.IsAbsolute();
467 LwpColumnSpecifier::SetAfter(void)
469 cQualifier
.SetAfter();
473 LwpColumnSpecifier::ClearAfter(void)
475 cQualifier
.ClearAfter();
479 LwpColumnSpecifier::IsAfter()
481 return cQualifier
.IsAfter();
485 LwpColumnSpecifier::SetBad(sal_Bool Bad
)
487 cQualifier
.SetBad(Bad
);
491 LwpColumnSpecifier::IsBad()
493 return cQualifier
.IsBad();
497 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */