bump product version to 4.1.6.2
[LibreOffice.git] / lotuswordpro / source / filter / lwpcelllayout.hxx
blob587e1354f97205d7ea7523b896098f5a5827d450
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 - cell layouts
60 /*************************************************************************
61 * Change History
62 Mar 2005 Created
63 ************************************************************************/
64 #ifndef _LWPCELLLAYOUT_HXX
65 #define _LWPCELLLAYOUT_HXX
66 #include <vector>
67 #include <map>
68 #include "lwplayout.hxx"
69 #include "lwptablelayout.hxx"
71 typedef enum
73 enumWholeBorder = 0,
74 enumNoLeftBorder,
75 enumNoBottomBorder,
76 enumNoLeftNoBottomBorder,
77 enumCellBorderTopLimit = 4,
78 } LwpCellBorderType;
81 class XFCell;
82 class XFCellStyle;
83 class LwpCellList;
84 class LwpTable;
85 class LwpTableLayout;
86 /**
87 * @brief
88 * VO_CELLLAYOUT object
90 class LwpCellLayout : public LwpMiddleLayout
92 public:
93 LwpCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
94 virtual ~LwpCellLayout();
95 virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_CELL_LAYOUT;}
96 virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol);
97 sal_uInt16 GetRowID(){return crowid;}
98 sal_uInt8 GetColID(){return ccolid;}
99 void RegisterStyle();
100 LwpObjectID * GetNumericsObject() {return &cLayNumerics;}
101 LwpObjectID * GetPreviousCellStory();
102 virtual LwpPara* GetLastParaOfPreviousStory();
103 LwpTableLayout * GetTableLayout();
104 virtual void SetCellMap(void);
105 double GetActualWidth();
106 OUString GetNumfmtName(){return m_NumfmtName;}
107 protected:
108 void Read();
109 LwpTable * GetTable();
110 void ApplyPadding(XFCellStyle* pCellStyle);
111 void ApplyBorders(XFCellStyle* pCellStyle);
112 void ApplyPatternFill(XFCellStyle* pCellStyle);
113 void ApplyBackGround(XFCellStyle* pCellStyle);
114 void ApplyBackColor(XFCellStyle* pCellStyle);
115 void ApplyWatermark(XFCellStyle* pCellStyle);
116 void ApplyProtect(XFCell * pCell, LwpObjectID aTableID);
117 void ApplyFmtStyle(XFCellStyle *pCellStyle);
118 OUString GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
119 void RegisterDefaultCell();
120 virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
121 LwpCellLayout * GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
122 virtual sal_uInt16 GetLeftColID(sal_uInt16 nCol){return nCol - 1; };
123 virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow){return nRow + 1; };
125 sal_uInt16 crowid;
126 sal_uInt8 ccolid;
127 LwpObjectID cLayNumerics;
128 LwpObjectID cLayDiagonalLine;
130 enum LeaderDotType
132 LDT_NONE = 0,
133 LDT_DOTS = 1,
134 LDT_DASHES = 2,
135 LDT_UNDERSCORES = 3
137 LeaderDotType cType;
138 OUString m_CellStyleNames[enumCellBorderTopLimit];
140 OUString m_NumfmtName;//Add to support number color
141 private:
142 LwpCellList* GetCellList(LwpFoundry* pFoundry, LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt8 nCol);
146 * @brief
147 * VO_HIDDENCELLLAYOUT object
149 class LwpHiddenCellLayout : public LwpCellLayout
151 public:
152 LwpHiddenCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
153 virtual ~LwpHiddenCellLayout();
154 virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_HIDDEN_CELL_LAYOUT;}
155 virtual void Parse(IXFStream* pOutputStream);
156 virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol);
157 void RegisterStyle(){}
158 virtual void SetCellMap(void);
159 protected:
160 void Read();
161 LwpObjectID cconnectedlayout;
165 * @brief
166 * VO_CONNECTEDCELLLAYOUT object
168 class LwpConnectedCellLayout : public LwpCellLayout
170 public:
171 LwpConnectedCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
172 virtual ~LwpConnectedCellLayout();
173 virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_CONNECTED_CELL_LAYOUT;}
174 virtual void Parse(IXFStream* pOutputStream);
175 virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol);
176 sal_uInt16 GetNumrows(){return m_nRealrowspan;}
177 sal_uInt8 GetNumcols(){return m_nRealcolspan;}
178 virtual void SetCellMap(void);
179 void SetNumrows(sal_uInt16 nVal){m_nRealrowspan = nVal;}
180 void SetNumcols(sal_uInt8 nVal){m_nRealcolspan = nVal;}
181 protected:
182 void Read();
183 virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow){return nRow + m_nRealrowspan; };
184 virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
185 sal_uInt16 cnumrows;
186 sal_uInt8 cnumcols;
187 // sal_Bool m_bSplitFlag;
188 sal_uInt16 m_nRealrowspan;
189 sal_uInt8 m_nRealcolspan;
192 * @brief
193 * VO_PCOLBLOCK object
196 class LwpParallelColumnsBlock : public LwpCellLayout
198 public:
199 LwpParallelColumnsBlock(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
200 virtual ~LwpParallelColumnsBlock();
201 protected:
202 void Read();
206 #endif
208 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */