fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / lotuswordpro / source / filter / lwptblcell.hxx
blob2a2273cb153dffa117d851210ec17316a6a2f5e7
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);
87 virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
88 LwpObjectID GetNextID(){return GetNext();}
89 sal_uInt8 GetColumnID(){return cColumn;}
90 virtual bool IsFormula(){return false;}
91 LwpObjectID GetValueID(){return cValue;}
93 virtual void Convert(XFCell * pCell, LwpTableLayout* pCellsMap=NULL);
94 protected:
95 virtual ~LwpCellList();
97 sal_uInt8 cColumn;
98 LwpObjectID cParent;
100 void Read() SAL_OVERRIDE;
101 LwpObjectID cValue;
104 * @brief
105 * VO_ROWLIST object
107 class LwpRowList : public LwpDLVList
109 public:
110 LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
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;
121 private:
122 virtual ~LwpRowList();
125 * @brief
126 * VO_NUMERICVALUE object
128 class LwpNumericValue : public LwpObject
130 public:
131 LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
133 double GetValue(){return cNumber;}
134 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
135 protected:
136 double cNumber;
137 //LwpContent m_TheContent;
138 void Read() SAL_OVERRIDE;
139 private:
140 virtual ~LwpNumericValue();
144 * @brief
145 * VO_TABLERANGE object
147 class LwpTableRange: public LwpDLVList
149 public:
150 LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
152 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
153 LwpObjectID GetCellRangeID(){return cpCellRange;}
154 LwpObjectID GetTableID(){ return cqTable;}
155 LwpTableRange* GetNext() { return static_cast<LwpTableRange*>(LwpDLVList::GetNext().obj().get());}
156 protected:
157 LwpObjectID cqTable;
158 LwpObjectID cpCellRange;
159 void Read() SAL_OVERRIDE;
160 private:
161 virtual ~LwpTableRange();
164 * @brief
165 * VO_CELLRANGE object
167 class LwpCellRange: public LwpObject
169 public:
170 LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
172 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
173 LwpObjectID GetFolderID(){return cpFolder;}
174 protected:
175 LwpObjectID cpFolder;
176 void Read() SAL_OVERRIDE;
177 private:
178 virtual ~LwpCellRange();
181 * @brief
182 * VO_FOLDER object
184 class LwpFolder: public LwpDLVList
186 public:
187 LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
189 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
190 LwpObjectID GetChildHeadID(){ return cChild.GetHead();}
191 protected:
192 LwpDLVListHeadTail cChild;
193 LwpObjectID cParent;
194 LwpObjectID cqTable;
195 void Read() SAL_OVERRIDE;
196 private:
197 virtual ~LwpFolder();
200 * @brief
201 * VO_DEPENDENT object
203 class LwpDependent: public LwpDLVList
205 public:
206 LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
208 void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
209 protected:
210 void Read() SAL_OVERRIDE;
211 LwpObjectID cFormulaInfo;
212 sal_uInt16 cReferenceOffset; // Used to fix dependent formula when we're
213 // dropped, sorted.
214 // Flags:
215 enum
217 START_CELL = 0x01,
218 END_CELL = 0x02,
219 REGISTERED = 0x04
221 sal_uInt8 cFlags; // Used to fix dependent formula when we're
222 // dropped, sorted.
223 private:
224 virtual ~LwpDependent();
228 * @brief
229 * row or column id
231 class LwpRowColumnQualifier
233 public:
234 LwpRowColumnQualifier();
235 ~LwpRowColumnQualifier(){}
237 inline void SetAbsolute();
238 inline void ClearAbsolute();
239 bool IsAbsolute();
241 inline void SetAfter();
242 inline void ClearAfter();
243 bool IsAfter();
245 void SetBad(bool Bad);
246 bool IsBad();
248 void QuickRead(LwpObjectStream *pStrm);
250 private:
251 enum // cFlags bit definitions
253 REF_ABSOLUTE = 0x01,
254 REF_AFTER = 0x02,
255 REF_BAD = 0x04
257 sal_uInt8 cFlags;
260 inline void
261 LwpRowColumnQualifier::SetAbsolute()
263 cFlags |= REF_ABSOLUTE;
266 inline void
267 LwpRowColumnQualifier::ClearAbsolute()
269 cFlags &= ~REF_ABSOLUTE;
272 inline void
273 LwpRowColumnQualifier::SetAfter()
275 cFlags |= REF_AFTER;
278 inline void
279 LwpRowColumnQualifier::ClearAfter()
281 cFlags &= ~REF_AFTER;
284 inline
285 LwpRowColumnQualifier::LwpRowColumnQualifier()
287 cFlags = 0;
290 inline bool
291 LwpRowColumnQualifier::IsAfter()
293 return (cFlags & REF_AFTER) != 0;
296 inline bool
297 LwpRowColumnQualifier::IsBad()
299 return (cFlags & REF_BAD) != 0;
302 inline bool
303 LwpRowColumnQualifier::IsAbsolute()
305 return (cFlags & REF_ABSOLUTE) != 0;
308 * @brief
309 * row id
311 class LwpRowSpecifier
313 public:
314 LwpRowSpecifier()
315 : cRow(0)
317 ~LwpRowSpecifier(){}
319 void QuickRead(LwpObjectStream *pStrm);
320 OUString ToString(sal_uInt16 nFormulaRow);
322 sal_uInt16 RowID(sal_uInt16 FormulaRow);
323 sal_uInt16 &Row();
325 void SetAbsolute();
326 void ClearAbsolute();
327 bool IsAbsolute();
329 void SetAfter();
330 void ClearAfter();
331 bool IsAfter();
333 void SetBad(bool Bad);
334 bool IsBad();
335 void SetRowDelta(sal_uInt16 ReferenceRowID, sal_uInt16 FormulaRowID);
337 private:
338 sal_uInt16 cRow;
339 LwpRowColumnQualifier cQualifier;
342 inline sal_uInt16
343 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow)
345 if (cQualifier.IsBad())
347 return 0xffff;
349 if (cQualifier.IsAbsolute())
350 return cRow;
352 if (cQualifier.IsAfter())
353 return FormulaRow + cRow;
354 return FormulaRow - cRow;
357 inline sal_uInt16 &
358 LwpRowSpecifier::Row()
360 return cRow;
363 inline void
364 LwpRowSpecifier::SetAbsolute()
366 cQualifier.SetAbsolute();
369 inline void
370 LwpRowSpecifier::ClearAbsolute()
372 cQualifier.ClearAbsolute();
375 inline bool
376 LwpRowSpecifier::IsAbsolute()
378 return cQualifier.IsAbsolute();
381 inline void
382 LwpRowSpecifier::SetAfter()
384 cQualifier.SetAfter();
387 inline void
388 LwpRowSpecifier::ClearAfter()
390 cQualifier.ClearAfter();
393 inline bool
394 LwpRowSpecifier::IsAfter()
396 return cQualifier.IsAfter();
399 inline void
400 LwpRowSpecifier::SetBad(bool Bad)
402 cQualifier.SetBad(Bad);
405 inline bool
406 LwpRowSpecifier::IsBad()
408 return cQualifier.IsBad();
411 * @brief
412 * column id
414 class LwpColumnSpecifier
416 public:
417 LwpColumnSpecifier()
418 : cColumn(0)
420 ~LwpColumnSpecifier()
423 void QuickRead(LwpObjectStream *pStrm);
424 sal_uInt8 Column(){return cColumn;}
425 OUString ToString(sal_uInt8 nFormulaCol);
427 sal_uInt8 ColumnID(sal_uInt8 FormulaColumn);
428 void SetAbsolute();
429 void ClearAbsolute();
430 bool IsAbsolute();
431 void SetAfter();
432 void ClearAfter();
433 bool IsAfter();
434 void SetBad(bool Bad);
435 bool IsBad();
436 void SetColumnDelta(sal_uInt8 ReferenceColumnID, sal_uInt8 FormulaColumnID);
438 private:
439 sal_uInt8 cColumn;
440 LwpRowColumnQualifier cQualifier;
443 inline sal_uInt8
444 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn)
446 if (cQualifier.IsBad())
448 return 0xff;
450 if (cQualifier.IsAbsolute())
451 return cColumn;
452 if (cQualifier.IsAfter())
453 return FormulaColumn + cColumn;
454 return FormulaColumn - cColumn;
457 inline void
458 LwpColumnSpecifier::SetAbsolute()
460 cQualifier.SetAbsolute();
463 inline void
464 LwpColumnSpecifier::ClearAbsolute()
466 cQualifier.ClearAbsolute();
469 inline bool
470 LwpColumnSpecifier::IsAbsolute()
472 return cQualifier.IsAbsolute();
475 inline void
476 LwpColumnSpecifier::SetAfter()
478 cQualifier.SetAfter();
481 inline void
482 LwpColumnSpecifier::ClearAfter()
484 cQualifier.ClearAfter();
487 inline bool
488 LwpColumnSpecifier::IsAfter()
490 return cQualifier.IsAfter();
493 inline void
494 LwpColumnSpecifier::SetBad(bool Bad)
496 cQualifier.SetBad(Bad);
499 inline bool
500 LwpColumnSpecifier::IsBad()
502 return cQualifier.IsBad();
504 #endif
506 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */