Branch data 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 _LWPLAYOUTPIECE_HXX
65 : : #define _LWPLAYOUTPIECE_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 : : sal_uInt16 m_nSin;
79 : : sal_uInt16 m_nCos;
80 : : };
81 : :
82 : : class LwpLayoutGeometry : public LwpVirtualPiece
83 : : {
84 : : public:
85 : : LwpLayoutGeometry(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
86 : : virtual ~LwpLayoutGeometry();
87 : : virtual void Parse(IXFStream* pOutputStream);
88 : 279 : sal_Int32 GetWidth() { return m_nWidth; }
89 : 252 : sal_Int32 GetHeight() { return m_nHeight; }
90 : 60 : LwpPoint GetOrigin() { return m_Origin; }
91 : 48 : LwpPoint GetAbsoluteOrigin() { return m_AbsoluteOrigin; }
92 : 99 : sal_uInt8 GetContentOrientation(){ return m_ContentOrientation;}
93 : :
94 : : protected:
95 : : virtual void Read();
96 : : protected:
97 : : sal_Int32 m_nWidth;
98 : : sal_Int32 m_nHeight;
99 : : LwpPoint m_Origin;
100 : : LwpPoint m_AbsoluteOrigin;
101 : : LwpRotor m_ContainerRotor;
102 : : sal_uInt8 m_ContentOrientation;
103 : : };
104 : :
105 : : class LwpLayoutScale : public LwpVirtualPiece
106 : : {
107 : : public:
108 : : enum {ORIGINAL_SIZE = 1, FIT_IN_FRAME = 2, PERCENTAGE = 4,
109 : : CUSTOM = 8, MAINTAIN_ASPECT_RATIO = 16};
110 : :
111 : : enum {CENTERED = 1, TILED = 2};
112 : : LwpLayoutScale(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
113 : : virtual ~LwpLayoutScale();
114 : : virtual void Parse(IXFStream* pOutputStream);
115 : 57 : sal_uInt16 GetScaleMode(){return m_nScaleMode;}
116 : 15 : sal_uInt32 GetScalePercentage(){return m_nScalePercentage;}
117 : : void SetScalePercentage(sal_uInt32 nVal){m_nScalePercentage = nVal;}
118 : 6 : sal_Int32 GetScaleWidth(){return m_nScaleWidth;}
119 : : void SetScaleWidth(sal_Int32 nVal){m_nScaleWidth = nVal;}
120 : 6 : 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 : 27 : sal_uInt16 GetPlacement(){return m_nPlacement;}
125 : : void SetPlacement(sal_uInt16 nVal){m_nPlacement = nVal;}
126 : : // add by , 04/05/2005
127 : 9 : 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;
139 : : };
140 : :
141 : : #include "lwpmargins.hxx"
142 : :
143 : : class LwpLayoutMargins : public LwpVirtualPiece
144 : : {
145 : : public:
146 : : LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
147 : : virtual ~LwpLayoutMargins();
148 : : virtual void Parse(IXFStream* pOutputStream);
149 : 2067 : LwpMargins* GetMargins() { return &m_Margins; }
150 : 432 : 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;
157 : : };
158 : :
159 : : #include "lwpborderstuff.hxx"
160 : : class LwpLayoutBorder : public LwpVirtualPiece
161 : : {
162 : : public:
163 : : LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
164 : : virtual ~LwpLayoutBorder();
165 : : virtual void Parse(IXFStream* pOutputStream);
166 : 381 : LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
167 : : protected:
168 : : virtual void Read();
169 : : protected:
170 : : LwpBorderStuff m_BorderStuff;
171 : : };
172 : :
173 : : class LwpLayoutBackground : public LwpVirtualPiece
174 : : {
175 : : public:
176 : : LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
177 : : virtual ~LwpLayoutBackground();
178 : : virtual void Parse(IXFStream* pOutputStream);
179 : 540 : LwpBackgroundStuff* GetBackgoudStuff(){return &m_BackgroundStuff;}
180 : : protected:
181 : : virtual void Read();
182 : : protected:
183 : : LwpBackgroundStuff m_BackgroundStuff;
184 : : };
185 : :
186 : : class LwpExternalBorder
187 : : {
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;
197 : : };
198 : :
199 : : //It seems that this class is used for designer border. Only read now.
200 : : class LwpLayoutExternalBorder : public LwpVirtualPiece
201 : : {
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;
210 : : };
211 : :
212 : : class LwpColumnInfo
213 : : {
214 : : public:
215 : : LwpColumnInfo();
216 : : ~LwpColumnInfo();
217 : : void Read(LwpObjectStream *pStrm);
218 : 0 : inline double GetWidth(){return LwpTools::ConvertFromUnitsToMetric(m_nWidth);}
219 : : inline void SetWidth(sal_Int32 w){m_nWidth = w;}
220 : 0 : 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;
225 : : };
226 : :
227 : : class LwpLayoutColumns : public LwpVirtualPiece
228 : : {
229 : : public:
230 : : LwpLayoutColumns(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
231 : : virtual ~LwpLayoutColumns();
232 : : virtual void Parse(IXFStream* pOutputStream);
233 : 111 : 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;
241 : : };
242 : :
243 : : class LwpLayoutGutters : public LwpVirtualPiece
244 : : {
245 : : public:
246 : : LwpLayoutGutters(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
247 : : virtual ~LwpLayoutGutters();
248 : : virtual void Parse(IXFStream* pOutputStream);
249 : 0 : inline virtual LwpBorderStuff* GetBorderStuff(){return &m_BorderBuffer;}
250 : : protected:
251 : : virtual void Read();
252 : : protected:
253 : : LwpBorderStuff m_BorderBuffer;
254 : : };
255 : :
256 : : class LwpJoinStuff
257 : : {
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;
267 : :
268 : : enum JoinType
269 : : {
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
297 : : };
298 : :
299 : : sal_uInt16 m_nID;//JoinType
300 : : sal_uInt16 m_nScaling;
301 : : LwpColor m_Color;
302 : : };
303 : :
304 : : class LwpLayoutJoins : public LwpVirtualPiece
305 : : {
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;
314 : : };
315 : :
316 : : #include "lwpshadow.hxx"
317 : :
318 : : class LwpLayoutShadow : public LwpVirtualPiece
319 : : {
320 : : public:
321 : : LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
322 : : virtual ~LwpLayoutShadow();
323 : : virtual void Parse(IXFStream* pOutputStream);
324 : 147 : LwpShadow* GetShadow(){return &m_Shadow;}
325 : : protected:
326 : : virtual void Read();
327 : : protected:
328 : : LwpShadow m_Shadow;
329 : : };
330 : :
331 : : /*class LwpLayoutRelativityGuts*/
332 : : class LwpLayoutRelativityGuts
333 : : {
334 : : public:
335 : : LwpLayoutRelativityGuts();
336 : : void Read(LwpObjectStream *pStrm);
337 : 849 : 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
344 : : {
345 : : LAY_PARENT_RELATIVE = 1,
346 : : LAY_PARA_RELATIVE,
347 : : LAY_INLINE,
348 : : LAY_INLINE_NEWLINE,
349 : : LAY_CONTENT_RELATIVE,
350 : : LAY_INLINE_VERTICAL
351 : : };
352 : : enum WhereType
353 : : {
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
363 : : };
364 : : enum TetherWhereType
365 : : {
366 : : LAY_INTERNAL = 1,
367 : : LAY_EXTERNAL,
368 : : LAY_BORDER
369 : : };
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;
377 : : };
378 : :
379 : : class LwpLayoutRelativity: public LwpVirtualPiece
380 : : {
381 : : public:
382 : : LwpLayoutRelativity(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
383 : : virtual ~LwpLayoutRelativity();
384 : : virtual void Parse(IXFStream* pOutputStream);
385 : 849 : LwpLayoutRelativityGuts* GetRelGuts(){return &m_RelGuts;}
386 : : protected:
387 : : virtual void Read();
388 : : protected:
389 : : LwpLayoutRelativityGuts m_RelGuts;
390 : : };
391 : :
392 : : #endif
393 : :
394 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|