build fix
[LibreOffice.git] / lotuswordpro / source / filter / lwplaypiece.hxx
blob0eb7f40b17b382d6e809305db79b56b39f43ef8d
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 : public LwpVirtualPiece
83 public:
84 LwpLayoutGeometry(LwpObjectHeader& 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 protected:
93 virtual void Read() override;
94 protected:
95 sal_Int32 m_nWidth;
96 sal_Int32 m_nHeight;
97 LwpPoint m_Origin;
98 LwpPoint m_AbsoluteOrigin;
99 LwpRotor m_ContainerRotor;
100 sal_uInt8 m_ContentOrientation;
101 private:
102 virtual ~LwpLayoutGeometry() override;
105 class LwpLayoutScale : public LwpVirtualPiece
107 public:
108 enum {ORIGINAL_SIZE = 1, FIT_IN_FRAME = 2, PERCENTAGE = 4,
109 CUSTOM = 8, MAINTAIN_ASPECT_RATIO = 16};
111 enum {CENTERED = 1, TILED = 2};
112 LwpLayoutScale(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
113 virtual void Parse(IXFStream* pOutputStream) override;
114 sal_uInt16 GetScaleMode(){return m_nScaleMode;}
115 sal_uInt32 GetScalePercentage(){return m_nScalePercentage;}
116 sal_Int32 GetScaleWidth(){return m_nScaleWidth;}
117 sal_Int32 GetScaleHeight(){return m_nScaleHeight;}
118 sal_uInt16 GetPlacement(){return m_nPlacement;}
119 inline LwpPoint& GetOffset() {return m_Offset;}
120 protected:
121 virtual void Read() override;
122 protected:
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;
130 private:
131 virtual ~LwpLayoutScale() override;
134 class LwpLayoutMargins : public LwpVirtualPiece
136 public:
137 LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
138 virtual void Parse(IXFStream* pOutputStream) override;
139 LwpMargins& GetMargins() { return m_Margins; }
140 LwpMargins& GetExtMargins(){ return m_ExtMargins;}
141 protected:
142 virtual void Read() override;
143 protected:
144 LwpMargins m_Margins;
145 LwpMargins m_ExtMargins;
146 LwpMargins m_ExtraMargins;
147 private:
148 virtual ~LwpLayoutMargins() override;
151 class LwpLayoutBorder : public LwpVirtualPiece
153 public:
154 LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
155 virtual void Parse(IXFStream* pOutputStream) override;
156 LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;}
157 protected:
158 virtual void Read() override;
159 protected:
160 LwpBorderStuff m_BorderStuff;
161 private:
162 virtual ~LwpLayoutBorder() override;
165 class LwpLayoutBackground : public LwpVirtualPiece
167 public:
168 LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
169 virtual void Parse(IXFStream* pOutputStream) override;
170 LwpBackgroundStuff& GetBackgoudStuff(){return m_BackgroundStuff;}
171 protected:
172 virtual void Read() override;
173 protected:
174 LwpBackgroundStuff m_BackgroundStuff;
175 private:
176 virtual ~LwpLayoutBackground() override;
179 class LwpExternalBorder
181 public:
182 LwpExternalBorder();
183 ~LwpExternalBorder();
184 void Read(LwpObjectStream *pStrm);
185 private:
186 LwpAtomHolder m_LeftName;
187 LwpAtomHolder m_TopName;
188 LwpAtomHolder m_RightName;
189 LwpAtomHolder m_BottomName;
192 //It seems that this class is used for designer border. Only read now.
193 class LwpLayoutExternalBorder : public LwpVirtualPiece
195 public:
196 LwpLayoutExternalBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
197 virtual void Parse(IXFStream* pOutputStream) override;
198 protected:
199 virtual void Read() override;
200 protected:
201 LwpExternalBorder m_ExtranalBorder;
202 private:
203 virtual ~LwpLayoutExternalBorder() override;
206 class LwpColumnInfo
208 public:
209 LwpColumnInfo();
210 ~LwpColumnInfo();
211 void Read(LwpObjectStream *pStrm);
212 inline double GetWidth(){return LwpTools::ConvertFromUnitsToMetric(m_nWidth);}
213 inline double GetGap(){return LwpTools::ConvertFromUnitsToMetric(m_nGap);}
214 private:
215 sal_Int32 m_nWidth;
216 sal_Int32 m_nGap;
219 class LwpLayoutColumns : public LwpVirtualPiece
221 public:
222 LwpLayoutColumns(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
223 virtual void Parse(IXFStream* pOutputStream) override;
224 inline sal_uInt16 GetNumCols(){return m_nNumCols;}
225 double GetColWidth(sal_uInt16 nIndex);
226 double GetColGap(sal_uInt16 nIndex);
227 protected:
228 virtual void Read() override;
229 protected:
230 sal_uInt16 m_nNumCols;
231 LwpColumnInfo* m_pColumns;
232 private:
233 virtual ~LwpLayoutColumns() override;
236 class LwpLayoutGutters : public LwpVirtualPiece
238 public:
239 LwpLayoutGutters(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
240 virtual void Parse(IXFStream* pOutputStream) override;
241 inline LwpBorderStuff& GetBorderStuff() { return m_BorderBuffer; }
242 protected:
243 virtual void Read() override;
244 protected:
245 LwpBorderStuff m_BorderBuffer;
246 private:
247 virtual ~LwpLayoutGutters() override;
250 class LwpJoinStuff
252 public:
253 LwpJoinStuff();
254 ~LwpJoinStuff();
255 void Read(LwpObjectStream *pStrm);
256 private:
257 sal_uInt16 m_nPercentage;
258 sal_uInt16 m_nCorners;
259 sal_Int32 m_nWidth;
260 sal_Int32 m_nHeight;
262 enum JoinType
264 MITRE = 1,
265 NEGATE = 2,
266 ROUNDED = 3,
267 RECTANGLE = 4,
268 SPECIAL = 5,
269 DIAGONAL = 6,
270 NEGATE_NO_CROSS = 7,
271 DOG_EAR_PAGE = 8,
272 DESKTOP = 9,
273 BOX_HIGHLIGHT = 10,
274 STAR = 11,
275 ROPE = 12,
276 DECO1 = 13,
277 DECO2 = 14,
278 RAIN = 15,
279 PIN = 16,
280 ROSE = 17,
281 SUNF = 18,
282 DECO3 = 19,
283 WARNING = 20,
284 BUBBLE = 21,
285 GIRDER = 22,
286 SMILE = 23,
287 ARROW = 24,
288 MAXJOIN = 24
291 sal_uInt16 m_nID;//JoinType
292 sal_uInt16 m_nScaling;
293 LwpColor m_Color;
296 class LwpLayoutJoins : public LwpVirtualPiece
298 public:
299 LwpLayoutJoins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
300 virtual void Parse(IXFStream* pOutputStream) override;
301 protected:
302 virtual void Read() override;
303 protected:
304 LwpJoinStuff m_JoinStuff;
305 private:
306 virtual ~LwpLayoutJoins() override;
309 class LwpLayoutShadow : public LwpVirtualPiece
311 public:
312 LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
313 virtual void Parse(IXFStream* pOutputStream) override;
314 LwpShadow& GetShadow() { return m_Shadow; }
315 protected:
316 virtual void Read() override;
317 protected:
318 LwpShadow m_Shadow;
319 private:
320 virtual ~LwpLayoutShadow() override;
323 class LwpLayoutRelativityGuts
325 public:
326 LwpLayoutRelativityGuts();
327 void Read(LwpObjectStream *pStrm);
328 sal_uInt8 GetRelativeType(){ return m_nRelType;}
329 enum RelativeType
331 LAY_PARENT_RELATIVE = 1,
332 LAY_PARA_RELATIVE,
333 LAY_INLINE,
334 LAY_INLINE_NEWLINE,
335 LAY_CONTENT_RELATIVE,
336 LAY_INLINE_VERTICAL
338 enum WhereType
340 LAY_UPPERLEFT = 1,
341 LAY_MIDDLETOP,
342 LAY_UPPERRIGHT,
343 LAY_MIDDLELEFT,
344 LAY_MIDDLERIGHT,
345 LAY_LOWERLEFT,
346 LAY_MIDDLEBOTTOM,
347 LAY_LOWERRIGHT,
348 LAY_MIDDLE
350 enum TetherWhereType
352 LAY_INTERNAL = 1,
353 LAY_EXTERNAL,
354 LAY_BORDER
356 private:
357 sal_uInt8 m_nRelType;
358 sal_uInt8 m_nRelFromWhere;
359 LwpPoint m_RelDistance;
360 sal_uInt8 m_nTether;
361 sal_uInt8 m_nTetherWhere;
362 sal_uInt8 m_nFlags;
365 class LwpLayoutRelativity: public LwpVirtualPiece
367 public:
368 LwpLayoutRelativity(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
369 virtual void Parse(IXFStream* pOutputStream) override;
370 LwpLayoutRelativityGuts& GetRelGuts() { return m_RelGuts; }
371 protected:
372 virtual void Read() override;
373 protected:
374 LwpLayoutRelativityGuts m_RelGuts;
375 private:
376 virtual ~LwpLayoutRelativity() override;
379 #endif
381 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */