LibreOffice Module lotuswordpro (master) 1
lwptblcell.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
6 *
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
9 *
10 * Sun Microsystems Inc., October, 2000
11 *
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
16 *
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.
20 *
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.
25 *
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
30 *
31 *
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.
38 *
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.
45 *
46 * The Initial Developer of the Original Code is: IBM Corporation
47 *
48 * Copyright: 2008 by IBM Corporation
49 *
50 * All Rights Reserved.
51 *
52 * Contributor(s): _______________________________________
53 *
54 *
55 ************************************************************************/
61#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
62#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
63
64#include <lwpobj.hxx>
65#include "lwpdlvlist.hxx"
66
67#include <xfilter/xfcell.hxx>
68
69// temporarily added for compile
70class LwpObject;
71
72class LwpContent;
73class LwpTableLayout;
78class LwpCellList : public LwpDLVList
79{
80public:
81 LwpCellList(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
82
83 virtual void Parse(IXFStream* pOutputStream) override;
84 LwpObjectID const & GetNextID(){return GetNext();}
85 sal_uInt8 GetColumnID() const {return cColumn;}
86
87 virtual void Convert(XFCell * pCell, LwpTableLayout* pCellsMap=nullptr);
88protected:
89 virtual ~LwpCellList() override;
90
93
94 void Read() override;
96};
101class LwpRowList final : public LwpDLVList
102{
103public:
104 LwpRowList(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
105
106 void Parse(IXFStream* pOutputStream) override;
108 LwpObjectID const & GetNextID(){return GetNext();}
109 sal_uInt16 GetRowID() const {return cRowID;}
110private:
111 void Read() override;
112 virtual ~LwpRowList() override;
113
116 sal_uInt16 cRowID;
117};
122class LwpNumericValue final : public LwpObject
123{
124public:
125 LwpNumericValue(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
126
127 double GetValue() const {return cNumber;}
128 void Parse(IXFStream* pOutputStream) override;
129private:
130 void Read() override;
131 virtual ~LwpNumericValue() override;
132
133 double cNumber;
134};
135
140class LwpTableRange final : public LwpDLVList
141{
142public:
143 LwpTableRange(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
144
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());}
149private:
150 void Read() override;
151 virtual ~LwpTableRange() override;
152
155};
160class LwpCellRange final : public LwpObject
161{
162public:
163 LwpCellRange(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
164
165 void Parse(IXFStream* pOutputStream) override;
166 const LwpObjectID& GetFolderID() const {return cpFolder;}
167private:
168 void Read() override;
169 virtual ~LwpCellRange() override;
170
172};
177class LwpFolder final : public LwpDLVList
178{
179public:
180 LwpFolder(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
181
182 void Parse(IXFStream* pOutputStream) override;
184private:
185 void Read() override;
186 virtual ~LwpFolder() override;
187
191};
196class LwpDependent final : public LwpDLVList
197{
198public:
199 LwpDependent(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
200
201 void Parse(IXFStream* pOutputStream) override;
202private:
203 void Read() override;
204 virtual ~LwpDependent() override;
205
207 sal_uInt16 cReferenceOffset; // Used to fix dependent formula when we're
208 // dropped, sorted.
209 // Flags:
210 enum
211 {
213 END_CELL = 0x02,
214 REGISTERED = 0x04
215 };
216 sal_uInt8 cFlags; // Used to fix dependent formula when we're
217 // dropped, sorted.
218};
219
225{
226public:
228
229 bool IsAbsolute() const;
230
231 bool IsAfter() const;
232
233 bool IsBad() const;
234
235 void QuickRead(LwpObjectStream *pStrm);
236
237private:
238 enum // cFlags bit definitions
239 {
241 REF_AFTER = 0x02,
242 REF_BAD = 0x04
243 };
245};
246
247inline
249{
250}
251
252inline bool
254{
255 return (cFlags & REF_AFTER) != 0;
256}
257
258inline bool
260{
261 return (cFlags & REF_BAD) != 0;
262}
263
264inline bool
266{
267 return (cFlags & REF_ABSOLUTE) != 0;
268}
274{
275public:
277 : cRow(0)
278 {}
279
280 void QuickRead(LwpObjectStream *pStrm);
281
282 sal_uInt16 RowID(sal_uInt16 FormulaRow);
283
284private:
285 sal_uInt16 cRow;
287};
288
289inline sal_uInt16
290LwpRowSpecifier::RowID(sal_uInt16 FormulaRow)
291{
292 if (cQualifier.IsBad())
293 {
294 return 0xffff;
295 }
297 return cRow;
298
299 if (cQualifier.IsAfter())
300 return FormulaRow + cRow;
301 return FormulaRow - cRow;
302}
303
309{
310public:
312 : cColumn(0)
313 {}
314
315 void QuickRead(LwpObjectStream *pStrm);
316
317 sal_uInt8 ColumnID(sal_uInt8 FormulaColumn);
318
319private:
322};
323
324inline sal_uInt8
326{
327 if (cQualifier.IsBad())
328 {
329 return 0xff;
330 }
332 return cColumn;
333 if (cQualifier.IsAfter())
334 return FormulaColumn + cColumn;
335 return FormulaColumn - cColumn;
336}
337
338#endif
339
340/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
VO_CELLLIST object.
Definition: lwptblcell.hxx:79
LwpObjectID cValue
Definition: lwptblcell.hxx:95
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwptblcell.cxx:97
sal_uInt8 GetColumnID() const
Definition: lwptblcell.hxx:85
virtual ~LwpCellList() override
Definition: lwptblcell.cxx:71
LwpObjectID const & GetNextID()
Definition: lwptblcell.hxx:84
LwpObjectID cParent
Definition: lwptblcell.hxx:92
void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwptblcell.cxx:73
sal_uInt8 cColumn
Definition: lwptblcell.hxx:91
virtual void Convert(XFCell *pCell, LwpTableLayout *pCellsMap=nullptr)
Definition: lwptblcell.cxx:99
LwpCellList(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwptblcell.cxx:65
VO_CELLRANGE object.
Definition: lwptblcell.hxx:161
void Read() override
@descr default read function
Definition: lwptblcell.cxx:175
void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwptblcell.cxx:181
LwpCellRange(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwptblcell.cxx:168
LwpObjectID cpFolder
Definition: lwptblcell.hxx:171
const LwpObjectID & GetFolderID() const
Definition: lwptblcell.hxx:166
virtual ~LwpCellRange() override
Definition: lwptblcell.cxx:173
sal_uInt8 ColumnID(sal_uInt8 FormulaColumn)
Definition: lwptblcell.hxx:325
void QuickRead(LwpObjectStream *pStrm)
Definition: lwptblcell.cxx:234
LwpRowColumnQualifier cQualifier
Definition: lwptblcell.hxx:321
Base class of all Lwp content objects.
Definition: lwpcontent.hxx:74
Double Linked Virtual List Head Tail.
Definition: lwpdlvlist.hxx:138
LwpObjectID & GetHead()
Definition: lwpdlvlist.hxx:148
Double Linked Virtual List.
Definition: lwpdlvlist.hxx:72
LwpObjectID & GetNext()
Definition: lwpdlvlist.hxx:75
VO_DEPENDENT object.
Definition: lwptblcell.hxx:197
sal_uInt16 cReferenceOffset
Definition: lwptblcell.hxx:207
LwpObjectID cFormulaInfo
Definition: lwptblcell.hxx:206
LwpDependent(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwptblcell.cxx:207
sal_uInt8 cFlags
Definition: lwptblcell.hxx:216
void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwptblcell.cxx:227
void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwptblcell.cxx:216
virtual ~LwpDependent() override
Definition: lwptblcell.cxx:214
VO_FOLDER object.
Definition: lwptblcell.hxx:178
void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwptblcell.cxx:205
LwpObjectID const & GetChildHeadID()
Definition: lwptblcell.hxx:183
LwpObjectID cParent
Definition: lwptblcell.hxx:189
LwpFolder(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwptblcell.cxx:183
void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwptblcell.cxx:190
virtual ~LwpFolder() override
Definition: lwptblcell.cxx:188
LwpDLVListHeadTail cChild
Definition: lwptblcell.hxx:188
LwpObjectID cqTable
Definition: lwptblcell.hxx:190
VO_NUMERICVALUE object.
Definition: lwptblcell.hxx:123
LwpNumericValue(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwptblcell.cxx:109
void Read() override
@descr default read function
Definition: lwptblcell.cxx:117
virtual ~LwpNumericValue() override
Definition: lwptblcell.cxx:115
double GetValue() const
Definition: lwptblcell.hxx:127
void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwptblcell.cxx:123
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
object id class
Definition: lwpobjid.hxx:79
rtl::Reference< LwpObject > obj(VO_TYPE tag=VO_INVALID) const
@descr get object from object factory per the object id
Definition: lwpobjid.cxx:183
stream class for LwpObject body data provide stream like interface to read object data
Definition: lwpobjstrm.hxx:77
Base class of all Lwp VO objects.
Definition: lwpobj.hxx:83
row or column id
Definition: lwptblcell.hxx:225
bool IsAbsolute() const
Definition: lwptblcell.hxx:265
void QuickRead(LwpObjectStream *pStrm)
Definition: lwptblcell.cxx:240
bool IsAfter() const
Definition: lwptblcell.hxx:253
VO_ROWLIST object.
Definition: lwptblcell.hxx:102
LwpObjectID cParent
Definition: lwptblcell.hxx:115
void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwptblcell.cxx:133
sal_uInt16 GetRowID() const
Definition: lwptblcell.hxx:109
void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwptblcell.cxx:148
LwpObjectID const & GetChildHeadID()
Definition: lwptblcell.hxx:107
LwpObjectID const & GetNextID()
Definition: lwptblcell.hxx:108
LwpRowList(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwptblcell.cxx:125
virtual ~LwpRowList() override
Definition: lwptblcell.cxx:131
sal_uInt16 cRowID
Definition: lwptblcell.hxx:116
LwpDLVListHeadTail cChild
Definition: lwptblcell.hxx:114
void QuickRead(LwpObjectStream *pStrm)
Definition: lwptblcell.cxx:229
sal_uInt16 RowID(sal_uInt16 FormulaRow)
Definition: lwptblcell.hxx:290
sal_uInt16 cRow
Definition: lwptblcell.hxx:285
LwpRowColumnQualifier cQualifier
Definition: lwptblcell.hxx:286
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
VO_TABLELAYOUT object and functions for registering styles and converting tables.
VO_TABLERANGE object.
Definition: lwptblcell.hxx:141
LwpTableRange * GetNext()
Definition: lwptblcell.hxx:148
const LwpObjectID & GetTableID() const
Definition: lwptblcell.hxx:147
LwpObjectID cqTable
Definition: lwptblcell.hxx:153
void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwptblcell.cxx:166
LwpObjectID cpCellRange
Definition: lwptblcell.hxx:154
void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwptblcell.cxx:157
const LwpObjectID & GetCellRangeID() const
Definition: lwptblcell.hxx:146
virtual ~LwpTableRange() override
Definition: lwptblcell.cxx:155
LwpTableRange(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwptblcell.cxx:150
@descr Table cell object.
Definition: xfcell.hxx:76
Base class of all Lwp VO objects.
unsigned char sal_uInt8