bump product version to 6.1.0.2
[LibreOffice.git] / lotuswordpro / source / filter / lwplaypiece.hxx
blob3f1e25d40454bdabc5a957b41bf032ef8eaf44ca
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
59 ************************************************************************/
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPLAYPIECE_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPLAYPIECE_HXX
64 #include "lwppiece.hxx"
65 #include <lwpbasetype.hxx>
66 #include "lwpmargins.hxx"
67 #include "lwpborderstuff.hxx"
68 #include "lwpshadow.hxx"
71 class LwpRotor
73 public:
74 LwpRotor();
75 ~LwpRotor();
76 void Read(LwpObjectStream *pStrm);
77 private:
78 sal_Int16 m_nRotation; //angle
81 class LwpLayoutGeometry final : public LwpVirtualPiece
83 public:
84 LwpLayoutGeometry(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
85 virtual void Parse(IXFStream* pOutputStream) override;
86 sal_Int32 GetWidth() { return m_nWidth; }
87 sal_Int32 GetHeight() { return m_nHeight; }
88 const LwpPoint& GetOrigin() { return m_Origin; }
89 const LwpPoint& GetAbsoluteOrigin() { return m_AbsoluteOrigin; }
90 sal_uInt8 GetContentOrientation(){ return m_ContentOrientation;}
92 private:
93 virtual void Read() override;
94 virtual ~LwpLayoutGeometry() override;
96 sal_Int32 m_nWidth;
97 sal_Int32 m_nHeight;
98 LwpPoint m_Origin;
99 LwpPoint m_AbsoluteOrigin;
100 LwpRotor m_ContainerRotor;
101 sal_uInt8 m_ContentOrientation;
104 class LwpLayoutScale final : public LwpVirtualPiece
106 public:
107 enum {ORIGINAL_SIZE = 1, FIT_IN_FRAME = 2, PERCENTAGE = 4,
108 CUSTOM = 8, MAINTAIN_ASPECT_RATIO = 16};
110 enum {CENTERED = 1, TILED = 2};
111 LwpLayoutScale(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
112 virtual void Parse(IXFStream* pOutputStream) override;
113 sal_uInt16 GetScaleMode(){return m_nScaleMode;}
114 sal_uInt32 GetScalePercentage(){return m_nScalePercentage;}
115 sal_Int32 GetScaleWidth(){return m_nScaleWidth;}
116 sal_Int32 GetScaleHeight(){return m_nScaleHeight;}
117 sal_uInt16 GetPlacement(){return m_nPlacement;}
118 LwpPoint& GetOffset() {return m_Offset;}
119 private:
120 virtual void Read() override;
121 virtual ~LwpLayoutScale() override;
123 sal_uInt16 m_nScaleMode;
124 sal_uInt32 m_nScalePercentage;
125 sal_Int32 m_nScaleWidth;
126 sal_Int32 m_nScaleHeight;
127 sal_uInt16 m_nContentRotation;
128 LwpPoint m_Offset;
129 sal_uInt16 m_nPlacement;
132 class LwpLayoutMargins final : public LwpVirtualPiece
134 public:
135 LwpLayoutMargins(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
136 virtual void Parse(IXFStream* pOutputStream) override;
137 LwpMargins& GetMargins() { return m_Margins; }
138 LwpMargins& GetExtMargins(){ return m_ExtMargins;}
139 private:
140 virtual void Read() override;
141 virtual ~LwpLayoutMargins() override;
143 LwpMargins m_Margins;
144 LwpMargins m_ExtMargins;
145 LwpMargins m_ExtraMargins;
148 class LwpLayoutBorder final : public LwpVirtualPiece
150 public:
151 LwpLayoutBorder(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
152 virtual void Parse(IXFStream* pOutputStream) override;
153 LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;}
154 private:
155 virtual void Read() override;
156 virtual ~LwpLayoutBorder() override;
158 LwpBorderStuff m_BorderStuff;
161 class LwpLayoutBackground final : public LwpVirtualPiece
163 public:
164 LwpLayoutBackground(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
165 virtual void Parse(IXFStream* pOutputStream) override;
166 LwpBackgroundStuff& GetBackgoudStuff(){return m_BackgroundStuff;}
167 private:
168 virtual void Read() override;
169 virtual ~LwpLayoutBackground() override;
171 LwpBackgroundStuff m_BackgroundStuff;
174 class LwpExternalBorder
176 public:
177 LwpExternalBorder();
178 ~LwpExternalBorder();
179 void Read(LwpObjectStream *pStrm);
180 private:
181 LwpAtomHolder m_LeftName;
182 LwpAtomHolder m_TopName;
183 LwpAtomHolder m_RightName;
184 LwpAtomHolder m_BottomName;
187 //It seems that this class is used for designer border. Only read now.
188 class LwpLayoutExternalBorder final : public LwpVirtualPiece
190 public:
191 LwpLayoutExternalBorder(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
192 virtual void Parse(IXFStream* pOutputStream) override;
193 private:
194 virtual void Read() override;
195 virtual ~LwpLayoutExternalBorder() override;
197 LwpExternalBorder m_ExtranalBorder;
200 class LwpColumnInfo
202 public:
203 LwpColumnInfo();
204 ~LwpColumnInfo();
205 void Read(LwpObjectStream *pStrm);
206 double GetWidth(){return LwpTools::ConvertFromUnitsToMetric(m_nWidth);}
207 double GetGap(){return LwpTools::ConvertFromUnitsToMetric(m_nGap);}
208 private:
209 sal_Int32 m_nWidth;
210 sal_Int32 m_nGap;
213 class LwpLayoutColumns final : public LwpVirtualPiece
215 public:
216 LwpLayoutColumns(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
217 virtual void Parse(IXFStream* pOutputStream) override;
218 sal_uInt16 GetNumCols(){return m_nNumCols;}
219 double GetColWidth(sal_uInt16 nIndex);
220 double GetColGap(sal_uInt16 nIndex);
221 private:
222 virtual void Read() override;
223 virtual ~LwpLayoutColumns() override;
225 sal_uInt16 m_nNumCols;
226 std::unique_ptr<LwpColumnInfo[]> m_pColumns;
229 class LwpLayoutGutters final : public LwpVirtualPiece
231 public:
232 LwpLayoutGutters(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
233 virtual void Parse(IXFStream* pOutputStream) override;
234 LwpBorderStuff& GetBorderStuff() { return m_BorderBuffer; }
235 private:
236 virtual void Read() override;
237 virtual ~LwpLayoutGutters() override;
239 LwpBorderStuff m_BorderBuffer;
242 class LwpJoinStuff
244 public:
245 LwpJoinStuff();
246 ~LwpJoinStuff();
247 void Read(LwpObjectStream *pStrm);
248 private:
249 sal_uInt16 m_nPercentage;
250 sal_uInt16 m_nCorners;
251 sal_Int32 m_nWidth;
252 sal_Int32 m_nHeight;
254 enum JoinType
256 MITRE = 1,
257 NEGATE = 2,
258 ROUNDED = 3,
259 RECTANGLE = 4,
260 SPECIAL = 5,
261 DIAGONAL = 6,
262 NEGATE_NO_CROSS = 7,
263 DOG_EAR_PAGE = 8,
264 DESKTOP = 9,
265 BOX_HIGHLIGHT = 10,
266 STAR = 11,
267 ROPE = 12,
268 DECO1 = 13,
269 DECO2 = 14,
270 RAIN = 15,
271 PIN = 16,
272 ROSE = 17,
273 SUNF = 18,
274 DECO3 = 19,
275 WARNING = 20,
276 BUBBLE = 21,
277 GIRDER = 22,
278 SMILE = 23,
279 ARROW = 24,
280 MAXJOIN = 24
283 sal_uInt16 m_nID;//JoinType
284 sal_uInt16 m_nScaling;
285 LwpColor m_Color;
288 class LwpLayoutJoins final : public LwpVirtualPiece
290 public:
291 LwpLayoutJoins(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
292 virtual void Parse(IXFStream* pOutputStream) override;
293 private:
294 virtual void Read() override;
295 virtual ~LwpLayoutJoins() override;
297 LwpJoinStuff m_JoinStuff;
300 class LwpLayoutShadow final : public LwpVirtualPiece
302 public:
303 LwpLayoutShadow(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
304 virtual void Parse(IXFStream* pOutputStream) override;
305 LwpShadow& GetShadow() { return m_Shadow; }
306 private:
307 virtual void Read() override;
308 virtual ~LwpLayoutShadow() override;
310 LwpShadow m_Shadow;
313 class LwpLayoutRelativityGuts
315 public:
316 LwpLayoutRelativityGuts();
317 void Read(LwpObjectStream *pStrm);
318 sal_uInt8 GetRelativeType(){ return m_nRelType;}
319 enum RelativeType
321 LAY_PARENT_RELATIVE = 1,
322 LAY_PARA_RELATIVE,
323 LAY_INLINE,
324 LAY_INLINE_NEWLINE,
325 LAY_CONTENT_RELATIVE,
326 LAY_INLINE_VERTICAL
328 enum WhereType
330 LAY_UPPERLEFT = 1,
331 LAY_MIDDLETOP,
332 LAY_UPPERRIGHT,
333 LAY_MIDDLELEFT,
334 LAY_MIDDLERIGHT,
335 LAY_LOWERLEFT,
336 LAY_MIDDLEBOTTOM,
337 LAY_LOWERRIGHT,
338 LAY_MIDDLE
340 enum TetherWhereType
342 LAY_INTERNAL = 1,
343 LAY_EXTERNAL,
344 LAY_BORDER
346 private:
347 sal_uInt8 m_nRelType;
348 sal_uInt8 m_nRelFromWhere;
349 LwpPoint m_RelDistance;
350 sal_uInt8 m_nTether;
351 sal_uInt8 m_nTetherWhere;
352 sal_uInt8 m_nFlags;
355 class LwpLayoutRelativity final : public LwpVirtualPiece
357 public:
358 LwpLayoutRelativity(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
359 virtual void Parse(IXFStream* pOutputStream) override;
360 LwpLayoutRelativityGuts& GetRelGuts() { return m_RelGuts; }
361 private:
362 virtual void Read() override;
363 virtual ~LwpLayoutRelativity() override;
365 LwpLayoutRelativityGuts m_RelGuts;
368 #endif
370 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */