bump product version to 4.1.6.2
[LibreOffice.git] / lotuswordpro / source / filter / lwptblcell.hxx
blob1ae5b67c7def236c74584f24cdc44ac4ba91a049
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,
29 * MA 02111-1307 USA
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 ************************************************************************/
56 /**
57 * @file
58 * For LWP filter architecture prototype - table object
60 /*************************************************************************
61 * Change History
62 Mar 2005 Created
63 ************************************************************************/
64 #ifndef _LWPLAYOUTNUMERICSOVERRIDE_HXX_
65 #define _LWPLAYOUTNUMERICSOVERRIDE_HXX_
67 #include "lwpobj.hxx"
68 #include "lwpatomholder.hxx"
69 #include "lwpstory.hxx"
71 #include "xfilter/xfcell.hxx"
73 // temporily added for compile
74 class LwpObject;
76 class LwpContent;
77 class LwpTableLayout;
78 /**
79 * @brief
80 * VO_CELLLIST object
82 class LwpCellList : public LwpDLVList
84 public:
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);
95 protected:
96 sal_uInt8 cColumn;
97 LwpObjectID cParent;
99 void Read();
100 LwpObjectID cValue;
103 * @brief
104 * VO_ROWLIST object
106 class LwpRowList : public LwpDLVList
108 public:
109 LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
110 ~LwpRowList();
112 void Parse(IXFStream* pOutputStream);
113 LwpObjectID GetChildHeadID(){return *cChild.GetHead();}
114 LwpObjectID GetNextID(){return *GetNext();}
115 sal_uInt16 GetRowID(){return cRowID;}
116 protected:
117 LwpDLVListHeadTail cChild;
118 LwpObjectID cParent;
119 sal_uInt16 cRowID;
120 void Read();
123 * @brief
124 * VO_NUMERICVALUE object
126 class LwpNumericValue : public LwpObject
128 public:
129 LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
130 ~LwpNumericValue();
132 double GetValue(){return cNumber;}
133 void Parse(IXFStream* pOutputStream);
134 protected:
135 double cNumber;
136 //LwpContent m_TheContent;
137 void Read();
140 ////////////////////////////////////////////////////////////////////////
142 * @brief
143 * VO_TABLERANGE object
145 class LwpTableRange: public LwpDLVList
147 public:
148 LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
149 ~LwpTableRange();
151 void Parse(IXFStream* pOutputStream);
152 LwpObjectID GetCellRangeID(){return cpCellRange;}
153 LwpObjectID GetTableID(){ return cqTable;}
154 LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext()->obj());}
155 protected:
156 LwpObjectID cqTable;
157 LwpObjectID cpCellRange;
158 void Read();
161 * @brief
162 * VO_CELLRANGE object
164 class LwpCellRange: public LwpObject
166 public:
167 LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
168 ~LwpCellRange();
170 void Parse(IXFStream* pOutputStream);
171 LwpObjectID GetFolderID(){return cpFolder;}
172 protected:
173 LwpObjectID cpFolder;
174 void Read();
177 * @brief
178 * VO_FOLDER object
180 class LwpFolder: public LwpDLVList
182 public:
183 LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
184 ~LwpFolder();
186 void Parse(IXFStream* pOutputStream);
187 LwpObjectID GetChildHeadID(){ return *cChild.GetHead();}
188 protected:
189 LwpDLVListHeadTail cChild;
190 LwpObjectID cParent;
191 LwpObjectID cqTable;
192 void Read();
195 * @brief
196 * VO_DEPENDENT object
198 class LwpDependent: public LwpDLVList
200 public:
201 LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
202 ~LwpDependent();
204 void Parse(IXFStream* pOutputStream);
205 protected:
206 void Read();
207 LwpObjectID cFormulaInfo;
208 sal_uInt16 cReferenceOffset; // Used to fix dependent formula when we're
209 // dropped, sorted.
210 // Flags:
211 enum
213 START_CELL = 0x01,
214 END_CELL = 0x02,
215 REGISTERED = 0x04
217 sal_uInt8 cFlags; // Used to fix dependent formula when we're
218 // dropped, sorted.
222 ///////////////////////////////////////////////////////////////
224 * @brief
225 * row or column id
227 class LwpRowColumnQualifier
229 public:
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);
246 private:
247 enum // cFlags bit definitions
249 REF_ABSOLUTE = 0x01,
250 REF_AFTER = 0x02,
251 REF_BAD = 0x04
253 sal_uInt8 cFlags;
256 inline void
257 LwpRowColumnQualifier::SetAbsolute(void)
259 cFlags |= REF_ABSOLUTE;
262 inline void
263 LwpRowColumnQualifier::ClearAbsolute(void)
265 cFlags &= ~REF_ABSOLUTE;
268 inline void
269 LwpRowColumnQualifier::SetAfter(void)
271 cFlags |= REF_AFTER;
274 inline void
275 LwpRowColumnQualifier::ClearAfter(void)
277 cFlags &= ~REF_AFTER;
280 inline
281 LwpRowColumnQualifier::LwpRowColumnQualifier()
283 cFlags = 0;
286 inline sal_Bool
287 LwpRowColumnQualifier::IsAfter()
289 return cFlags & REF_AFTER ? sal_True : sal_False;
292 inline sal_Bool
293 LwpRowColumnQualifier::IsBad()
295 return cFlags & REF_BAD ? sal_True : sal_False;
298 inline sal_Bool
299 LwpRowColumnQualifier::IsAbsolute()
301 return cFlags & REF_ABSOLUTE ? sal_True : sal_False;
304 * @brief
305 * row id
307 class LwpRowSpecifier
309 public:
310 LwpRowSpecifier(void){}
311 ~LwpRowSpecifier(){}
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);
323 void SetAfter(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);
331 private:
332 sal_uInt16 cRow;
333 LwpRowColumnQualifier cQualifier;
336 inline sal_uInt16
337 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow)
339 if (cQualifier.IsBad())
341 return 0xffff;
343 if (cQualifier.IsAbsolute())
344 return cRow;
346 if (cQualifier.IsAfter())
347 return FormulaRow + cRow;
348 return FormulaRow - cRow;
351 inline sal_uInt16 &
352 LwpRowSpecifier::Row()
354 return cRow;
357 inline void
358 LwpRowSpecifier::SetAbsolute(void)
360 cQualifier.SetAbsolute();
363 inline void
364 LwpRowSpecifier::ClearAbsolute(void)
366 cQualifier.ClearAbsolute();
369 inline sal_Bool
370 LwpRowSpecifier::IsAbsolute()
372 return cQualifier.IsAbsolute();
375 inline void
376 LwpRowSpecifier::SetAfter(void)
378 cQualifier.SetAfter();
381 inline void
382 LwpRowSpecifier::ClearAfter(void)
384 cQualifier.ClearAfter();
387 inline sal_Bool
388 LwpRowSpecifier::IsAfter()
390 return cQualifier.IsAfter();
393 inline void
394 LwpRowSpecifier::SetBad(sal_Bool Bad)
396 cQualifier.SetBad(Bad);
399 inline sal_Bool
400 LwpRowSpecifier::IsBad()
402 return cQualifier.IsBad();
405 * @brief
406 * column id
408 class LwpColumnSpecifier
410 public:
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);
422 void SetAfter(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);
429 private:
430 sal_uInt8 cColumn;
431 LwpRowColumnQualifier cQualifier;
434 inline sal_uInt8
435 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn)
437 if (cQualifier.IsBad())
439 return 0xff;
441 if (cQualifier.IsAbsolute())
442 return cColumn;
443 if (cQualifier.IsAfter())
444 return FormulaColumn + cColumn;
445 return FormulaColumn - cColumn;
448 inline void
449 LwpColumnSpecifier::SetAbsolute(void)
451 cQualifier.SetAbsolute();
454 inline void
455 LwpColumnSpecifier::ClearAbsolute(void)
457 cQualifier.ClearAbsolute();
460 inline sal_Bool
461 LwpColumnSpecifier::IsAbsolute()
463 return cQualifier.IsAbsolute();
466 inline void
467 LwpColumnSpecifier::SetAfter(void)
469 cQualifier.SetAfter();
472 inline void
473 LwpColumnSpecifier::ClearAfter(void)
475 cQualifier.ClearAfter();
478 inline sal_Bool
479 LwpColumnSpecifier::IsAfter()
481 return cQualifier.IsAfter();
484 inline void
485 LwpColumnSpecifier::SetBad(sal_Bool Bad)
487 cQualifier.SetBad(Bad);
490 inline sal_Bool
491 LwpColumnSpecifier::IsBad()
493 return cQualifier.IsBad();
495 #endif
497 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */