cURL: follow redirects
[LibreOffice.git] / lotuswordpro / source / filter / lwpcelllayout.hxx
blobf1d87609f49ebe6db2ff7917989aa97ad2702988
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
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPCELLLAYOUT_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPCELLLAYOUT_HXX
63 #include <vector>
64 #include <map>
65 #include "lwplayout.hxx"
66 #include "lwptablelayout.hxx"
68 typedef enum
70 enumWholeBorder = 0,
71 enumNoLeftBorder,
72 enumNoBottomBorder,
73 enumNoLeftNoBottomBorder,
74 enumCellBorderTopLimit = 4,
75 } LwpCellBorderType;
77 class XFCell;
78 class XFCellStyle;
79 class LwpCellList;
80 class LwpTable;
81 class LwpTableLayout;
82 /**
83 * @brief
84 * VO_CELLLAYOUT object
86 class LwpCellLayout : public LwpMiddleLayout
88 public:
89 LwpCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
90 virtual ~LwpCellLayout() override;
91 virtual LWP_LAYOUT_TYPE GetLayoutType () override { return LWP_CELL_LAYOUT;}
92 virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol);
93 sal_uInt16 GetRowID(){return crowid;}
94 sal_uInt8 GetColID(){return ccolid;}
95 void RegisterStyle() override;
96 LwpObjectID& GetNumericsObject() {return cLayNumerics;}
97 LwpObjectID * GetPreviousCellStory();
98 virtual LwpPara* GetLastParaOfPreviousStory() override;
99 LwpTableLayout * GetTableLayout();
100 virtual void SetCellMap();
101 double GetActualWidth();
102 const OUString& GetNumfmtName(){return m_NumfmtName;}
103 protected:
104 void Read() override;
105 LwpTable * GetTable();
106 void ApplyPadding(XFCellStyle* pCellStyle);
107 void ApplyBorders(XFCellStyle* pCellStyle);
108 void ApplyPatternFill(XFCellStyle* pCellStyle);
109 void ApplyBackGround(XFCellStyle* pCellStyle);
110 void ApplyBackColor(XFCellStyle* pCellStyle);
111 void ApplyWatermark(XFCellStyle* pCellStyle);
112 void ApplyProtect(XFCell * pCell, LwpObjectID aTableID);
113 void ApplyFmtStyle(XFCellStyle *pCellStyle);
114 OUString const & GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
115 void RegisterDefaultCell();
116 virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
117 static LwpCellLayout * GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
118 static sal_uInt16 GetLeftColID(sal_uInt16 nCol){return nCol - 1; };
119 virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow){return nRow + 1; };
121 sal_uInt16 crowid;
122 sal_uInt8 ccolid;
123 LwpObjectID cLayNumerics;
124 LwpObjectID cLayDiagonalLine;
126 enum LeaderDotType
128 LDT_NONE = 0,
129 LDT_DOTS = 1,
130 LDT_DASHES = 2,
131 LDT_UNDERSCORES = 3
133 LeaderDotType cType;
134 OUString m_CellStyleNames[enumCellBorderTopLimit];
136 OUString m_NumfmtName;//Add to support number color
140 * @brief
141 * VO_HIDDENCELLLAYOUT object
143 class LwpHiddenCellLayout : public LwpCellLayout
145 public:
146 LwpHiddenCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
147 virtual ~LwpHiddenCellLayout() override;
148 virtual LWP_LAYOUT_TYPE GetLayoutType () override { return LWP_HIDDEN_CELL_LAYOUT;}
149 virtual void Parse(IXFStream* pOutputStream) override;
150 virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override;
151 void RegisterStyle() override {}
152 virtual void SetCellMap() override;
153 protected:
154 void Read() override;
155 LwpObjectID cconnectedlayout;
159 * @brief
160 * VO_CONNECTEDCELLLAYOUT object
162 class LwpConnectedCellLayout : public LwpCellLayout
164 public:
165 LwpConnectedCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
166 virtual ~LwpConnectedCellLayout() override;
167 virtual LWP_LAYOUT_TYPE GetLayoutType () override { return LWP_CONNECTED_CELL_LAYOUT;}
168 virtual void Parse(IXFStream* pOutputStream) override;
169 virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override;
170 sal_uInt16 GetNumrows(){return m_nRealrowspan;}
171 sal_uInt8 GetNumcols(){return m_nRealcolspan;}
172 virtual void SetCellMap() override;
173 void SetNumrows(sal_uInt16 nVal){m_nRealrowspan = nVal;}
174 protected:
175 void Read() override;
176 virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow) override {return nRow + m_nRealrowspan; };
177 virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout) override;
178 sal_uInt16 cnumrows;
179 sal_uInt8 cnumcols;
180 sal_uInt16 m_nRealrowspan;
181 sal_uInt8 m_nRealcolspan;
184 * @brief
185 * VO_PCOLBLOCK object
188 class LwpParallelColumnsBlock : public LwpCellLayout
190 public:
191 LwpParallelColumnsBlock(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
192 virtual ~LwpParallelColumnsBlock() override;
193 protected:
194 void Read() override;
198 #endif
200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */