update dev300-m57
[ooovba.git] / lotuswordpro / source / filter / lwplaypiece.hxx
blobe730496e5f0813ce4b497500da4b4cac4458c33a
1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * MA 02111-1307 USA
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
55 /*************************************************************************
56 * @file
57 * For LWP filter architecture prototype
58 ************************************************************************/
59 /*************************************************************************
60 * Change History
61 Jan 28 2005 Created
62 ************************************************************************/
63 #ifndef _LWPLAYOUTPIECE_HXX
64 #define _LWPLAYOUTPIECE_HXX
66 #include "lwppiece.hxx"
67 #include "lwpbasetype.hxx"
69 class LwpRotor
71 public:
72 LwpRotor();
73 ~LwpRotor();
74 void Read(LwpObjectStream *pStrm);
75 private:
76 sal_Int16 m_nRotation; //angle
77 sal_uInt16 m_nSin;
78 sal_uInt16 m_nCos;
81 class LwpLayoutGeometry : public LwpVirtualPiece
83 public:
84 LwpLayoutGeometry(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
85 virtual ~LwpLayoutGeometry();
86 virtual void Parse(IXFStream* pOutputStream);
87 sal_Int32 GetWidth() { return m_nWidth; }
88 sal_Int32 GetHeight() { return m_nHeight; }
89 LwpPoint GetOrigin() { return m_Origin; }
90 LwpPoint GetAbsoluteOrigin() { return m_AbsoluteOrigin; }
91 sal_uInt8 GetContentOrientation(){ return m_ContentOrientation;}
93 protected:
94 virtual void Read();
95 protected:
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 : 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& objHdr, LwpSvStream* pStrm);
112 virtual ~LwpLayoutScale();
113 virtual void Parse(IXFStream* pOutputStream);
114 sal_uInt16 GetScaleMode(){return m_nScaleMode;}
115 void SetScaleMode(sal_uInt16 nVal){m_nScaleMode = nVal;}
116 sal_uInt32 GetScalePercentage(){return m_nScalePercentage;}
117 void SetScalePercentage(sal_uInt32 nVal){m_nScalePercentage = nVal;}
118 sal_Int32 GetScaleWidth(){return m_nScaleWidth;}
119 void SetScaleWidth(sal_Int32 nVal){m_nScaleWidth = nVal;}
120 sal_Int32 GetScaleHeight(){return m_nScaleHeight;}
121 void SetScaleHeight(sal_Int32 nVal){m_nScaleHeight = nVal;}
122 sal_uInt16 GetContentRotation(){return m_nContentRotation;}
123 void SetContentRotation(sal_uInt16 nVal){m_nContentRotation = nVal;}
124 sal_uInt16 GetPlacement(){return m_nPlacement;}
125 void SetPlacement(sal_uInt16 nVal){m_nPlacement = nVal;}
126 // add by , 04/05/2005
127 inline LwpPoint* GetOffset() {return &m_Offset;};
128 // end add
129 protected:
130 virtual void Read();
131 protected:
132 sal_uInt16 m_nScaleMode;
133 sal_uInt32 m_nScalePercentage;
134 sal_Int32 m_nScaleWidth;
135 sal_Int32 m_nScaleHeight;
136 sal_uInt16 m_nContentRotation;
137 LwpPoint m_Offset;
138 sal_uInt16 m_nPlacement;
141 #include "lwpmargins.hxx"
143 class LwpLayoutMargins : public LwpVirtualPiece
145 public:
146 LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
147 virtual ~LwpLayoutMargins();
148 virtual void Parse(IXFStream* pOutputStream);
149 LwpMargins* GetMargins() { return &m_Margins; }
150 LwpMargins* GetExtMargins(){ return &m_ExtMargins;}
151 protected:
152 virtual void Read();
153 protected:
154 LwpMargins m_Margins;
155 LwpMargins m_ExtMargins;
156 LwpMargins m_ExtraMargins;
159 #include "lwpborderstuff.hxx"
160 class LwpLayoutBorder : public LwpVirtualPiece
162 public:
163 LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
164 virtual ~LwpLayoutBorder();
165 virtual void Parse(IXFStream* pOutputStream);
166 LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
167 protected:
168 virtual void Read();
169 protected:
170 LwpBorderStuff m_BorderStuff;
173 class LwpLayoutBackground : public LwpVirtualPiece
175 public:
176 LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
177 virtual ~LwpLayoutBackground();
178 virtual void Parse(IXFStream* pOutputStream);
179 LwpBackgroundStuff* GetBackgoudStuff(){return &m_BackgroundStuff;}
180 protected:
181 virtual void Read();
182 protected:
183 LwpBackgroundStuff m_BackgroundStuff;
186 class LwpExternalBorder
188 public:
189 LwpExternalBorder();
190 ~LwpExternalBorder();
191 void Read(LwpObjectStream *pStrm);
192 private:
193 LwpAtomHolder m_LeftName;
194 LwpAtomHolder m_TopName;
195 LwpAtomHolder m_RightName;
196 LwpAtomHolder m_BottomName;
199 //It seems that this class is used for designer border. Only read now.
200 class LwpLayoutExternalBorder : public LwpVirtualPiece
202 public:
203 LwpLayoutExternalBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
204 virtual ~LwpLayoutExternalBorder();
205 virtual void Parse(IXFStream* pOutputStream);
206 protected:
207 virtual void Read();
208 protected:
209 LwpExternalBorder m_ExtranalBorder;
212 class LwpColumnInfo
214 public:
215 LwpColumnInfo();
216 ~LwpColumnInfo();
217 void Read(LwpObjectStream *pStrm);
218 inline double GetWidth(){return LwpTools::ConvertFromUnitsToMetric(m_nWidth);}
219 inline void SetWidth(sal_Int32 w){m_nWidth = w;}
220 inline double GetGap(){return LwpTools::ConvertFromUnitsToMetric(m_nGap);}
221 inline void SetGap(sal_Int32 g){m_nGap = g;}
222 private:
223 sal_Int32 m_nWidth;
224 sal_Int32 m_nGap;
227 class LwpLayoutColumns : public LwpVirtualPiece
229 public:
230 LwpLayoutColumns(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
231 virtual ~LwpLayoutColumns();
232 virtual void Parse(IXFStream* pOutputStream);
233 inline sal_uInt16 GetNumCols(){return m_nNumCols;};
234 double GetColWidth(sal_uInt16 nIndex);
235 double GetColGap(sal_uInt16 nIndex);
236 protected:
237 virtual void Read();
238 protected:
239 sal_uInt16 m_nNumCols;
240 LwpColumnInfo* m_pColumns;
243 class LwpLayoutGutters : public LwpVirtualPiece
245 public:
246 LwpLayoutGutters(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
247 virtual ~LwpLayoutGutters();
248 virtual void Parse(IXFStream* pOutputStream);
249 inline virtual LwpBorderStuff* GetBorderStuff(){return &m_BorderBuffer;}
250 protected:
251 virtual void Read();
252 protected:
253 LwpBorderStuff m_BorderBuffer;
256 class LwpJoinStuff
258 public:
259 LwpJoinStuff();
260 ~LwpJoinStuff();
261 void Read(LwpObjectStream *pStrm);
262 private:
263 sal_uInt16 m_nPercentage;
264 sal_uInt16 m_nCorners;
265 sal_Int32 m_nWidth;
266 sal_Int32 m_nHeight;
268 enum JoinType
270 MITRE = 1,
271 NEGATE = 2,
272 ROUNDED = 3,
273 RECTANGLE = 4,
274 SPECIAL = 5,
275 DIAGONAL = 6,
276 NEGATE_NO_CROSS = 7,
277 DOG_EAR_PAGE = 8,
278 DESKTOP = 9,
279 BOX_HIGHLIGHT = 10,
280 //#ifdef BORDER_BMP
281 STAR = 11,
282 ROPE = 12,
283 DECO1 = 13,
284 DECO2 = 14,
285 RAIN = 15,
286 PIN = 16,
287 ROSE = 17,
288 SUNF = 18,
289 DECO3 = 19,
290 //#endif //BORDER_BMP
291 WARNING = 20,
292 BUBBLE = 21,
293 GIRDER = 22,
294 SMILE = 23,
295 ARROW = 24,
296 MAXJOIN = 24
299 sal_uInt16 m_nID;//JoinType
300 sal_uInt16 m_nScaling;
301 LwpColor m_Color;
304 class LwpLayoutJoins : public LwpVirtualPiece
306 public:
307 LwpLayoutJoins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
308 virtual ~LwpLayoutJoins();
309 virtual void Parse(IXFStream* pOutputStream);
310 protected:
311 virtual void Read();
312 protected:
313 LwpJoinStuff m_JoinStuff;
316 #include "lwpshadow.hxx"
318 class LwpLayoutShadow : public LwpVirtualPiece
320 public:
321 LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
322 virtual ~LwpLayoutShadow();
323 virtual void Parse(IXFStream* pOutputStream);
324 LwpShadow* GetShadow(){return &m_Shadow;}
325 protected:
326 virtual void Read();
327 protected:
328 LwpShadow m_Shadow;
331 /*class LwpLayoutRelativityGuts*/
332 class LwpLayoutRelativityGuts
334 public:
335 LwpLayoutRelativityGuts();
336 void Read(LwpObjectStream *pStrm);
337 sal_uInt8 GetRelativeType(){ return m_nRelType;}
338 sal_uInt8 GetRelativeFromWhere(){ return m_nRelFromWhere;}
339 LwpPoint GetRelativeDistance(){ return m_RelDistance;}
340 sal_uInt8 GetTetherType(){ return m_nTether;}
341 sal_uInt8 GetTetherWhere(){ return m_nTetherWhere;}
342 public:
343 enum RelativeType
345 LAY_PARENT_RELATIVE = 1,
346 LAY_PARA_RELATIVE,
347 LAY_INLINE,
348 LAY_INLINE_NEWLINE,
349 LAY_CONTENT_RELATIVE,
350 LAY_INLINE_VERTICAL
352 enum WhereType
354 LAY_UPPERLEFT = 1,
355 LAY_MIDDLETOP,
356 LAY_UPPERRIGHT,
357 LAY_MIDDLELEFT,
358 LAY_MIDDLERIGHT,
359 LAY_LOWERLEFT,
360 LAY_MIDDLEBOTTOM,
361 LAY_LOWERRIGHT,
362 LAY_MIDDLE
364 enum TetherWhereType
366 LAY_INTERNAL = 1,
367 LAY_EXTERNAL,
368 LAY_BORDER
370 private:
371 sal_uInt8 m_nRelType;
372 sal_uInt8 m_nRelFromWhere;
373 LwpPoint m_RelDistance;
374 sal_uInt8 m_nTether;
375 sal_uInt8 m_nTetherWhere;
376 sal_uInt8 m_nFlags;
379 class LwpLayoutRelativity: public LwpVirtualPiece
381 public:
382 LwpLayoutRelativity(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
383 virtual ~LwpLayoutRelativity();
384 virtual void Parse(IXFStream* pOutputStream);
385 LwpLayoutRelativityGuts* GetRelGuts(){return &m_RelGuts;}
386 protected:
387 virtual void Read();
388 protected:
389 LwpLayoutRelativityGuts m_RelGuts;
392 #endif