Bump version to 4.3-4
[LibreOffice.git] / lotuswordpro / source / filter / lwptblcell.hxx
blobd647ec817afae2a30ad08c63a71c45062463f546
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 INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
65 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_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) 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);
95 protected:
96 sal_uInt8 cColumn;
97 LwpObjectID cParent;
99 void Read() SAL_OVERRIDE;
100 LwpObjectID cValue;
103 * @brief
104 * VO_ROWLIST object
106 class LwpRowList : public LwpDLVList
108 public:
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;}
116 protected:
117 LwpDLVListHeadTail cChild;
118 LwpObjectID cParent;
119 sal_uInt16 cRowID;
120 void Read() SAL_OVERRIDE;
123 * @brief
124 * VO_NUMERICVALUE object
126 class LwpNumericValue : public LwpObject
128 public:
129 LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
130 virtual ~LwpNumericValue();
132 double GetValue(){return cNumber;}
133 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
134 protected:
135 double cNumber;
136 //LwpContent m_TheContent;
137 void Read() SAL_OVERRIDE;
141 * @brief
142 * VO_TABLERANGE object
144 class LwpTableRange: public LwpDLVList
146 public:
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());}
154 protected:
155 LwpObjectID cqTable;
156 LwpObjectID cpCellRange;
157 void Read() SAL_OVERRIDE;
160 * @brief
161 * VO_CELLRANGE object
163 class LwpCellRange: public LwpObject
165 public:
166 LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
167 virtual ~LwpCellRange();
169 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
170 LwpObjectID GetFolderID(){return cpFolder;}
171 protected:
172 LwpObjectID cpFolder;
173 void Read() SAL_OVERRIDE;
176 * @brief
177 * VO_FOLDER object
179 class LwpFolder: public LwpDLVList
181 public:
182 LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
183 virtual ~LwpFolder();
185 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
186 LwpObjectID GetChildHeadID(){ return *cChild.GetHead();}
187 protected:
188 LwpDLVListHeadTail cChild;
189 LwpObjectID cParent;
190 LwpObjectID cqTable;
191 void Read() SAL_OVERRIDE;
194 * @brief
195 * VO_DEPENDENT object
197 class LwpDependent: public LwpDLVList
199 public:
200 LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
201 virtual ~LwpDependent();
203 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
204 protected:
205 void Read() SAL_OVERRIDE;
206 LwpObjectID cFormulaInfo;
207 sal_uInt16 cReferenceOffset; // Used to fix dependent formula when we're
208 // dropped, sorted.
209 // Flags:
210 enum
212 START_CELL = 0x01,
213 END_CELL = 0x02,
214 REGISTERED = 0x04
216 sal_uInt8 cFlags; // Used to fix dependent formula when we're
217 // dropped, sorted.
221 * @brief
222 * row or column id
224 class LwpRowColumnQualifier
226 public:
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);
236 bool IsAfter(void);
238 void SetBad(bool Bad);
239 bool IsBad(void);
241 void QuickRead(LwpObjectStream *pStrm);
243 private:
244 enum // cFlags bit definitions
246 REF_ABSOLUTE = 0x01,
247 REF_AFTER = 0x02,
248 REF_BAD = 0x04
250 sal_uInt8 cFlags;
253 inline void
254 LwpRowColumnQualifier::SetAbsolute(void)
256 cFlags |= REF_ABSOLUTE;
259 inline void
260 LwpRowColumnQualifier::ClearAbsolute(void)
262 cFlags &= ~REF_ABSOLUTE;
265 inline void
266 LwpRowColumnQualifier::SetAfter(void)
268 cFlags |= REF_AFTER;
271 inline void
272 LwpRowColumnQualifier::ClearAfter(void)
274 cFlags &= ~REF_AFTER;
277 inline
278 LwpRowColumnQualifier::LwpRowColumnQualifier()
280 cFlags = 0;
283 inline bool
284 LwpRowColumnQualifier::IsAfter()
286 return cFlags & REF_AFTER ? sal_True : sal_False;
289 inline bool
290 LwpRowColumnQualifier::IsBad()
292 return cFlags & REF_BAD ? sal_True : sal_False;
295 inline bool
296 LwpRowColumnQualifier::IsAbsolute()
298 return cFlags & REF_ABSOLUTE ? sal_True : sal_False;
301 * @brief
302 * row id
304 class LwpRowSpecifier
306 public:
307 LwpRowSpecifier(void)
308 : cRow(0)
310 ~LwpRowSpecifier(){}
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);
322 void SetAfter(void);
323 void ClearAfter(void);
324 bool IsAfter(void);
326 void SetBad(bool Bad);
327 bool IsBad(void);
328 void SetRowDelta(sal_uInt16 ReferenceRowID, sal_uInt16 FormulaRowID);
330 private:
331 sal_uInt16 cRow;
332 LwpRowColumnQualifier cQualifier;
335 inline sal_uInt16
336 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow)
338 if (cQualifier.IsBad())
340 return 0xffff;
342 if (cQualifier.IsAbsolute())
343 return cRow;
345 if (cQualifier.IsAfter())
346 return FormulaRow + cRow;
347 return FormulaRow - cRow;
350 inline sal_uInt16 &
351 LwpRowSpecifier::Row()
353 return cRow;
356 inline void
357 LwpRowSpecifier::SetAbsolute(void)
359 cQualifier.SetAbsolute();
362 inline void
363 LwpRowSpecifier::ClearAbsolute(void)
365 cQualifier.ClearAbsolute();
368 inline bool
369 LwpRowSpecifier::IsAbsolute()
371 return cQualifier.IsAbsolute();
374 inline void
375 LwpRowSpecifier::SetAfter(void)
377 cQualifier.SetAfter();
380 inline void
381 LwpRowSpecifier::ClearAfter(void)
383 cQualifier.ClearAfter();
386 inline bool
387 LwpRowSpecifier::IsAfter()
389 return cQualifier.IsAfter();
392 inline void
393 LwpRowSpecifier::SetBad(bool Bad)
395 cQualifier.SetBad(Bad);
398 inline bool
399 LwpRowSpecifier::IsBad()
401 return cQualifier.IsBad();
404 * @brief
405 * column id
407 class LwpColumnSpecifier
409 public:
410 LwpColumnSpecifier(void)
411 : cColumn(0)
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);
424 void SetAfter(void);
425 void ClearAfter(void);
426 bool IsAfter(void);
427 void SetBad(bool Bad);
428 bool IsBad(void);
429 void SetColumnDelta(sal_uInt8 ReferenceColumnID, sal_uInt8 FormulaColumnID);
431 private:
432 sal_uInt8 cColumn;
433 LwpRowColumnQualifier cQualifier;
436 inline sal_uInt8
437 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn)
439 if (cQualifier.IsBad())
441 return 0xff;
443 if (cQualifier.IsAbsolute())
444 return cColumn;
445 if (cQualifier.IsAfter())
446 return FormulaColumn + cColumn;
447 return FormulaColumn - cColumn;
450 inline void
451 LwpColumnSpecifier::SetAbsolute(void)
453 cQualifier.SetAbsolute();
456 inline void
457 LwpColumnSpecifier::ClearAbsolute(void)
459 cQualifier.ClearAbsolute();
462 inline bool
463 LwpColumnSpecifier::IsAbsolute()
465 return cQualifier.IsAbsolute();
468 inline void
469 LwpColumnSpecifier::SetAfter(void)
471 cQualifier.SetAfter();
474 inline void
475 LwpColumnSpecifier::ClearAfter(void)
477 cQualifier.ClearAfter();
480 inline bool
481 LwpColumnSpecifier::IsAfter()
483 return cQualifier.IsAfter();
486 inline void
487 LwpColumnSpecifier::SetBad(bool Bad)
489 cQualifier.SetBad(Bad);
492 inline bool
493 LwpColumnSpecifier::IsBad()
495 return cQualifier.IsBad();
497 #endif
499 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */