tdf#131098 docx export: write fill property of graphic
[LibreOffice.git] / lotuswordpro / source / filter / lwptblcell.hxx
blobe9def931b93361374a4098bfc5686594d5c357a4
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 "lwpdlvlist.hxx"
67 #include <xfilter/xfcell.hxx>
69 // temporarily added for compile
70 class LwpObject;
72 class LwpContent;
73 class LwpTableLayout;
74 /**
75 * @brief
76 * VO_CELLLIST object
78 class LwpCellList : public LwpDLVList
80 public:
81 LwpCellList(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
83 virtual void Parse(IXFStream* pOutputStream) override;
84 LwpObjectID const & GetNextID(){return GetNext();}
85 sal_uInt8 GetColumnID() const {return cColumn;}
87 virtual void Convert(XFCell * pCell, LwpTableLayout* pCellsMap=nullptr);
88 protected:
89 virtual ~LwpCellList() override;
91 sal_uInt8 cColumn;
92 LwpObjectID cParent;
94 void Read() override;
95 LwpObjectID cValue;
97 /**
98 * @brief
99 * VO_ROWLIST object
101 class LwpRowList final : public LwpDLVList
103 public:
104 LwpRowList(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
106 void Parse(IXFStream* pOutputStream) override;
107 LwpObjectID const & GetChildHeadID(){return cChild.GetHead();}
108 LwpObjectID const & GetNextID(){return GetNext();}
109 sal_uInt16 GetRowID() const {return cRowID;}
110 private:
111 void Read() override;
112 virtual ~LwpRowList() override;
114 LwpDLVListHeadTail cChild;
115 LwpObjectID cParent;
116 sal_uInt16 cRowID;
119 * @brief
120 * VO_NUMERICVALUE object
122 class LwpNumericValue final : public LwpObject
124 public:
125 LwpNumericValue(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
127 double GetValue() const {return cNumber;}
128 void Parse(IXFStream* pOutputStream) override;
129 private:
130 void Read() override;
131 virtual ~LwpNumericValue() override;
133 double cNumber;
137 * @brief
138 * VO_TABLERANGE object
140 class LwpTableRange final : public LwpDLVList
142 public:
143 LwpTableRange(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
145 void Parse(IXFStream* pOutputStream) override;
146 const LwpObjectID& GetCellRangeID() const {return cpCellRange;}
147 const LwpObjectID& GetTableID() const { return cqTable;}
148 LwpTableRange* GetNext() { return dynamic_cast<LwpTableRange*>(LwpDLVList::GetNext().obj().get());}
149 private:
150 void Read() override;
151 virtual ~LwpTableRange() override;
153 LwpObjectID cqTable;
154 LwpObjectID cpCellRange;
157 * @brief
158 * VO_CELLRANGE object
160 class LwpCellRange final : public LwpObject
162 public:
163 LwpCellRange(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
165 void Parse(IXFStream* pOutputStream) override;
166 const LwpObjectID& GetFolderID() const {return cpFolder;}
167 private:
168 void Read() override;
169 virtual ~LwpCellRange() override;
171 LwpObjectID cpFolder;
174 * @brief
175 * VO_FOLDER object
177 class LwpFolder final : public LwpDLVList
179 public:
180 LwpFolder(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
182 void Parse(IXFStream* pOutputStream) override;
183 LwpObjectID const & GetChildHeadID(){ return cChild.GetHead();}
184 private:
185 void Read() override;
186 virtual ~LwpFolder() override;
188 LwpDLVListHeadTail cChild;
189 LwpObjectID cParent;
190 LwpObjectID cqTable;
193 * @brief
194 * VO_DEPENDENT object
196 class LwpDependent final : public LwpDLVList
198 public:
199 LwpDependent(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
201 void Parse(IXFStream* pOutputStream) override;
202 private:
203 void Read() override;
204 virtual ~LwpDependent() 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();
229 bool IsAbsolute() const;
231 bool IsAfter() const;
233 bool IsBad() const;
235 void QuickRead(LwpObjectStream *pStrm);
237 private:
238 enum // cFlags bit definitions
240 REF_ABSOLUTE = 0x01,
241 REF_AFTER = 0x02,
242 REF_BAD = 0x04
244 sal_uInt8 cFlags;
247 inline
248 LwpRowColumnQualifier::LwpRowColumnQualifier() : cFlags(0)
252 inline bool
253 LwpRowColumnQualifier::IsAfter() const
255 return (cFlags & REF_AFTER) != 0;
258 inline bool
259 LwpRowColumnQualifier::IsBad() const
261 return (cFlags & REF_BAD) != 0;
264 inline bool
265 LwpRowColumnQualifier::IsAbsolute() const
267 return (cFlags & REF_ABSOLUTE) != 0;
270 * @brief
271 * row id
273 class LwpRowSpecifier
275 public:
276 LwpRowSpecifier()
277 : cRow(0)
280 void QuickRead(LwpObjectStream *pStrm);
282 sal_uInt16 RowID(sal_uInt16 FormulaRow);
284 private:
285 sal_uInt16 cRow;
286 LwpRowColumnQualifier cQualifier;
289 inline sal_uInt16
290 LwpRowSpecifier::RowID(sal_uInt16 FormulaRow)
292 if (cQualifier.IsBad())
294 return 0xffff;
296 if (cQualifier.IsAbsolute())
297 return cRow;
299 if (cQualifier.IsAfter())
300 return FormulaRow + cRow;
301 return FormulaRow - cRow;
305 * @brief
306 * column id
308 class LwpColumnSpecifier
310 public:
311 LwpColumnSpecifier()
312 : cColumn(0)
315 void QuickRead(LwpObjectStream *pStrm);
317 sal_uInt8 ColumnID(sal_uInt8 FormulaColumn);
319 private:
320 sal_uInt8 cColumn;
321 LwpRowColumnQualifier cQualifier;
324 inline sal_uInt8
325 LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn)
327 if (cQualifier.IsBad())
329 return 0xff;
331 if (cQualifier.IsAbsolute())
332 return cColumn;
333 if (cQualifier.IsAfter())
334 return FormulaColumn + cColumn;
335 return FormulaColumn - cColumn;
338 #endif
340 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */