LibreOffice Module lotuswordpro (master) 1
lwpcelllayout.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_LWPCELLLAYOUT_HXX
62#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPCELLLAYOUT_HXX
63
64#include "lwplayout.hxx"
65#include <xfilter/xfcell.hxx>
66
67typedef enum
68{
75
76class XFCell;
77class XFCellStyle;
78class LwpCellList;
79class LwpTable;
80class LwpTableLayout;
86{
87public:
88 LwpCellLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
89 virtual ~LwpCellLayout() override;
90 virtual LWP_LAYOUT_TYPE GetLayoutType () override { return LWP_CELL_LAYOUT;}
91 rtl::Reference<XFCell> DoConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
92 {
94 throw std::runtime_error("recursion in page divisions");
95 m_bConvertCell = true;
96 rtl::Reference<XFCell> aRet = ConvertCell(aTableID, nRow, nCol);
97 m_bConvertCell = false;
98 return aRet;
99 }
100 sal_uInt16 GetRowID() const {return crowid;}
101 sal_uInt8 GetColID() const {return ccolid;}
102 void RegisterStyle() override;
105 virtual LwpPara* GetLastParaOfPreviousStory() override;
107 virtual void SetCellMap();
108 double GetActualWidth();
109 const OUString& GetNumfmtName() const {return m_NumfmtName;}
110protected:
111 void Read() override;
112 LwpTable * GetTable();
113 void ApplyPadding(XFCellStyle* pCellStyle);
114 void ApplyBorders(XFCellStyle* pCellStyle);
115 void ApplyPatternFill(XFCellStyle* pCellStyle);
116 void ApplyBackGround(XFCellStyle* pCellStyle);
117 void ApplyBackColor(XFCellStyle* pCellStyle);
118 void ApplyWatermark(XFCellStyle* pCellStyle);
119 void ApplyProtect(XFCell * pCell, LwpObjectID aTableID);
120 void ApplyFmtStyle(XFCellStyle *pCellStyle);
121 OUString const & GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
122 void RegisterDefaultCell();
123 virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
124 virtual rtl::Reference<XFCell> ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol);
125 static LwpCellLayout * GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
126 static sal_uInt16 GetLeftColID(sal_uInt16 nCol){return nCol - 1; };
127 virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow){return nRow + 1; };
128
130 sal_uInt16 crowid;
134
136 {
141 };
144
145 OUString m_NumfmtName;//Add to support number color
146};
147
153{
154public:
155 LwpHiddenCellLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
156 virtual ~LwpHiddenCellLayout() override;
158 virtual void Parse(IXFStream* pOutputStream) override;
159 void RegisterStyle() override {}
160 virtual void SetCellMap() override;
161private:
162 void Read() override;
163 virtual rtl::Reference<XFCell> ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override;
165};
166
172{
173public:
175 virtual ~LwpConnectedCellLayout() override;
177 virtual void Parse(IXFStream* pOutputStream) override;
178 sal_uInt16 GetNumrows() const {return m_nRealrowspan;}
180 virtual void SetCellMap() override;
181 void SetNumrows(sal_uInt16 nVal){m_nRealrowspan = nVal;}
182protected:
183 void Read() override;
184 virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow) override {return nRow + m_nRealrowspan; };
185 virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout) override;
186 virtual rtl::Reference<XFCell> ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override;
187private:
188 sal_uInt16 cnumrows;
190 sal_uInt16 m_nRealrowspan;
192};
199{
200public:
202 virtual ~LwpParallelColumnsBlock() override;
203protected:
204 void Read() override;
205
206};
207
208#endif
209
210/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
VO_CELLLAYOUT object.
virtual ~LwpCellLayout() override
sal_uInt16 crowid
LwpTableLayout * GetTableLayout()
Get table layout pointer, if default cell layout, return NULL.
virtual void SetCellMap()
Set current cell layout to cell layout map.
void ApplyBorders(XFCellStyle *pCellStyle)
Apply border to cell style according to cell position, default cell layout won't use this function.
static sal_uInt16 GetLeftColID(sal_uInt16 nCol)
LwpObjectID * GetPreviousCellStory()
Get previous cell which used for bullet inside cell.
LwpObjectID cLayDiagonalLine
void Read() override
Read cell layout.
sal_uInt8 ccolid
const OUString & GetNumfmtName() const
void ApplyPadding(XFCellStyle *pCellStyle)
Apply padding to cell style.
void RegisterDefaultCell()
Register table's default cell layout.
rtl::Reference< XFCell > DoConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
void ApplyPatternFill(XFCellStyle *pCellStyle)
Apply pattern fill to cell style.
LwpObjectID cLayNumerics
void ApplyProtect(XFCell *pCell, LwpObjectID aTableID)
Apply protect attribute to cell of table.
void RegisterStyle() override
Register 4 types of cell style and register content styles.
sal_uInt8 GetColID() const
virtual LwpPara * GetLastParaOfPreviousStory() override
OUString const & GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout *pTableLayout)
get style name according to cell position, only table default cells use this function
void ApplyFmtStyle(XFCellStyle *pCellStyle)
register style of cell layout
virtual rtl::Reference< XFCell > ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
Make the XFCell.
sal_uInt16 GetRowID() const
OUString m_CellStyleNames[enumCellBorderTopLimit]
OUString m_NumfmtName
LwpObjectID & GetNumericsObject()
virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout *pTableLayout)
judge border type by cell neighbour
double GetActualWidth()
Get actual width of this cell layout.
static LwpCellLayout * GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout *pTableLayout)
Get neighbour cell by specifying ROW+COL.
LeaderDotType cType
virtual LWP_LAYOUT_TYPE GetLayoutType() override
LwpCellLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void ApplyWatermark(XFCellStyle *pCellStyle)
Apply watermark to cell style.
void ApplyBackColor(XFCellStyle *pCellStyle)
Apply back color to cell style.
virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow)
void ApplyBackGround(XFCellStyle *pCellStyle)
Apply background to cell style.
LwpTable * GetTable()
Get table pointer, if default cell layout, return NULL.
VO_CELLLIST object.
Definition: lwptblcell.hxx:79
VO_CONNECTEDCELLLAYOUT object.
void Read() override
Read connected cell layout.
virtual LWP_LAYOUT_TYPE GetLayoutType() override
LwpConnectedCellLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void SetNumrows(sal_uInt16 nVal)
virtual ~LwpConnectedCellLayout() override
virtual void Parse(IXFStream *pOutputStream) override
parse connected cell layout
virtual rtl::Reference< XFCell > ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override
Make the XFCell.
virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow) override
sal_uInt8 GetNumcols() const
virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout *pTableLayout) override
judge border type by cell neighbour
virtual void SetCellMap() override
Set current connected cell layout to cell layout map.
sal_uInt16 GetNumrows() const
VO_HIDDENCELLLAYOUT object.
virtual LWP_LAYOUT_TYPE GetLayoutType() override
virtual ~LwpHiddenCellLayout() override
void Read() override
Read hidden cell layout.
LwpHiddenCellLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual void Parse(IXFStream *pOutputStream) override
parse hidden cell layout
void RegisterStyle() override
Register 4 types of cell style and register content styles.
virtual void SetCellMap() override
Set current hidden cell layout to cell layout map.
virtual rtl::Reference< XFCell > ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override
Convert hidden cell layout.
LwpObjectID cconnectedlayout
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
object id class
Definition: lwpobjid.hxx:79
VO_PCOLBLOCK object.
virtual ~LwpParallelColumnsBlock() override
LwpParallelColumnsBlock(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void Read() override
Read cell layout.
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
VO_TABLELAYOUT object and functions for registering styles and converting tables.
VO_TABLE object.
Definition: lwptable.hxx:107
@descr Style object for cell.
Definition: xfcellstyle.hxx:85
@descr Table cell object.
Definition: xfcell.hxx:76
LwpCellBorderType
@ enumNoLeftBorder
@ enumWholeBorder
@ enumCellBorderTopLimit
@ enumNoLeftNoBottomBorder
@ enumNoBottomBorder
unsigned char sal_uInt8