Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*************************************************************************
3 : *
4 : * The Contents of this file are made available subject to the terms of
5 : * either of the following licenses
6 : *
7 : * - GNU Lesser General Public License Version 2.1
8 : * - Sun Industry Standards Source License Version 1.1
9 : *
10 : * Sun Microsystems Inc., October, 2000
11 : *
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
16 : *
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.
20 : *
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.
25 : *
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
30 : *
31 : *
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.
38 : *
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.
45 : *
46 : * The Initial Developer of the Original Code is: IBM Corporation
47 : *
48 : * Copyright: 2008 by IBM Corporation
49 : *
50 : * All Rights Reserved.
51 : *
52 : * Contributor(s): _______________________________________
53 : *
54 : *
55 : ************************************************************************/
56 : /*************************************************************************
57 : * @file
58 : * For LWP filter architecture prototype
59 : ************************************************************************/
60 : /*************************************************************************
61 : * Change History
62 : Jan 28 2005 Created
63 : ************************************************************************/
64 : #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPLAYPIECE_HXX
65 : #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPLAYPIECE_HXX
66 :
67 : #include "lwppiece.hxx"
68 : #include "lwpbasetype.hxx"
69 :
70 : class LwpRotor
71 : {
72 : public:
73 : LwpRotor();
74 : ~LwpRotor();
75 : void Read(LwpObjectStream *pStrm);
76 : private:
77 : sal_Int16 m_nRotation; //angle
78 : };
79 :
80 : class LwpLayoutGeometry : public LwpVirtualPiece
81 : {
82 : public:
83 : LwpLayoutGeometry(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
84 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
85 93 : sal_Int32 GetWidth() { return m_nWidth; }
86 84 : sal_Int32 GetHeight() { return m_nHeight; }
87 20 : LwpPoint GetOrigin() { return m_Origin; }
88 16 : LwpPoint GetAbsoluteOrigin() { return m_AbsoluteOrigin; }
89 33 : sal_uInt8 GetContentOrientation(){ return m_ContentOrientation;}
90 :
91 : protected:
92 : virtual void Read() SAL_OVERRIDE;
93 : protected:
94 : sal_Int32 m_nWidth;
95 : sal_Int32 m_nHeight;
96 : LwpPoint m_Origin;
97 : LwpPoint m_AbsoluteOrigin;
98 : LwpRotor m_ContainerRotor;
99 : sal_uInt8 m_ContentOrientation;
100 : private:
101 : virtual ~LwpLayoutGeometry();
102 : };
103 :
104 : class LwpLayoutScale : public LwpVirtualPiece
105 : {
106 : public:
107 : enum {ORIGINAL_SIZE = 1, FIT_IN_FRAME = 2, PERCENTAGE = 4,
108 : CUSTOM = 8, MAINTAIN_ASPECT_RATIO = 16};
109 :
110 : enum {CENTERED = 1, TILED = 2};
111 : LwpLayoutScale(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
112 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
113 19 : sal_uInt16 GetScaleMode(){return m_nScaleMode;}
114 5 : sal_uInt32 GetScalePercentage(){return m_nScalePercentage;}
115 : void SetScalePercentage(sal_uInt32 nVal){m_nScalePercentage = nVal;}
116 2 : sal_Int32 GetScaleWidth(){return m_nScaleWidth;}
117 : void SetScaleWidth(sal_Int32 nVal){m_nScaleWidth = nVal;}
118 2 : sal_Int32 GetScaleHeight(){return m_nScaleHeight;}
119 : void SetScaleHeight(sal_Int32 nVal){m_nScaleHeight = nVal;}
120 : sal_uInt16 GetContentRotation(){return m_nContentRotation;}
121 : void SetContentRotation(sal_uInt16 nVal){m_nContentRotation = nVal;}
122 9 : sal_uInt16 GetPlacement(){return m_nPlacement;}
123 : void SetPlacement(sal_uInt16 nVal){m_nPlacement = nVal;}
124 3 : inline LwpPoint& GetOffset() {return m_Offset;}
125 : protected:
126 : virtual void Read() SAL_OVERRIDE;
127 : protected:
128 : sal_uInt16 m_nScaleMode;
129 : sal_uInt32 m_nScalePercentage;
130 : sal_Int32 m_nScaleWidth;
131 : sal_Int32 m_nScaleHeight;
132 : sal_uInt16 m_nContentRotation;
133 : LwpPoint m_Offset;
134 : sal_uInt16 m_nPlacement;
135 : private:
136 : virtual ~LwpLayoutScale();
137 : };
138 :
139 : #include "lwpmargins.hxx"
140 :
141 : class LwpLayoutMargins : public LwpVirtualPiece
142 : {
143 : public:
144 : LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
145 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
146 677 : LwpMargins& GetMargins() { return m_Margins; }
147 144 : LwpMargins& GetExtMargins(){ return m_ExtMargins;}
148 : protected:
149 : virtual void Read() SAL_OVERRIDE;
150 : protected:
151 : LwpMargins m_Margins;
152 : LwpMargins m_ExtMargins;
153 : LwpMargins m_ExtraMargins;
154 : private:
155 : virtual ~LwpLayoutMargins();
156 : };
157 :
158 : #include "lwpborderstuff.hxx"
159 : class LwpLayoutBorder : public LwpVirtualPiece
160 : {
161 : public:
162 : LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
163 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
164 124 : LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;}
165 : protected:
166 : virtual void Read() SAL_OVERRIDE;
167 : protected:
168 : LwpBorderStuff m_BorderStuff;
169 : private:
170 : virtual ~LwpLayoutBorder();
171 : };
172 :
173 : class LwpLayoutBackground : public LwpVirtualPiece
174 : {
175 : public:
176 : LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
177 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
178 174 : LwpBackgroundStuff& GetBackgoudStuff(){return m_BackgroundStuff;}
179 : protected:
180 : virtual void Read() SAL_OVERRIDE;
181 : protected:
182 : LwpBackgroundStuff m_BackgroundStuff;
183 : private:
184 : virtual ~LwpLayoutBackground();
185 : };
186 :
187 : class LwpExternalBorder
188 : {
189 : public:
190 : LwpExternalBorder();
191 : ~LwpExternalBorder();
192 : void Read(LwpObjectStream *pStrm);
193 : private:
194 : LwpAtomHolder m_LeftName;
195 : LwpAtomHolder m_TopName;
196 : LwpAtomHolder m_RightName;
197 : LwpAtomHolder m_BottomName;
198 : };
199 :
200 : //It seems that this class is used for designer border. Only read now.
201 : class LwpLayoutExternalBorder : public LwpVirtualPiece
202 : {
203 : public:
204 : LwpLayoutExternalBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
205 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
206 : protected:
207 : virtual void Read() SAL_OVERRIDE;
208 : protected:
209 : LwpExternalBorder m_ExtranalBorder;
210 : private:
211 : virtual ~LwpLayoutExternalBorder();
212 : };
213 :
214 : class LwpColumnInfo
215 : {
216 : public:
217 : LwpColumnInfo();
218 : ~LwpColumnInfo();
219 : void Read(LwpObjectStream *pStrm);
220 0 : inline double GetWidth(){return LwpTools::ConvertFromUnitsToMetric(m_nWidth);}
221 : inline void SetWidth(sal_Int32 w){m_nWidth = w;}
222 0 : inline double GetGap(){return LwpTools::ConvertFromUnitsToMetric(m_nGap);}
223 : inline void SetGap(sal_Int32 g){m_nGap = g;}
224 : private:
225 : sal_Int32 m_nWidth;
226 : sal_Int32 m_nGap;
227 : };
228 :
229 : class LwpLayoutColumns : public LwpVirtualPiece
230 : {
231 : public:
232 : LwpLayoutColumns(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
233 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
234 37 : inline sal_uInt16 GetNumCols(){return m_nNumCols;}
235 : double GetColWidth(sal_uInt16 nIndex);
236 : double GetColGap(sal_uInt16 nIndex);
237 : protected:
238 : virtual void Read() SAL_OVERRIDE;
239 : protected:
240 : sal_uInt16 m_nNumCols;
241 : LwpColumnInfo* m_pColumns;
242 : private:
243 : virtual ~LwpLayoutColumns();
244 : };
245 :
246 : class LwpLayoutGutters : public LwpVirtualPiece
247 : {
248 : public:
249 : LwpLayoutGutters(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
250 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
251 0 : inline LwpBorderStuff& GetBorderStuff() { return m_BorderBuffer; }
252 : protected:
253 : virtual void Read() SAL_OVERRIDE;
254 : protected:
255 : LwpBorderStuff m_BorderBuffer;
256 : private:
257 : virtual ~LwpLayoutGutters();
258 : };
259 :
260 : class LwpJoinStuff
261 : {
262 : public:
263 : LwpJoinStuff();
264 : ~LwpJoinStuff();
265 : void Read(LwpObjectStream *pStrm);
266 : private:
267 : sal_uInt16 m_nPercentage;
268 : sal_uInt16 m_nCorners;
269 : sal_Int32 m_nWidth;
270 : sal_Int32 m_nHeight;
271 :
272 : enum JoinType
273 : {
274 : MITRE = 1,
275 : NEGATE = 2,
276 : ROUNDED = 3,
277 : RECTANGLE = 4,
278 : SPECIAL = 5,
279 : DIAGONAL = 6,
280 : NEGATE_NO_CROSS = 7,
281 : DOG_EAR_PAGE = 8,
282 : DESKTOP = 9,
283 : BOX_HIGHLIGHT = 10,
284 : STAR = 11,
285 : ROPE = 12,
286 : DECO1 = 13,
287 : DECO2 = 14,
288 : RAIN = 15,
289 : PIN = 16,
290 : ROSE = 17,
291 : SUNF = 18,
292 : DECO3 = 19,
293 : WARNING = 20,
294 : BUBBLE = 21,
295 : GIRDER = 22,
296 : SMILE = 23,
297 : ARROW = 24,
298 : MAXJOIN = 24
299 : };
300 :
301 : sal_uInt16 m_nID;//JoinType
302 : sal_uInt16 m_nScaling;
303 : LwpColor m_Color;
304 : };
305 :
306 : class LwpLayoutJoins : public LwpVirtualPiece
307 : {
308 : public:
309 : LwpLayoutJoins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
310 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
311 : protected:
312 : virtual void Read() SAL_OVERRIDE;
313 : protected:
314 : LwpJoinStuff m_JoinStuff;
315 : private:
316 : virtual ~LwpLayoutJoins();
317 : };
318 :
319 : #include "lwpshadow.hxx"
320 :
321 : class LwpLayoutShadow : public LwpVirtualPiece
322 : {
323 : public:
324 : LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
325 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
326 49 : LwpShadow& GetShadow() { return m_Shadow; }
327 : protected:
328 : virtual void Read() SAL_OVERRIDE;
329 : protected:
330 : LwpShadow m_Shadow;
331 : private:
332 : virtual ~LwpLayoutShadow();
333 : };
334 :
335 : class LwpLayoutRelativityGuts
336 : {
337 : public:
338 : LwpLayoutRelativityGuts();
339 : void Read(LwpObjectStream *pStrm);
340 283 : sal_uInt8 GetRelativeType(){ return m_nRelType;}
341 : sal_uInt8 GetRelativeFromWhere(){ return m_nRelFromWhere;}
342 : LwpPoint GetRelativeDistance(){ return m_RelDistance;}
343 : sal_uInt8 GetTetherType(){ return m_nTether;}
344 : sal_uInt8 GetTetherWhere(){ return m_nTetherWhere;}
345 : public:
346 : enum RelativeType
347 : {
348 : LAY_PARENT_RELATIVE = 1,
349 : LAY_PARA_RELATIVE,
350 : LAY_INLINE,
351 : LAY_INLINE_NEWLINE,
352 : LAY_CONTENT_RELATIVE,
353 : LAY_INLINE_VERTICAL
354 : };
355 : enum WhereType
356 : {
357 : LAY_UPPERLEFT = 1,
358 : LAY_MIDDLETOP,
359 : LAY_UPPERRIGHT,
360 : LAY_MIDDLELEFT,
361 : LAY_MIDDLERIGHT,
362 : LAY_LOWERLEFT,
363 : LAY_MIDDLEBOTTOM,
364 : LAY_LOWERRIGHT,
365 : LAY_MIDDLE
366 : };
367 : enum TetherWhereType
368 : {
369 : LAY_INTERNAL = 1,
370 : LAY_EXTERNAL,
371 : LAY_BORDER
372 : };
373 : private:
374 : sal_uInt8 m_nRelType;
375 : sal_uInt8 m_nRelFromWhere;
376 : LwpPoint m_RelDistance;
377 : sal_uInt8 m_nTether;
378 : sal_uInt8 m_nTetherWhere;
379 : sal_uInt8 m_nFlags;
380 : };
381 :
382 : class LwpLayoutRelativity: public LwpVirtualPiece
383 : {
384 : public:
385 : LwpLayoutRelativity(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
386 : virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
387 283 : LwpLayoutRelativityGuts& GetRelGuts() { return m_RelGuts; }
388 : protected:
389 : virtual void Read() SAL_OVERRIDE;
390 : protected:
391 : LwpLayoutRelativityGuts m_RelGuts;
392 : private:
393 : virtual ~LwpLayoutRelativity();
394 : };
395 :
396 : #endif
397 :
398 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|