cURL: follow redirects
[LibreOffice.git] / lotuswordpro / source / filter / lwptblcell.hxx
blob39f5ab8420d64aeb9227783ca143c143498ace57
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
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
64 #include "lwpobj.hxx"
65 #include "lwpatomholder.hxx"
66 #include "lwpstory.hxx"
68 #include "xfilter/xfcell.hxx"
70 // temporily added for compile
71 class LwpObject;
73 class LwpContent;
74 class LwpTableLayout;
75 /**
76 * @brief
77 * VO_CELLLIST object
79 class LwpCellList : public LwpDLVList
81 public:
82 LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
84 virtual void Parse(IXFStream* pOutputStream) override;
85 LwpObjectID GetNextID(){return GetNext();}
86 sal_uInt8 GetColumnID(){return cColumn;}
88 virtual void Convert(XFCell * pCell, LwpTableLayout* pCellsMap=nullptr);
89 protected:
90 virtual ~LwpCellList() override;
92 sal_uInt8 cColumn;
93 LwpObjectID cParent;
95 void Read() override;
96 LwpObjectID cValue;
98 /**
99 * @brief
100 * VO_ROWLIST object
102 class LwpRowList : public LwpDLVList
104 public:
105 LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
107 void Parse(IXFStream* pOutputStream) override;
108 LwpObjectID GetChildHeadID(){return cChild.GetHead();}
109 LwpObjectID GetNextID(){return GetNext();}
110 sal_uInt16 GetRowID(){return cRowID;}
111 protected:
112 LwpDLVListHeadTail cChild;
113 LwpObjectID cParent;
114 sal_uInt16 cRowID;
115 void Read() override;
116 private:
117 virtual ~LwpRowList() override;
120 * @brief
121 * VO_NUMERICVALUE object
123 class LwpNumericValue : public LwpObject
125 public:
126 LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
128 double GetValue(){return cNumber;}
129 void Parse(IXFStream* pOutputStream) override;
130 protected:
131 double cNumber;
132 //LwpContent m_TheContent;
133 void Read() override;
134 private:
135 virtual ~LwpNumericValue() override;
139 * @brief
140 * VO_TABLERANGE object
142 class LwpTableRange: public LwpDLVList
144 public:
145 LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
147 void Parse(IXFStream* pOutputStream) override;
148 const LwpObjectID& GetCellRangeID(){return cpCellRange;}
149 const LwpObjectID& GetTableID(){ return cqTable;}
150 LwpTableRange* GetNext() { return dynamic_cast<LwpTableRange*>(LwpDLVList::GetNext().obj().get());}
151 protected:
152 LwpObjectID cqTable;
153 LwpObjectID cpCellRange;
154 void Read() override;
155 private:
156 virtual ~LwpTableRange() override;
159 * @brief
160 * VO_CELLRANGE object
162 class LwpCellRange: public LwpObject
164 public:
165 LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
167 void Parse(IXFStream* pOutputStream) override;
168 const LwpObjectID& GetFolderID(){return cpFolder;}
169 protected:
170 LwpObjectID cpFolder;
171 void Read() override;
172 private:
173 virtual ~LwpCellRange() override;
176 * @brief
177 * VO_FOLDER object
179 class LwpFolder: public LwpDLVList
181 public:
182 LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
184 void Parse(IXFStream* pOutputStream) override;
185 LwpObjectID GetChildHeadID(){ return cChild.GetHead();}
186 protected:
187 LwpDLVListHeadTail cChild;
188 LwpObjectID cParent;
189 LwpObjectID cqTable;
190 void Read() override;
191 private:
192 virtual ~LwpFolder() override;
195 * @brief
196 * VO_DEPENDENT object
198 class LwpDependent: public LwpDLVList
200 public:
201 LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
203 void Parse(IXFStream* pOutputStream) override;
204 protected:
205 void Read() 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.
218 private:
219 virtual ~LwpDependent() override;
223 * @brief
224 * row or column id
226 class LwpRowColumnQualifier
228 public:
229 LwpRowColumnQualifier();
230 ~LwpRowColumnQualifier(){}
232 bool IsAbsolute();
234 bool IsAfter();
236 bool IsBad();
238 void QuickRead(LwpObjectStream *pStrm);
240 private:
241 enum // cFlags bit definitions
243 REF_ABSOLUTE = 0x01,
244 REF_AFTER = 0x02,
245 REF_BAD = 0x04
247 sal_uInt8 cFlags;
250 inline
251 LwpRowColumnQualifier::LwpRowColumnQualifier()
253 cFlags = 0;
256 inline bool
257 LwpRowColumnQualifier::IsAfter()
259 return (cFlags & REF_AFTER) != 0;
262 inline bool
263 LwpRowColumnQualifier::IsBad()
265 return (cFlags & REF_BAD) != 0;
268 inline bool
269 LwpRowColumnQualifier::IsAbsolute()
271 return (cFlags & REF_ABSOLUTE) != 0;
274 * @brief
275 * row id
277 class LwpRowSpecifier
279 public:
280 LwpRowSpecifier()
281 : cRow(0)
283 ~LwpRowSpecifier(){}
285 void QuickRead(LwpObjectStream *pStrm);
287 sal_uInt16 RowID(sal_uInt16 FormulaRow);
289 private:
290 sal_uInt16 cRow;
291 LwpRowColumnQualifier cQualifier;
294 inline sal_uInt16
295 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow)
297 if (cQualifier.IsBad())
299 return 0xffff;
301 if (cQualifier.IsAbsolute())
302 return cRow;
304 if (cQualifier.IsAfter())
305 return FormulaRow + cRow;
306 return FormulaRow - cRow;
310 * @brief
311 * column id
313 class LwpColumnSpecifier
315 public:
316 LwpColumnSpecifier()
317 : cColumn(0)
319 ~LwpColumnSpecifier()
322 void QuickRead(LwpObjectStream *pStrm);
324 sal_uInt8 ColumnID(sal_uInt8 FormulaColumn);
326 private:
327 sal_uInt8 cColumn;
328 LwpRowColumnQualifier cQualifier;
331 inline sal_uInt8
332 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn)
334 if (cQualifier.IsBad())
336 return 0xff;
338 if (cQualifier.IsAbsolute())
339 return cColumn;
340 if (cQualifier.IsAfter())
341 return FormulaColumn + cColumn;
342 return FormulaColumn - cColumn;
345 #endif
347 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */