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,
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 /*************************************************************************
57 * For LWP filter architecture prototype
58 ************************************************************************/
59 /*************************************************************************
62 ************************************************************************/
63 #ifndef _LWPLAYOUTPIECE_HXX
64 #define _LWPLAYOUTPIECE_HXX
66 #include "lwppiece.hxx"
67 #include "lwpbasetype.hxx"
74 void Read(LwpObjectStream
*pStrm
);
76 sal_Int16 m_nRotation
; //angle
81 class LwpLayoutGeometry
: public LwpVirtualPiece
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
;}
99 LwpPoint m_AbsoluteOrigin
;
100 LwpRotor m_ContainerRotor
;
101 sal_uInt8 m_ContentOrientation
;
104 class LwpLayoutScale
: public LwpVirtualPiece
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
;};
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
;
138 sal_uInt16 m_nPlacement
;
141 #include "lwpmargins.hxx"
143 class LwpLayoutMargins
: public LwpVirtualPiece
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
;}
154 LwpMargins m_Margins
;
155 LwpMargins m_ExtMargins
;
156 LwpMargins m_ExtraMargins
;
159 #include "lwpborderstuff.hxx"
160 class LwpLayoutBorder
: public LwpVirtualPiece
163 LwpLayoutBorder(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
164 virtual ~LwpLayoutBorder();
165 virtual void Parse(IXFStream
* pOutputStream
);
166 LwpBorderStuff
* GetBorderStuff(){ return &m_BorderStuff
;}
170 LwpBorderStuff m_BorderStuff
;
173 class LwpLayoutBackground
: public LwpVirtualPiece
176 LwpLayoutBackground(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
177 virtual ~LwpLayoutBackground();
178 virtual void Parse(IXFStream
* pOutputStream
);
179 LwpBackgroundStuff
* GetBackgoudStuff(){return &m_BackgroundStuff
;}
183 LwpBackgroundStuff m_BackgroundStuff
;
186 class LwpExternalBorder
190 ~LwpExternalBorder();
191 void Read(LwpObjectStream
*pStrm
);
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
203 LwpLayoutExternalBorder(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
204 virtual ~LwpLayoutExternalBorder();
205 virtual void Parse(IXFStream
* pOutputStream
);
209 LwpExternalBorder m_ExtranalBorder
;
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
;}
227 class LwpLayoutColumns
: public LwpVirtualPiece
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
);
239 sal_uInt16 m_nNumCols
;
240 LwpColumnInfo
* m_pColumns
;
243 class LwpLayoutGutters
: public LwpVirtualPiece
246 LwpLayoutGutters(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
247 virtual ~LwpLayoutGutters();
248 virtual void Parse(IXFStream
* pOutputStream
);
249 inline virtual LwpBorderStuff
* GetBorderStuff(){return &m_BorderBuffer
;}
253 LwpBorderStuff m_BorderBuffer
;
261 void Read(LwpObjectStream
*pStrm
);
263 sal_uInt16 m_nPercentage
;
264 sal_uInt16 m_nCorners
;
290 //#endif //BORDER_BMP
299 sal_uInt16 m_nID
;//JoinType
300 sal_uInt16 m_nScaling
;
304 class LwpLayoutJoins
: public LwpVirtualPiece
307 LwpLayoutJoins(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
308 virtual ~LwpLayoutJoins();
309 virtual void Parse(IXFStream
* pOutputStream
);
313 LwpJoinStuff m_JoinStuff
;
316 #include "lwpshadow.hxx"
318 class LwpLayoutShadow
: public LwpVirtualPiece
321 LwpLayoutShadow(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
322 virtual ~LwpLayoutShadow();
323 virtual void Parse(IXFStream
* pOutputStream
);
324 LwpShadow
* GetShadow(){return &m_Shadow
;}
331 /*class LwpLayoutRelativityGuts*/
332 class LwpLayoutRelativityGuts
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
;}
345 LAY_PARENT_RELATIVE
= 1,
349 LAY_CONTENT_RELATIVE
,
371 sal_uInt8 m_nRelType
;
372 sal_uInt8 m_nRelFromWhere
;
373 LwpPoint m_RelDistance
;
375 sal_uInt8 m_nTetherWhere
;
379 class LwpLayoutRelativity
: public LwpVirtualPiece
382 LwpLayoutRelativity(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
383 virtual ~LwpLayoutRelativity();
384 virtual void Parse(IXFStream
* pOutputStream
);
385 LwpLayoutRelativityGuts
* GetRelGuts(){return &m_RelGuts
;}
389 LwpLayoutRelativityGuts m_RelGuts
;