Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / lotuswordpro / source / filter / lwptblcell.hxx
blobc6b8f58593cc8071d314e1bfb528cfb9177c1fb7
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;}
87 const LwpObjectID& GetValueID(){return cValue;}
89 virtual void Convert(XFCell * pCell, LwpTableLayout* pCellsMap=nullptr);
90 protected:
91 virtual ~LwpCellList();
93 sal_uInt8 cColumn;
94 LwpObjectID cParent;
96 void Read() override;
97 LwpObjectID cValue;
99 /**
100 * @brief
101 * VO_ROWLIST object
103 class LwpRowList : public LwpDLVList
105 public:
106 LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
108 void Parse(IXFStream* pOutputStream) override;
109 LwpObjectID GetChildHeadID(){return cChild.GetHead();}
110 LwpObjectID GetNextID(){return GetNext();}
111 sal_uInt16 GetRowID(){return cRowID;}
112 protected:
113 LwpDLVListHeadTail cChild;
114 LwpObjectID cParent;
115 sal_uInt16 cRowID;
116 void Read() override;
117 private:
118 virtual ~LwpRowList();
121 * @brief
122 * VO_NUMERICVALUE object
124 class LwpNumericValue : public LwpObject
126 public:
127 LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
129 double GetValue(){return cNumber;}
130 void Parse(IXFStream* pOutputStream) override;
131 protected:
132 double cNumber;
133 //LwpContent m_TheContent;
134 void Read() override;
135 private:
136 virtual ~LwpNumericValue();
140 * @brief
141 * VO_TABLERANGE object
143 class LwpTableRange: public LwpDLVList
145 public:
146 LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
148 void Parse(IXFStream* pOutputStream) override;
149 const LwpObjectID& GetCellRangeID(){return cpCellRange;}
150 const LwpObjectID& GetTableID(){ return cqTable;}
151 LwpTableRange* GetNext() { return dynamic_cast<LwpTableRange*>(LwpDLVList::GetNext().obj().get());}
152 protected:
153 LwpObjectID cqTable;
154 LwpObjectID cpCellRange;
155 void Read() override;
156 private:
157 virtual ~LwpTableRange();
160 * @brief
161 * VO_CELLRANGE object
163 class LwpCellRange: public LwpObject
165 public:
166 LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
168 void Parse(IXFStream* pOutputStream) override;
169 const LwpObjectID& GetFolderID(){return cpFolder;}
170 protected:
171 LwpObjectID cpFolder;
172 void Read() override;
173 private:
174 virtual ~LwpCellRange();
177 * @brief
178 * VO_FOLDER object
180 class LwpFolder: public LwpDLVList
182 public:
183 LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
185 void Parse(IXFStream* pOutputStream) override;
186 LwpObjectID GetChildHeadID(){ return cChild.GetHead();}
187 protected:
188 LwpDLVListHeadTail cChild;
189 LwpObjectID cParent;
190 LwpObjectID cqTable;
191 void Read() override;
192 private:
193 virtual ~LwpFolder();
196 * @brief
197 * VO_DEPENDENT object
199 class LwpDependent: public LwpDLVList
201 public:
202 LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
204 void Parse(IXFStream* pOutputStream) override;
205 protected:
206 void Read() override;
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.
219 private:
220 virtual ~LwpDependent();
224 * @brief
225 * row or column id
227 class LwpRowColumnQualifier
229 public:
230 LwpRowColumnQualifier();
231 ~LwpRowColumnQualifier(){}
233 bool IsAbsolute();
235 bool IsAfter();
237 bool IsBad();
239 void QuickRead(LwpObjectStream *pStrm);
241 private:
242 enum // cFlags bit definitions
244 REF_ABSOLUTE = 0x01,
245 REF_AFTER = 0x02,
246 REF_BAD = 0x04
248 sal_uInt8 cFlags;
251 inline
252 LwpRowColumnQualifier::LwpRowColumnQualifier()
254 cFlags = 0;
257 inline bool
258 LwpRowColumnQualifier::IsAfter()
260 return (cFlags & REF_AFTER) != 0;
263 inline bool
264 LwpRowColumnQualifier::IsBad()
266 return (cFlags & REF_BAD) != 0;
269 inline bool
270 LwpRowColumnQualifier::IsAbsolute()
272 return (cFlags & REF_ABSOLUTE) != 0;
275 * @brief
276 * row id
278 class LwpRowSpecifier
280 public:
281 LwpRowSpecifier()
282 : cRow(0)
284 ~LwpRowSpecifier(){}
286 void QuickRead(LwpObjectStream *pStrm);
288 sal_uInt16 RowID(sal_uInt16 FormulaRow);
290 private:
291 sal_uInt16 cRow;
292 LwpRowColumnQualifier cQualifier;
295 inline sal_uInt16
296 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow)
298 if (cQualifier.IsBad())
300 return 0xffff;
302 if (cQualifier.IsAbsolute())
303 return cRow;
305 if (cQualifier.IsAfter())
306 return FormulaRow + cRow;
307 return FormulaRow - cRow;
311 * @brief
312 * column id
314 class LwpColumnSpecifier
316 public:
317 LwpColumnSpecifier()
318 : cColumn(0)
320 ~LwpColumnSpecifier()
323 void QuickRead(LwpObjectStream *pStrm);
325 sal_uInt8 ColumnID(sal_uInt8 FormulaColumn);
327 private:
328 sal_uInt8 cColumn;
329 LwpRowColumnQualifier cQualifier;
332 inline sal_uInt8
333 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn)
335 if (cQualifier.IsBad())
337 return 0xff;
339 if (cQualifier.IsAbsolute())
340 return cColumn;
341 if (cQualifier.IsAfter())
342 return FormulaColumn + cColumn;
343 return FormulaColumn - cColumn;
346 #endif
348 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */